# Babbelkes A simple chat API built with Node.js, Express, and MongoDB. ## Features - Two CRUD entities: Users and Rooms - Token-based authentication - Pagination with limit/offset - Search by field value - Input validation ### Installation ```bash # Clone the repository git clone https://github.com/nasrlol/babbelkes.git cd babbelkes # Install dependencies npm install # Start MongoDB (using Podman) podman run -d --name mongodb -p 27017:27017 -v mongo_data:/data/db docker.io/library/mongo:7 # Start the server npm start ``` The API runs on http://localhost:3000 ## API Documentation Visit http://localhost:3000 for full API documentation. ### Quick Start ```bash # Create a user (returns token) curl -X POST http://localhost:3000/api/users \ -H "Content-Type: application/json" \ -d '{"username": "john"}' # Login (get token) curl -X POST http://localhost:3000/api/users/login \ -H "Content-Type: application/json" \ -d '{"username": "john"}' # Access protected routes curl http://localhost:3000/api/rooms \ -H "Authorization: Bearer " ``` ## Sources - [Express.js Documentation](https://expressjs.com/) - [Mongoose Documentation](https://mongoosejs.com/docs/) - [MongoDB Documentation](https://www.mongodb.com/docs/)