https://github.com/codesignal/learn_todo-api
A ToDo API that can be used with our courses that require an API to work with. Mostly to be used with front-end courses that need an API to communicate with.
https://github.com/codesignal/learn_todo-api
Last synced: 9 months ago
JSON representation
A ToDo API that can be used with our courses that require an API to work with. Mostly to be used with front-end courses that need an API to communicate with.
- Host: GitHub
- URL: https://github.com/codesignal/learn_todo-api
- Owner: CodeSignal
- License: other
- Created: 2025-01-23T19:09:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T14:31:03.000Z (10 months ago)
- Last Synced: 2025-03-03T15:35:12.107Z (10 months ago)
- Language: Python
- Size: 79.1 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Todo API
Todo API is a simple RESTful service for managing a to-do list, allowing users to create, read, update, and delete tasks.
## Prerequisites
- [Docker](https://www.docker.com/get-started)
- [Docker Compose](https://docs.docker.com/compose/)
## Quick Start
1. Clone the repository:
```bash
git clone https://github.com/matheusgalvao1/todo-api.git
cd todo-api
```
2. Build and start the application with Docker Compose:
```bash
docker-compose up --build -d
```
3. The API will be available at `http://localhost:8000`.
## Authentication Methods
The API's authentication is configured through `auth_config.yml` in the root directory:
1. No Authentication (`none`):
```yaml
auth:
method: none
```
All endpoints will be public.
2. API Key Authentication (`api_key`):
```yaml
auth:
method: api_key
api_key: your-secure-api-key
```
Clients must include the API key in the `X-API-Key` header.
3. JWT Authentication (`jwt`):
```yaml
auth:
method: jwt
secret: your-jwt-secret
```
Clients must obtain a JWT token via login/signup and include it in the `Authorization: Bearer ` header.
4. Session Authentication (`session`):
```yaml
auth:
method: session
secret: your-session-secret
```
Uses browser sessions for authentication.
## Initial Data
The project comes with initial data, seeded at startup:
- Todos: `initial_todos.json`
- Users: `initial_users.json`
## Running the API
Simply run:
```bash
python app/main.py
```
The API will read the configuration from `auth_config.yml`. If the file doesn't exist, it will default to no authentication.