Daily Todolist - FastAPI Backend
1.4K
A full-stack task management application built with React and FastAPI.
dailytodo/
├── docker-compose.yml # Docker services configuration
├── data/ # SQLite database (Docker volume)
├── backend/
│ ├── Dockerfile # Backend container image
│ ├── app/
│ │ ├── models/ # SQLAlchemy ORM models
│ │ ├── routers/ # API route handlers
│ │ ├── schemas/ # Pydantic validation schemas
│ │ ├── utils/ # Authentication utilities
│ │ ├── config.py # App configuration
│ │ ├── database.py # Database connection
│ │ └── main.py # FastAPI app entry point
│ ├── requirements.txt
│ └── .env.example # Environment variables template
├── frontend/
│ ├── Dockerfile # Frontend container image
│ ├── nginx.conf # Nginx configuration
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API client
│ │ └── App.jsx # App entry point
│ └── package.json
└── docs/
└── plans/ # Design documents
The easiest way to run the application is using Docker Compose.
# Build and start all services
docker compose up -d
# View logs
docker compose logs -f
# Stop services
docker compose down
| Service | URL |
|---|---|
| Frontend | http://localhost:4321 |
| Backend API | http://localhost:8000/api |
Create a .env file in the project root to customize settings:
# Admin credentials
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your-secure-password
# JWT secret (change in production!)
SECRET_KEY=your-secret-key-change-in-production
Or pass them directly:
ADMIN_USERNAME=myuser ADMIN_PASSWORD=mypass docker compose up -d
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start server
uvicorn app.main:app --reload
The API will be available at http://localhost:8000
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
The app will be available at http://localhost:5173
adminchangeme123| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login | Get JWT token |
| GET | /api/auth/me | Get current user |
| GET | /api/tasks | List all tasks |
| GET | /api/tasks/today | Get today's tasks |
| POST | /api/tasks | Create task |
| PUT | /api/tasks/{id} | Update task |
| DELETE | /api/tasks/{id} | Delete task |
| PATCH | /api/tasks/{id}/complete | Toggle completion |
| GET | /api/categories | List categories |
| POST | /api/categories | Create category |
| PUT | /api/categories/{id} | Update category |
| DELETE | /api/categories/{id} | Delete category |
| GET | /api/stats/daily | Get daily stats |
| GET | /api/stats/range | Get stats by date range |
cd backend
pytest
cd frontend
npm run lint
This project uses GitHub Actions for continuous integration and deployment.
| Workflow | Trigger | Description |
|---|---|---|
| CI | Push/PR to main | Run tests and build Docker images |
| Docker Publish | Push to main, tags (v*) | Build and push images to Docker Hub |
Create a Docker Hub account and access token
Add the following secrets to your GitHub repository:
DOCKERHUB_USERNAME - Your Docker Hub usernameDOCKERHUB_TOKEN - Your Docker Hub access tokenPush a tag to trigger a release:
git tag v1.0.0
git push origin v1.0.0
After publishing, images will be available at:
<your-username>/dailytodo-backend:latest<your-username>/dailytodo-frontend:latestMIT
Content type
Image
Digest
sha256:2d9242ec6…
Size
76.9 MB
Last updated
9 months ago
docker pull jimmy0328/dailytodo-backend