Conduit Backend
RealWorld (Conduit) backend implemented in TypeScript + Express + Prisma/PostgreSQL.
Setup
npm install
npx prisma generate
npx prisma migrate dev --name init
npm run dev
Configure .env:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/conduit?schema=public"
JWT_SECRET="supersecretjwtkeychangeme"
PORT=3000
Endpoints
Auth / Users
POST /api/users— registerPOST /api/users/login— log inGET /api/user— current userPUT /api/user— update current user
Profiles
GET /api/profiles/:usernamePOST /api/profiles/:username/followDELETE /api/profiles/:username/follow
Articles
GET /api/articles— list (filters: tag, author, favorited, limit, offset)GET /api/articles/feedGET /api/articles/:slugPOST /api/articlesPUT /api/articles/:slugDELETE /api/articles/:slugPOST /api/articles/:slug/favoriteDELETE /api/articles/:slug/favorite
Comments
GET /api/articles/:slug/commentsPOST /api/articles/:slug/commentsDELETE /api/articles/:slug/comments/:id
Tags
GET /api/tags
Tests
npm test