A monorepo for the Life Planner application, managing both the frontend dashboard and the backend academic APIs.
| Technology | Purpose |
|---|---|
| Turborepo | Monorepo build system and task orchestrator. |
| Next.js | Frontend framework for the student dashboard. |
| Express.js | Backend REST API server. |
| PostgreSQL | Relational database for schedules, courses, and users. |
| Prisma | TypeScript ORM for database interactions. |
| Zod | Schema validation for API requests and shared types. |
| Tailwind CSS | Utility-first CSS framework for frontend styling. |
life-planner/
├── apps/
│ ├── api/ # Express backend
│ └── web/ # Next.js frontend
└── packages/
├── db/ # Prisma client and database schemas
├── schemas/ # Shared Zod validation schemas
└── types/ # Shared TypeScript interfaces
Make sure you have the following installed on your machine:
- Node.js (v18 or higher)
- Git
- PostgreSQL (Running locally or via a cloud provider)
- Clone the repository:
git clone <your-github-repo-url>
cd life-planner- Install all dependencies:
(Do not install packages inside individual folders. Run this at the root.)
npm install- Set up Environment Variables:
- Duplicate
.env.examplein the root and rename it to.env. - Fill in your local PostgreSQL database URL.
- Initialize the Database:
cd packages/db
npx prisma db push
cd ../../- Start the Development Servers:
npm run dev- Frontend:
http://localhost:3000 - Backend API:
http://localhost:4000
These are the minimal steps required for most frontend and feature work. Backend-specific steps (migrations, generating Prisma client) are optional and documented separately below.
- Clone and install (use the committed lockfile for consistent versions):
git clone <your-github-repo-url>
cd life-planner
npm ci- Create local env file from the example and add only values required for frontend or mock APIs:
cp .env.example .env
# edit .env to fill values- Start developer servers (runs both apps):
npm run dev- Run linters and formatting checks before committing:
npm run lint
npm run format- Tests (if present):
npm testFollow these steps only if you're responsible for database changes or running the API locally with a real DB.
- Ensure PostgreSQL is running locally or use a connection string pointing to a dev database.
- From the
packages/dbdirectory run the following to apply migrations and generate the Prisma client:
cd packages/db
npx prisma migrate dev --name init
npx prisma generate
cd ../../- If the project provides seeds, run them as documented in
packages/db.
Note: Prisma migrations are source-controlled in
packages/db/prisma/migrations/. Do not reformat or delete migration files.
We recommend a feature-branch + PR workflow targeting main. We commit package-lock.json to lock dependency versions so everyone's installs are consistent.
- Branch naming:
feature/short-description,fix/short-description,chore/short-description - Keep commits small and focused. Use Conventional Commits for clear history.
Example Conventional Commit messages:
feat(api): add course enrollment endpointfix(web): correct datetime display bugdocs: update README onboardingchore: bump deps
Example commit sequence:
# create a feature branch
git checkout -b feature/add-user-endpoint
# stage changes
git add -A
# commit with a concise Conventional Commit message
git commit -m "feat(api): add user create endpoint"
# push branch and open a PR
git push -u origin feature/add-user-endpointIf you must push directly to main (avoid when possible), ensure CI/lint/tests pass locally and use:
git checkout main
git pull
git merge --no-ff feature/add-user-endpoint -m "chore: merge feature/add-user-endpoint"
git push origin main- Start with a type:
feat,fix,docs,style,refactor,perf,test,chore. - Scope is optional but useful:
feat(api): ...orfix(web): .... - Keep the subject line <= 72 chars. Optionally add a longer body separated by a blank line.
Example full commit with body:
feat(api): add course enrollment endpoint
Adds POST /courses/:id/enroll to allow students to enroll. Validates
request body with Zod and returns 201 on success.
Closes: #123
- Run
npm ci(uses committedpackage-lock.json) - Run
npm run lintand address issues - Run
npm test(if tests exist) - Build production bundles if changing build output:
npm run build