budibase/examples/nextjs-api-sales
dependabot[bot] 92df98581f
Bump micromatch from 4.0.4 to 4.0.8 in /examples/nextjs-api-sales
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.4 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.4...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-30 16:20:33 +00:00
..
components Editting readme for example and linting example. 2022-03-10 10:12:21 +00:00
db Final version of example, has save form and table of sales, supporting relationships and pagination all from Postgres. 2022-03-09 15:00:36 +00:00
definitions Renaming data source -> datasource as per Mel's request. 2022-09-14 12:11:20 +01:00
pages Editting readme for example and linting example. 2022-03-10 10:12:21 +00:00
public Final version of example, has save form and table of sales, supporting relationships and pagination all from Postgres. 2022-03-09 15:00:36 +00:00
styles Adjusting colours, some quick fixes after changing to sales person for relationship name. 2022-03-09 15:19:18 +00:00
utilities Editting readme for example and linting example. 2022-03-10 10:12:21 +00:00
.eslintrc.json initial version of nextjs app with bulma, for use with BB public API. 2022-03-08 13:43:12 +00:00
.gitignore initial version of nextjs app with bulma, for use with BB public API. 2022-03-08 13:43:12 +00:00
README.md Merge branch 'examples/nextjs' of github.com:Budibase/budibase into examples/nextjs 2022-03-10 17:56:52 +00:00
next-env.d.ts initial version of nextjs app with bulma, for use with BB public API. 2022-03-08 13:43:12 +00:00
next.config.js Editting readme for example and linting example. 2022-03-10 10:12:21 +00:00
package.json Bump next from 12.1.0 to 14.1.1 in /examples/nextjs-api-sales 2024-07-04 10:43:45 +00:00
tsconfig.json initial version of nextjs app with bulma, for use with BB public API. 2022-03-08 13:43:12 +00:00
yarn.lock Bump micromatch from 4.0.4 to 4.0.8 in /examples/nextjs-api-sales 2024-08-30 16:20:33 +00:00

README.md

Budibase API + Next.js example

This is an example of how Budibase can be used as a backend for a Postgres database for a Next.js sales app. You will need to follow the walk-through that has been published in the Budibase docs to set up your Budibase app for this example.

Pre-requisites

To use this example you will need:

  1. Docker
  2. Docker Compose
  3. Node.js
  4. A self-hosted Budibase installation

Getting Started

The first step is to set up the database - you can do this by going to the db/ directory and running the command:

docker-compose up

The next step is to follow the example walk-through and set up a Budibase app as it describes. Once you've done this you can configure the settings in next.config.js, specifically the apiKey, host and appName.

Finally, you can start the dev server with the following command:

npm run dev
# or
yarn dev

Accessing the app

Open http://localhost:3001 with your browser to see the sales app.

Look in the API routes (pages/api/sales.ts and pages/api/salespeople.ts) to see how this is integrated with Budibase. There is also a utility file where some core functions and types have been defined, in utilities/index.ts.

Attribution

This example was set up using Next.js and bootstrapped with create-next-app.