Spaces:
Running
Running
Commit
·
543801f
1
Parent(s):
dc3879e
fix: update Hugging Face Spaces README with proper YAML frontmatter
Browse files
README.md
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Todo List Backend API
|
| 2 |
|
| 3 |
-
FastAPI-based REST API for managing tasks with PostgreSQL persistence.
|
| 4 |
|
| 5 |
## Features
|
| 6 |
|
| 7 |
- ✅ Full CRUD operations for tasks
|
| 8 |
-
- ✅ User
|
| 9 |
-
- ✅
|
| 10 |
-
- ✅
|
| 11 |
-
- ✅
|
| 12 |
-
- ✅
|
|
|
|
| 13 |
- ✅ OpenAPI documentation
|
| 14 |
|
| 15 |
## Tech Stack
|
|
@@ -18,101 +28,30 @@ FastAPI-based REST API for managing tasks with PostgreSQL persistence.
|
|
| 18 |
- FastAPI (web framework)
|
| 19 |
- SQLModel (ORM)
|
| 20 |
- Neon PostgreSQL (database)
|
| 21 |
-
-
|
| 22 |
-
|
| 23 |
-
## Quick Start
|
| 24 |
-
|
| 25 |
-
### 1. Install Dependencies
|
| 26 |
-
|
| 27 |
-
```bash
|
| 28 |
-
cd backend
|
| 29 |
-
uv sync
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
### 2. Configure Environment
|
| 33 |
-
|
| 34 |
-
Create a `.env` file:
|
| 35 |
-
|
| 36 |
-
```bash
|
| 37 |
-
cp .env.example .env
|
| 38 |
-
# Edit .env with your DATABASE_URL
|
| 39 |
-
```
|
| 40 |
-
|
| 41 |
-
### 3. Run Development Server
|
| 42 |
-
|
| 43 |
-
```bash
|
| 44 |
-
uv run uvicorn backend.main:app --reload --port 8000
|
| 45 |
-
```
|
| 46 |
-
|
| 47 |
-
API will be available at http://localhost:8000
|
| 48 |
-
|
| 49 |
-
### 4. Access API Documentation
|
| 50 |
-
|
| 51 |
-
- Swagger UI: http://localhost:8000/docs
|
| 52 |
-
- ReDoc: http://localhost:8000/redoc
|
| 53 |
|
| 54 |
## API Endpoints
|
| 55 |
|
| 56 |
| Method | Endpoint | Description |
|
| 57 |
|--------|----------|-------------|
|
| 58 |
-
| POST | `/api/
|
| 59 |
-
|
|
| 60 |
-
| GET | `/api/
|
| 61 |
-
|
|
| 62 |
-
|
|
| 63 |
-
|
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
```bash
|
| 68 |
-
# Run all tests
|
| 69 |
-
uv run pytest
|
| 70 |
-
|
| 71 |
-
# Run with coverage
|
| 72 |
-
uv run pytest --cov=backend tests/
|
| 73 |
-
|
| 74 |
-
# Run specific test file
|
| 75 |
-
uv run pytest tests/test_api_tasks.py -v
|
| 76 |
-
```
|
| 77 |
|
| 78 |
-
##
|
| 79 |
|
| 80 |
-
|
| 81 |
-
backend/
|
| 82 |
-
├── models/ # SQLModel database models
|
| 83 |
-
│ ├── user.py # User entity
|
| 84 |
-
│ └── task.py # Task entity and I/O models
|
| 85 |
-
├── api/ # FastAPI route handlers
|
| 86 |
-
│ └── tasks.py # Task CRUD endpoints
|
| 87 |
-
├── core/ # Configuration and dependencies
|
| 88 |
-
│ ├── config.py # Database engine
|
| 89 |
-
│ └── deps.py # Dependency injection
|
| 90 |
-
├── tests/ # Test suite
|
| 91 |
-
│ ├── conftest.py # Pytest fixtures
|
| 92 |
-
│ └── test_api_tasks.py
|
| 93 |
-
├── main.py # FastAPI application
|
| 94 |
-
└── pyproject.toml # UV project configuration
|
| 95 |
-
```
|
| 96 |
|
| 97 |
## Environment Variables
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|----------|-------------|---------|
|
| 101 |
-
| `DATABASE_URL` | PostgreSQL connection string | `postgresql://user:pass@host:5432/db?sslmode=require` |
|
| 102 |
-
| `ENVIRONMENT` | Environment name | `development` or `production` |
|
| 103 |
-
| `LOG_LEVEL` | Logging level | `INFO`, `DEBUG`, `WARNING`, `ERROR` |
|
| 104 |
-
|
| 105 |
-
## Development
|
| 106 |
-
|
| 107 |
-
### Code Style
|
| 108 |
-
|
| 109 |
-
- Follow PEP 8
|
| 110 |
-
- Type hints required
|
| 111 |
-
- Docstrings for public functions
|
| 112 |
-
|
| 113 |
-
### Database
|
| 114 |
-
|
| 115 |
-
Tables are automatically created on startup. For production, consider using Alembic for migrations.
|
| 116 |
|
| 117 |
## License
|
| 118 |
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Todo List Backend API
|
| 3 |
+
emoji: ⚡
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
# Todo List Backend API
|
| 11 |
|
| 12 |
+
FastAPI-based REST API for managing tasks with PostgreSQL persistence, AI chatbot, and WebSocket support.
|
| 13 |
|
| 14 |
## Features
|
| 15 |
|
| 16 |
- ✅ Full CRUD operations for tasks
|
| 17 |
+
- ✅ User authentication with JWT
|
| 18 |
+
- ✅ AI chatbot for task management (OpenAI & Google Gemini)
|
| 19 |
+
- ✅ WebSocket real-time events
|
| 20 |
+
- ✅ Task tags, due dates, and priorities
|
| 21 |
+
- ✅ Conversation history
|
| 22 |
+
- ✅ MCP server integration
|
| 23 |
- ✅ OpenAPI documentation
|
| 24 |
|
| 25 |
## Tech Stack
|
|
|
|
| 28 |
- FastAPI (web framework)
|
| 29 |
- SQLModel (ORM)
|
| 30 |
- Neon PostgreSQL (database)
|
| 31 |
+
- OpenAI & Google Gemini (AI)
|
| 32 |
+
- WebSockets (real-time events)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
## API Endpoints
|
| 35 |
|
| 36 |
| Method | Endpoint | Description |
|
| 37 |
|--------|----------|-------------|
|
| 38 |
+
| POST | `/api/auth/sign-up` | Register user |
|
| 39 |
+
| POST | `/api/auth/sign-in` | Login user |
|
| 40 |
+
| GET | `/api/tasks` | List tasks |
|
| 41 |
+
| POST | `/api/tasks` | Create task |
|
| 42 |
+
| GET | `/api/tasks/{id}` | Get task details |
|
| 43 |
+
| PUT | `/api/tasks/{id}` | Update task |
|
| 44 |
+
| DELETE | `/api/tasks/{id}` | Delete task |
|
| 45 |
+
| POST | `/api/chat` | AI chat endpoint |
|
| 46 |
+
| WS | `/ws` | WebSocket events |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
## API Documentation
|
| 49 |
|
| 50 |
+
Once deployed, access interactive docs at `/docs`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
## Environment Variables
|
| 53 |
|
| 54 |
+
Required variables are configured in the Space settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
## License
|
| 57 |
|