A simple REST API built using MongoDB to manage drinks data. This project demonstrates CRUD operations with a NoSQL database and basic API structure.
- Create, Read, Update, Delete (CRUD) operations
- MongoDB database integration
- Lightweight and fast API
- JSON-based data handling
- Scalable NoSQL design
- Node.js / Python (depending on your implementation)
- MongoDB
- Express.js / Flask (if applicable)
- Mongoose / PyMongo
APIMONGODB/
βββ models/ # Database schema/models
βββ routes/ # API routes
βββ controllers/ # Business logic
βββ config/ # Database connection
βββ app.js / main.py # Entry point
βββ package.json / requirements.txt
git clone
cd APIMONGODB
For Node.js: npm install
For Python: pip install -r requirements.txt
Make sure MongoDB is running locally: mongod
For Node.js: npm start
For Python: python main.py
| Method | Endpoint | Description |
|---|---|---|
| GET | /drinks | Get all drinks |
| GET | /drinks/:id | Get single drink |
| POST | /drinks | Add new drink |
| PUT | /drinks/:id | Update drink |
| DELETE | /drinks/:id | Delete drink |
{ "_id": "64f1a2b3c4d5e6f7", "name": "Pepsi", "description": "Cold beverage" }
mongodb://127.0.0.1:27017/drinksDB
npm test
or
python -m unittest
- Add authentication (JWT)
- Add validation & error handling
- Deploy using Docker
- Add API documentation (Swagger)
- Your Name
This project is open-source and free to use.