https://github.com/sudhanshugt/todos-api
https://github.com/sudhanshugt/todos-api
freeapi java spring-boot todo todoapi todolist
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sudhanshugt/todos-api
- Owner: sudhanshuGt
- Created: 2025-07-14T16:24:29.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-07-14T16:32:21.000Z (8 months ago)
- Last Synced: 2025-07-14T21:17:15.704Z (8 months ago)
- Topics: freeapi, java, spring-boot, todo, todoapi, todolist
- Language: Java
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🛠️ Spring Boot Todo API
This is a secure and minimal RESTful API for a Todo application built using **Spring Boot** with **JWT-based authentication**. Designed to work seamlessly with frontend clients (Flutter, React, etc.).
# Deployed on : https://todos-api-xqqr.onrender.com
---
## 🔗 API Endpoints
### 🔐 Authentication
**POST `/auth/signup`**
Registers a new user.
Send a JSON object with `name`, `email`, and `password`. On success, returns a JWT token.
```json
Request:
{
"name": "John Doe",
"email": "john@example.com",
"password": "secret123"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6Ikp..."
}
POST /auth/login
Authenticates an existing user. Returns a JWT token if successful.
json
Copy
Edit
Request:
{
"email": "john@example.com",
"password": "secret123"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6Ikp..."
}
All the following /todos endpoints require an Authorization: Bearer header.
📝 Todos
GET /todos
Returns all todos for the authenticated user.
json
Copy
Edit
Response:
[
{
"id": 1,
"todo": "Buy groceries",
"completed": false
},
{
"id": 2,
"todo": "Finish project",
"completed": true
}
]
POST /todos
Adds a new todo item.
json
Copy
Edit
Request:
{
"todo": "Learn Spring Boot",
"completed": false
}
Response:
{
"id": 3,
"todo": "Learn Spring Boot",
"completed": false
}
PUT /todos/{id}
Updates a todo by ID.
json
Copy
Edit
Request:
{
"todo": "Learn Spring Boot Advanced",
"completed": true
}
Response:
{
"id": 3,
"todo": "Learn Spring Boot Advanced",
"completed": true
}
DELETE /todos/{id}
Deletes a todo by ID.
http
Copy
Edit
Response:
204 No Content