NOTESLITE runs as a single Next.js app with:
- Next.js (App Router)
- React + TypeScript
- Prisma ORM
- PostgreSQL
- Clerk authentication
- Node.js 20+
- npm 10+
- PostgreSQL running locally or remotely
- Clerk project keys
- Install dependencies:
npm install- Create your local environment file:
cp .env.example .env- Fill
.envwith valid values:
DATABASE_URLNEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEYNEXT_PUBLIC_CLERK_SIGN_IN_URL=/auth/sign-inNEXT_PUBLIC_CLERK_SIGN_UP_URL=/auth/sign-upNEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/dashboardNEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/dashboard
Apply existing migrations:
npm run prisma:migrateGenerate Prisma Client (optional, usually auto-generated during migrate):
npm run prisma:generateOpen Prisma Studio (optional):
npm run prisma:studioStart development server:
npm run devOpen http://localhost:3000.
npm run dev- start Next.js in development modenpm run build- create production buildnpm run start- run production servernpm run lint- run ESLintnpm run prisma:migrate- apply dev migrations with Prismanpm run prisma:generate- generate Prisma clientnpm run prisma:studio- open Prisma Studio
app/- Next.js routes, pages, and API handlerscomponents/- UI and page shell componentslib/- shared server utilities (auth, Prisma helpers)prisma/schema.prisma- database modelsmiddleware.ts- auth route protection
- Sign in:
/auth/sign-in - Sign up:
/auth/sign-up /authredirects to/auth/sign-in
Do not run npm run prisma:migrate -- --name init on an existing project setup unless you are intentionally creating a brand-new migration. For normal setup, use:
npm run prisma:migratefrontend/ and backend/ are legacy reference folders from the older split architecture and are not used by the current runtime.