This is a Next.js project bootstrapped with create-next-app
und setup from boilerplate Primereact-Sakai
- Docker essential for development database
- Node essential as runtime engine
- LiveKit local server (optional, if you use the cloud)
- MongoDB Tools used to execute dumps and imports to the db
- Prisma for syntax highlighting in prisma files
- Prettier code formatter
- Playwright testing in VSC
- MongoDBCompass for inspecting the db
To get started, install dependencies with npm:
npm install
To setup a Mongodb in Docker run
npm run docker:db-dev
After that you need to generate the prisma entities.
npx prisma generate
If you have problems with certificates, you may need to set set NODE_TLS_REJECT_UNAUTHORIZED=0
to install prisma client.
Other helping commands are npm config set strict-ssl false
and npm config set registry "http://registry.npmjs.org/"
Then run the server. The server would also start without any other service (e.g. db or websocket server).
npm run dev
Open http://localhost:3000 with your browser to see the result.
To import ruletables data simply run
npm run db:import
To package Next.js for deployment run
npm run build
This will generate the optimal build of the app. In addition to that, it also does code checks with eslint and there should be no errors to continue.
For shipment and final deployment you can run
npm run docker:build
This will build the image for the app and all components.
If you want to only build and update a certain service use
npm run docker:build:app
to build only the specified image.
To deploy the the app with an mongodb cluster run
npm run docker:deploy
The db cluster can be accessed with an mongodb express agent http://localhost:8081 (root/prisma)
For testing simply run
npm run test
The easiest way to debug tests is via the VSC Plugin in the testing view or in the testfile itself.
To test the server without running any tests you can run.
npm run dev:test
This start the normal webserver with the test environment configuration.
You can also run the server and execute any test against the server. Playwright won't start another webserver, if there is already one live. This also applies to to socket server.
Now you can start the test run in debug mode.
npm run test:debug
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
MIT © RainerQuatsch