mohit / mycontacts backend
MyContacts Backend
A REST API for contact management.

Your contacts live in three places: your phone, an old spreadsheet and a few screenshots you meant to sort out. If you wanted your own app to read and write them, you would need something in the middle that stores them properly and answers requests in a consistent way.
I built this to learn how a REST API is put together, from the incoming request to the database and back.
The API handles the full life of a contact. You create one, fetch it, change it or delete it, and MongoDB keeps every change. A client, whether a web page, a mobile app or a quick script, talks to it over HTTP and gets structured responses.
Think of it as an address book without the screen.
What you can do
- Create a contact and have it stored in MongoDB.
- Retrieve every contact, or look up a single one.
- Update a contact when a number or an email changes.
- Delete a contact you no longer need.
- Restart the server without losing anything, because the data lives in the database.
How it's organised
Routes map each URL to a controller. Controllers hold the logic for each operation. Models define what a contact looks like in MongoDB. Middleware sits between the request and the controllers, and config holds the setup. server.js starts it all.
Each folder has one job, so you can change how a contact is stored without touching the routes, or add a new route without touching the model.
It ships no interface. It is the API and nothing else.
Built with JavaScript, Node.js, Express, MongoDB and REST APIs.