{"id":18151415,"url":"https://github.com/hazemelakbawy/todo-list-api","last_synced_at":"2026-04-07T22:31:45.677Z","repository":{"id":257905270,"uuid":"868521265","full_name":"HazemElakbawy/Todo-List-API","owner":"HazemElakbawy","description":"A RESTful API for managing to-do lists with user authentication. Built with Java 22 and Spring Boot, it features CRUD operations, token-based authentication, and documentation via Swagger UI. Docker support included for easy deployment.","archived":false,"fork":false,"pushed_at":"2024-10-15T17:03:05.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T23:34:02.810Z","etag":null,"topics":["docker","docker-compose","java","maven","mysql","rest-api","spring-boot","spring-data-jpa","spring-security","swagger-ui","todo-list-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HazemElakbawy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-06T15:43:50.000Z","updated_at":"2024-10-30T08:32:17.000Z","dependencies_parsed_at":"2024-10-17T11:03:35.255Z","dependency_job_id":null,"html_url":"https://github.com/HazemElakbawy/Todo-List-API","commit_stats":null,"previous_names":["hazemelakbawy/todo-list-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HazemElakbawy/Todo-List-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazemElakbawy%2FTodo-List-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazemElakbawy%2FTodo-List-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazemElakbawy%2FTodo-List-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazemElakbawy%2FTodo-List-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HazemElakbawy","download_url":"https://codeload.github.com/HazemElakbawy/Todo-List-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazemElakbawy%2FTodo-List-API/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268696935,"owners_count":24292386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","java","maven","mysql","rest-api","spring-boot","spring-data-jpa","spring-security","swagger-ui","todo-list-api"],"created_at":"2024-11-02T01:07:35.604Z","updated_at":"2026-04-07T22:31:45.633Z","avatar_url":"https://github.com/HazemElakbawy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# To-Do List API 📝\n\n- This project is a RESTful API for managing a to-do list with user authentication.\n- It provides endpoints for user registration, login, and CRUD operations on to-do items.\n- This project is part of the community-driven projects published\n  on [roadmap.sh](https://roadmap.sh/projects/todo-list-api).\n- Feel free to visit the [projects page](https://roadmap.sh/projects) to explore more.\n\n## Technologies Used 🛠️\n\n- Java 22 ☕\n- Spring Boot 🍃\n- Spring Security 🔒\n- Spring Data JPA 📊\n- MySQL 🐬️\n- Docker \u0026 Docker Compose 🐳\n- Maven 📦\n- Swagger UI 📚\n\n## Features 🌟\n\n- User registration and authentication\n- Create, read, update, and delete to-do items\n- Pagination and filtering for to-do list\n- Token-based authentication with refresh token mechanism\n- Error handling and security measures\n- Data validation\n- API documentation using Swagger UI\n\n## Prerequisites ⚙️\n\n- Java 22 JDK\n- Docker and Docker Compose\n- Maven\n\n## Getting Started 🚀\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/yourusername/todo-list-api.git\n   cd todo-list-api\n   ```\n\n2. Build the project:\n   ```\n   mvn clean package\n   ```\n\n3. Start the application and database using Docker Compose:\n   ```\n   docker-compose up -d\n   ```\n\n4. The API will be available at `http://localhost:8080`\n\n## Swagger UI 📊\n\n- You can explore and test the API using Swagger UI. After starting the application, open the following URL in your\n  browser: `http://localhost:8080/swagger-ui/index.html`\n- This will load the interactive Swagger interface where you can view API documentation, test API endpoints, and inspect\n  request/response details.\n\n## API Endpoints 🔗\n\n### User Registration\n\n- `POST /register`\n  - Request:\n    ```json\n      {\n        \"username\": \"John Doe\",\n        \"email\": \"john@doe.com\",\n        \"password\": \"password\"\n      }\n    ```\n  - Response:\n    ```json\n      {\n        \"refreshToken\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqb2huQGRvZS5jb20iLCJpYXQiOjE3MjkwMTExMjYsImV4cCI6MTcyOTYxNTkyNn0.UKJ0N32v2cmREU46FbOoe0kF-LqizTi6TY5IO0y8xNyEvUt6ql9QfkhP1nO92uMb67ZQjqKOYI5KyF00GdgQzw\",\n        \"accessToken\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqb2huQGRvZS5jb20iLCJpYXQiOjE3MjkwMTExMjYsImV4cCI6MTcyOTAxODMyNn0.iKEb1nItMmSzCw868CdFCipY82W0_MyWDRL19EYYcj7-K7GGUauo6WjpdEIQ84sOWEwyhj7GY7tRqpLKkGsosQ\"\n      }\n    ```\n\n### User Login\n\n- `POST /login`\n  - Request:\n      ```json\n        {\n          \"email\": \"john@doe.com\",\n          \"password\": \"password\"\n        }\n      ```\n  - Response:\n    ```json\n      {\n        \"refreshToken\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqb2huQGRvZS5jb20iLCJpYXQiOjE3MjkwMTExMjYsImV4cCI6MTcyOTYxNTkyNn0.UKJ0N32v2cmREU46FbOoe0kF-LqizTi6TY5IO0y8xNyEvUt6ql9QfkhP1nO92uMb67ZQjqKOYI5KyF00GdgQzw\",\n        \"accessToken\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqb2huQGRvZS5jb20iLCJpYXQiOjE3MjkwMTExMjYsImV4cCI6MTcyOTAxODMyNn0.iKEb1nItMmSzCw868CdFCipY82W0_MyWDRL19EYYcj7-K7GGUauo6WjpdEIQ84sOWEwyhj7GY7tRqpLKkGsosQ\"\n      }\n    ```\n\n### Refresh Token\n\n- `POST /refresh-token`\n  - Headers: `Authorization: Bearer \u003ctoken\u003e`\n  - Response:\n    ```json\n      {\n        \"refreshToken\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqb2huQGRvZS5jb20iLCJpYXQiOjE3MjkwMTExMjYsImV4cCI6MTcyOTYxNTkyNn0.UKJ0N32v2cmREU46FbOoe0kF-LqizTi6TY5IO0y8xNyEvUt6ql9QfkhP1nO92uMb67ZQjqKOYI5KyF00GdgQzw\",\n        \"accessToken\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqb2huQGRvZS5jb20iLCJpYXQiOjE3MjkwMTExMjYsImV4cCI6MTcyOTAxODMyNn0.iKEb1nItMmSzCw868CdFCipY82W0_MyWDRL19EYYcj7-K7GGUauo6WjpdEIQ84sOWEwyhj7GY7tRqpLKkGsosQ\"\n      }\n    ```\n\n### Create a To-Do Item\n\n- `POST /todos`\n  - Headers: `Authorization: Bearer \u003ctoken\u003e`\n  - Request:\n    ```json\n      {\n        \"title\": \"Buy groceries\",\n        \"description\": \"Buy milk, eggs, and bread\"\n      }\n    ```\n  - Response:\n    ```json\n      {\n        \"id\": 1,\n        \"title\": \"Buy groceries\",\n        \"description\": \"Buy milk, eggs, and bread\"\n      }\n    ```\n\n### Update a To-Do Item\n\n- `PUT /todos/{id}`\n  - Headers: `Authorization: Bearer \u003ctoken\u003e`\n  - Request:\n      ```json\n        {\n          \"title\": \"Buy groceries\",\n          \"description\": \"Buy milk, eggs, bread, and cheese\"\n        }\n      ```\n  - Response:\n    ```json\n      {\n        \"id\": 1,\n        \"title\": \"Buy groceries\",\n        \"description\": \"Buy milk, eggs, bread, and cheese\"\n      } \n    ```\n\n### Delete a To-Do Item\n\n- `DELETE /todos/{id}`\n  - Headers: `Authorization: Bearer \u003ctoken\u003e`\n  - Response: 204 No Content\n\n### Get To-Do Items\n\n- `GET /todos?page=1\u0026limit=10`\n  - Headers: `Authorization: Bearer \u003ctoken\u003e`\n  - Response:\n    ```json\n      {\n        \"data\": [\n          {\n            \"id\": 1,\n            \"title\": \"Buy groceries\",\n            \"description\": \"Buy milk, eggs, bread\"\n          },\n          {\n            \"id\": 2,\n            \"title\": \"Pay bills\",\n            \"description\": \"Pay electricity and water bills\"\n          }\n        ],\n        \"page\": 1,\n        \"limit\": 10,\n        \"total\": 2\n      }\n    ```\n\n## Security 🔒\n\n- Passwords are hashed before storing in the database\n- Token-based authentication is implemented, including refresh tokens.\n- Input validation is performed on all endpoints\n\n## Error Handling ⚠️\n\nThe API uses appropriate HTTP status codes and error messages:\n\n- 400 Bad Request: For invalid input\n- 401 Unauthorized: For authentication failures\n- 403 Forbidden: For authorization failures\n- 404 Not Found: For resources that don't exist\n- 500 Internal Server Error: For server-side errors","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazemelakbawy%2Ftodo-list-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazemelakbawy%2Ftodo-list-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazemelakbawy%2Ftodo-list-api/lists"}