Skip to content

GTBitsOfGood/hope-for-haiti

Repository files navigation

hope-for-haiti

Prerequisites

  • Accessible PostgreSQL server with a database. You can create one using Docker:
docker run \
  --name postgres-17 \
  -e POSTGRES_PASSWORD=password \
  -p 5432:5432 \
  -v ~/.postgres:/var/lib/postgresql/data \
  -d \
  postgres:17

Getting Started

  1. Install dependencies
npm install
  1. Generate Auth.js secret (and create your .env file)
# This will generate the .env file for you
echo "AUTH_SECRET=\"$(npx auth secret --raw)\"" >> .env
  1. Set the DATABASE_URL env var in .env
DATABASE_URL="postgresql://postgres:password@localhost:5432/hope_for_haiti"
  1. (OPTIONAL) Set the SENDGRID_API_KEY and SENDGRID_SENDER env vars in .env
SENDGRID_API_KEY="abcdefg"
SENDGRID_SENDER="[email protected]"
  1. Initialize the database
npm run db:migrate
npm run db:seed

Development Guide

Database Usage

This project uses Prisma as its ORM, but wraps some of its commands for ease of access.

Viewing the Database

npm run db:view

Making Schema Changes

  1. Change the schema
  2. Generate the migration
# This will prompt you to name the migration. Usually something like "add xyz table"
npm run db:migrate

Seeding the Database

npm run db:seed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published