Download the repo.
Install dependencies
npm install
You'll need a .env file which will not be committed to the repo since it contains secrets. Get that from a coworker.
I prefer docker
[Here is a great article] (https://www.codementor.io/@engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb) install postgres for development
brew install postgresql
Ensure it runs on startup (if you want)
brew services start postgresql@14
create the development user and database
createuser local_dev --createdb
createdb e3_virtualizer -U local_dev
First install docker desktop from docker.com
Build the image from the dockerfile
docker build -t pg .
Run the container
docker run -d -p 5432:5432 pg
Check that the container is running
docker ps
Generate a client
npx prisma generate
push the schema to your database
npx prisma db push
run the seeder
npx prisma db seed
view the data in app OR
npx prisma studio
Migrations will be automatically run in production environment. To Create a new migration, change schema.prisma then run
npx prisma migrate dev --name {some name for the migration}
View the migration at prisma/migrations/...
You'll need a clerk user so lets create on of those first. After a clerk user is created. Copy the user id. Navigate to seed.mjs and add the new user with the user id.
psql -d e3_virtualizer --username=local_dev -W