Skip to content

ChangePlusPlusVandy/american-spcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

American SPCC Learning Management System

Learning Management System (LMS) monorepo for The American Society for the Positive Care of Children (American SPCC), a national nonprofit supporting parents, caregivers, and educators through evidence-based resources and interactive learning.

IMPORTANT!! Make sure you run git pull + npx prisma db push often! Also, remember to make a new branch everytime you execute a task. The branch name should be similar to the task name. After you have pushed your changes, make a PR so I (Sophie) can review it.

1. Install dependencies

npm install

Run this in both the frontend and backend folders.

2. Run the development servers

Backend (Express + Prisma + PostgreSQL)

cd backend
npm run dev

The backend will run on http://localhost:8000.

Frontend (React + Vite)

cd frontend
npm run dev

The frontend will run on http://localhost:5173.

3. Set up Local Supabase (PostgreSQL)

The project uses Supabase for PostgreSQL and Prisma ORM. To work locally, you'll use a Dockerized Supabase instance.

Install the Supabase CLI

macOS (Homebrew):

brew install supabase/tap/supabase

Other platforms: See the full installation guide

Initialize and Start Supabase Locally

Docker Desktop must be installed and running (download here: https://www.docker.com/products/docker-desktop/)

From the project backend (where the supabase folder will live):

npx supabase start

This launches local containers for:

  • PostgreSQL (port 54322)
  • Supabase API (port 54321)
  • Supabase Studio (port 54323)

After it starts, you'll see a database URL like:

postgres://postgres:postgres@localhost:54322/postgres

Copy that URL for the next step.

4. Configure environment variables

Create a .env file in the /backend directory:

DATABASE_URL="postgresql://postgres:postgres@localhost:54322/postgres"
DIRECT_URL="postgresql://postgres:postgres@localhost:54322/postgres"

5. Initialize the database schema

Push your Prisma schema to the local Supabase PostgreSQL database:

cd backend
npx prisma db push

Then generate the Prisma client:

npx prisma generate

You can verify tables in Supabase Studio at http://localhost:54323

When you're done developing, stop the containers to free ports and memory:

npx supabase stop

6. Run prettier

Before each commit, run prettier to fix formatting:

npm run format

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages