This is an extremely early MVP, so there is a lot to do.
Our stack / architecture is:
- NextJS hosted on Vercel (already setup here)
- Prisma as our ORM (makes things pretty smooth)
- PostgreSQL Managed Database from Digital Ocean.
- Clone this repo.
- Install dependencies with
npm i
. - Copy
.env.template
to.env
. - Get a local postgres db running.
Docker is probably easiest, but local postgres would also work.
With Docker installed, run
docker run --name my-covid-story-dev -p 5432:5432 -e POSTGRES_PASSWORD=mycovidstory -d postgres:12.6-alpine
(this will match the DB URL string in.env
). - Run
npx prisma migrate deploy
to apply migrations inprisma/migrations
. - Run
npx prisma db seed --preview-feature
to see test data fromprisma/seed.ts
. - Run
npm run dev
to start the dev server. Open http://localhost:3000 in your browser to see the app. - Run
npm test
to run the test suite. This also gets run automatically on each Pull Request.
We use Prisma Migrate to manage the evolution of our database schema.
To work around a current limitation in Prisma, we exclude certain relation fields from the schema when running prisma migrate
.
These fields are marked with a //nomigrate
comment in the schema.prisma
file.
Excluding them is handled automatically by the prisma.sh
wrapper script for the prisma CLI.
For simplicity, you can always use ./prisma.sh
intead of npx prisma
and the script will do the right thing.
This is a Next.js application bootstrapped with create-next-app
and deployed on the Vercel Platform.
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.
- Next.js deployment documentation - deployment on Vercel.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!