budibase/examples/nextjs-api-sales
dependabot[bot] 7c63ce4876 Bump json5 from 1.0.1 to 1.0.2 in /examples/nextjs-api-sales
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-05 09:08:40 +00:00
..
components
db
definitions Renaming data source -> datasource as per Mel's request. 2022-09-14 12:11:20 +01:00
pages
public
styles
utilities
.eslintrc.json
.gitignore
README.md
next-env.d.ts
next.config.js
package.json switched from deprecated node-sass to sass library 2022-09-06 21:51:45 +01:00
tsconfig.json
yarn.lock Bump json5 from 1.0.1 to 1.0.2 in /examples/nextjs-api-sales 2023-01-05 09:08:40 +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.