Add useful dev commands doc for others to reference (#543)

This commit is contained in:
SatsAllDay 2023-10-04 15:45:21 -04:00 committed by GitHub
parent 247744a83c
commit e76b8a2915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
# Useful dev commands
### `nvm use 18`
Switch to use nodejs version 18 in your current shell
### `docker-compose up -d`
Bring up stacker news app via local docker services
### `docker-compose down`
Take down stacker news app via local docker services
### `DATABASE_URL=postgresql://sn:password@localhost:5431/stackernews?schema=public npx prisma migrate dev --create-only`
Create a new prisma migration based on comparing [`schema.prisma`](../prisma/schema.prisma) against your local database
### `DATABASE_URL=postgresql://sn:password@localhost:5431/stackernews?schema=public npx prisma migrate dev`
Create and apply a new prisma migration based on comparing [`schema.prisma`](../prisma/schema.prisma) against your local database
### `npx prisma generate`
Generate the local copy of the prisma ORM client in `node_modules`. This should only be needed to get Intellisense in your editor locally.
### `DATABASE_URL=postgresql://sn:password@localhost:5431/stackernews?schema=public node prisma/seed.js`
Seed your local database
### `psql "postgresql://sn:password@localhost:5431/stackernews"`
Connect to your local database via `psql`
### `docker network connect stackernews_default polar-n1-alice`
Connect your local polar lnd node to the shared docker network (container name may vary)
### `docker network inspect stackernews_default`
Review local docker network