Workshop for Wise Woman Code APAC 2024
See Tasks
npm run dev
Nextjs development mode by default will already have hot-reloading for frontend pages. The development docker will use nodemon to ensure hot-reloading for the api routes too.
npm run docker:dev
npm run setup:dev
npm run test
Running of frontend tests:
npm run test -- "frontend"
Running of backend tests:
npm run test -- "api"
For example, Running the tests in the "/api/transfers" folder:
npm run test -- "api/transfers"
npm run test -- "api/transfers/route.test.js"
Any of the above will work because jest does a regex search of the tests.
DBeaver is one of the options you could use to connect to the database.
Host: localhost Port: 5432 Databse: wise Username: wwc-apac Password: STRONGpass
The .env.local
and .env.migrate
are included in this project because there are no real secrets in them - the local database user and password is not really a secret because they are already in the Dockerfile. If we were really to make a production-ready project, it should read the database env variables from somewhere safer like a secrets vault in AWS.
Nextjs will automatically load .env.local
as process.env
variables, but for knex commands we use dotenv-cli
to load the env variables.