A bookmark management service API built with Fastify and Prisma.
This codebase was developed by a small team (2 engineers) to power a bookmarking app, Pocket. The service currently handles approximately 1,000 daily active users and is being considered for acquisition by a larger company with potential expansion to 100k+ users.
Time: 30-60 minutes (review only - no need to build or run the project, unless you want)
Please review this codebase and prepare to discuss the following in our conversation:
-
What would you improve first, and why? Consider: impact, effort, risk
-
What trade-offs do you think were made? Consider: speed vs quality, simplicity vs extensibility
-
Where might this break at scale or in production? Consider: 100k users, high write volume, edge cases
-
What questions would you ask before making changes? Consider: product context, team constraints, priorities
src/ # Most application logic
prisma/ # Database schema
tests/ # Test suite
- Node.js + TypeScript
- Fastify (HTTP framework)
- Prisma (Database ORM)
- SQLite (no setup required)
- JWT authentication (jose library)
POST /api/auth/register- Register a new userPOST /api/auth/login- Login and receive JWT token
POST /api/bookmarks- Create a bookmarkGET /api/bookmarks- List bookmarks (supports filtering and pagination)GET /api/bookmarks/:id- Get a single bookmarkPATCH /api/bookmarks/:id- Update a bookmarkDELETE /api/bookmarks/:id- Delete a bookmarkPOST /api/bookmarks/:id/archive- Archive a bookmarkPOST /api/bookmarks/:id/unarchive- Unarchive a bookmark
GET /api/tags- List all tagsPATCH /api/tags/:id- Rename a tagDELETE /api/tags/:id- Delete a tag
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Generate Prisma client
npm run db:generate
# Push database schema
npm run db:push
# Start development server
npm run dev# Run tests once
npm test
# Run tests in watch mode
npm run test:watch