Skip to content

IsamaDes/todo-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Todo Backend

This is the backend API for the Todo application β€” a simple yet powerful task management tool. It handles user authentication, task creation, updates, and deletions, while exposing clean and secure RESTful endpoints.

🌐 Frontend App: https://todo-frontend-rosy-five.vercel.app/

βš™οΈ Features

πŸ” Authentication β€” Secure user signup and login using JSON Web Token (JWT)

πŸ“ Todo Management β€” Create, read, update, and delete todos

🧠 Validation β€” Request data validation for reliability

🧩 RESTful API β€” Clean and predictable endpoint structure

πŸ’Ύ Database Integration β€” Uses MongoDB for data persistence

πŸ—οΈ Tech Stack

Runtime: Node.js

Framework: Express.js

Database: MongoDB + Mongoose

Auth: JSON Web Token (JWT)

Validation: Joi / custom middleware

πŸš€ Getting Started

  1. Clone the repository git clone https://github.com/your-username/todo-backend.git cd todo-backend

  2. Install dependencies npm install

  3. Create a .env file

You can copy the contents from .env.example below:

PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_secret_key

  1. Start the development server npm run dev

πŸ“‘ API Endpoints Method Endpoint Description Auth Required POST /api/auth/signup Register a new user No POST /api/auth/login Login user No GET /api/todos Get all todos Yes POST /api/todos Create a todo Yes PUT /api/todos/:id Update a todo Yes DELETE /api/todos/:id Delete a todo Yes πŸ“ Project Structure todo-backend/ β”‚ β”œβ”€β”€ controllers/ # Route logic β”œβ”€β”€ models/ # Mongoose schemas β”œβ”€β”€ routes/ # API route definitions β”œβ”€β”€ middleware/ # Auth & error handlers β”œβ”€β”€ server.js # App entry point └── .env.example # Example environment variables

πŸ§ͺ Testing

Run tests using:

npm test

πŸ“Œ Notes

Ensure MongoDB is running locally or use a cloud service like MongoDB Atlas.

The backend must be running for the Frontend App to function properly.

πŸ“„ License

This project is licensed under the MIT License β€” you are free to use, modify, and distribute this project with attribution.

πŸ’» Author

Desmond Built with ❀️ and β˜• using Node.js + Express.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published