You need to install on your local workstation:
- git
- nodejs
- npm
- docker
Prepare your local config:
cp ./.env.development.template ./.env.development.localDo changes in ./.env.development.local now.
Install your environment
npm installGenerate the typescript prisma client:
npm run prismageneratePush all migrations to the postgresql database. This is only needed on first start when docker volume is initially created.
npm run prismadbpushnpm run devHappy coding. API is available at http://localhost:3000/api Check your API via curl:
source ./.env.development.local && curl localhost:3000/api/token/correct -H "Accept: application/json" -H "Authorization: Bearer ${API_BEARER_TOKEN}"Expected response: {"message":"success"}
If you do changes to the database schema run (while db is up)
npm run prismamigratedevStop it with CTRL+C
npm run build
npm run startRun Cypress tests (make sure db docker and local node server are running)
Warning: This command truncates your table content!
npm run testRun to check for linting errors:
npx eslint .Delete all generated files
rm -rf .next/ node_modules/ next-env.d.ts cypress/screenshots/ cypress/videos/ generated/