A side project to test out clean code, express, building my own mock db
- User registration/login system with Passport using Local Strategy with JWT token implementaion.
- Protected routes with authmiddleware that checks for JWT validation using expressJWT
- Mocked database, so no database is required.
- Auto generated fake data for users and users posts.
- Cron job that runs every minute (can be modified) to drop database and seed new data every 1 hour.
- POST /api/auth/register
- POST /api/auth/login
- GET (JWT Protected) /api/auth/me
- GET /api/posts
- GET /api/posts/1
- GET /api/posts/:authorId
- POST (JWT Protected) /api/posts/add
- PUT (JWT Protected) /api/posts/1
- DELETE (JWT Protected) /api/posts/1
To run in development mode
npm start
To build
npm run build