Welcome! Your job is to fix a broken and unfinished API.
A developer left this project in a mess. We know there are at least two big security bugs, and it's missing all the social features.
Your mission is to:
- Find and fix the bugs.
- Build the missing features from scratch.
-
Install the packages: npm install
-
Create a file named ".env" in the main folder.
-
Copy this into your new .env file: MONGO_URI=mongodb://localhost:27017/social-app-hackathon JWT_SECRET=putanysupersecretkeyhere
-
Make sure your local MongoDB is running.
-
Start the server: npm run dev
-
Models:
- User.js (username, password, bio)
-
Routes (in the 'routes' folder):
- POST /api/register (Works)
- POST /api/login (Has a bug!)
- GET /api/users (Works)
- PUT /api/users/:id (Has a bug!)