In you terminal:
git clone https://github.com/usdevs/lms.git
cd lmsnpm installThis will also run prisma generate automatically via the postinstall script.
The app uses PostgreSQL with Prisma as the ORM.
For local dev, we will run the Postgres locally with Docker using the provided docker-compose.yaml
From the project root:
docker compose up -dThis starts a Postgres 17 container with:
- Host port:
5432 - User:
postgres - Password:
postgres123 - Database:
lms_dev
Create a .env file in the project root (if it doesn’t exist yet) and define the Prisma connection URLs.
At minimum, you should have:
DATABASE_URL="postgresql://postgres:postgres123@localhost:5432/lms_dev?schema=public"
DIRECT_URL="postgresql://postgres:postgres123@localhost:5432/lms_dev?schema=public"DATABASE_URL: Used by Prisma Client at runtimeDIRECT_URL: Used by Prisma Migrate to apply migrations directly
If you are not using Docker, adjust the host, port, user, password, and database to match your own Postgres instance.
Once the database is running and .env is configured:
npx prisma migrate dev --name initThis will:
- Create the database schema defined in here
- Apply all migrations to your Postgres instance
- Regenerate the Prisma Client
For more detail on migration workflows, see here
To seed the database with test data as defined here,
npx prisma db seedStart the Next.js dev server:
npm run devThen open http://localhost:3000 in your browser.
-
Database connection errors
- Ensure Docker is running (if using Docker)
- Check that
DATABASE_URLandDIRECT_URLin.envare correct - Confirm Postgres is listening on the expected host/port
-
Prisma migration issues
- See
DB GUIDE.mdfor detailed instructions on migrations and common errors
- See
For more information on the design, read here
For more information on the functionality plans, read here