A notes app on Next.js (App Router) + MongoDB, structured to match the Bits of Good project conventions used in GTBitsOfGood/ican.
- TypeScript
- Next.js (App Router)
- MongoDB / Mongoose
- TailwindCSS
- React Query
- Zod
Install MongoDB Community Server to host a local instance, or use the bundled Docker setup. MongoDB Compass is helpful for inspecting the database.
Node version is pinned in .nvmrc. With nvm:
nvm use
npm installcp .env.local.example .env.local # then edit MONGODB_URIRun both at the same time:
npm run devdocker compose upInstall and enable Prettier in VSCode. A pre-commit hook formats and lints staged files automatically.
| Command | Does |
|---|---|
npm run dev |
Start the dev server |
npm run build |
Production build |
npm run lint |
ESLint |
npm run typecheck |
tsc --noEmit |
npm run format |
Prettier write |
npm run format:check |
Prettier check (runs in CI) |
Base path is /api/v1.
| Method | Endpoint | Does |
|---|---|---|
GET |
/notes |
List notes, newest first |
POST |
/notes |
Create { title, body } |
GET |
/notes/:id |
Read one |
PATCH |
/notes/:id |
Update { title?, body? } |
DELETE |
/notes/:id |
Delete, returns 204 |
See docs/ARCHITECTURE.md for the layering and the checklist for adding a new resource.
src/
app/
api/v1/notes/route.ts
api/v1/notes/[id]/route.ts
layout.tsx
page.tsx
components/
QueryProvider.tsx
hooks/useNotes.ts
notes/
ui/
constants/
db/
actions/note.ts
models/note.ts
dbConnect.ts
http/
fetchHTTPClient.ts
noteHTTPClient.ts
lib/
middleware/
services/note.ts
styles/globals.css
types/
exceptions.ts
models.ts
note.ts
utils/
errorHandler.ts
errorMessages.ts
note.ts
validation.ts
withErrorHandler.ts
Branches, deploy previews, and branch protection are documented in docs/ENVIRONMENTS.md.
production→ production sitemain→ staging site (default branch, base for feature PRs)- every branch and PR → Netlify deploy preview