This is a basic next.js / nest.js application in a nx monorepo with postgres database in docker-compose.
-
cp docker.env.example docker.env
and add env values. Rundocker-compose up
. -
yarn install
. -
cp ./apps/api/.env.example ./apps/api/.env
and add env values. -
Run migrations:
yarn run migration:run
. -
Seed the db:
nx seed api
. -
Start api:
nx serve api
. -
Start web:
nx serve web
.
Log in on http://localhost:4200/ with credentials from seeds.
-
Store jwt token in user's browser.
-
Add another user to the seeds.
-
Create a simple (1-1) chat using socket.io. Messages should be stored in db.
-
Use jwt token for websocket authentication.
-
Logout and disconnect websocket on token expiration.
Generate migration: npm run migration:generate --name=user
, where name is a new migration's name.