This repository is set up as a learning exercise to build a full-stack Todo application using Flask for the backend API and React (with Vite) for the frontend.
This project is designed to be used with GitHub Codespaces or a local development container. The .devcontainer
directory contains all the configuration needed to set up a development environment with the necessary dependencies for both Python (Flask) and Node.js (React).
- Click the "Code" button on the GitHub repository page
- Select the "Codespaces" tab
- Click "Create codespace on main"
- Wait for the codespace to initialize (this may take a few minutes)
- Install Docker and the VS Code Remote - Containers extension
- Open this repository in VS Code
- When prompted, click "Reopen in Container"
- Wait for the container to build and initialize
The goal is to create a simple Todo application where users can:
- Create new todo items
- List all todo items
- Update existing todo items
- Delete todo items
Each todo item should have:
- A title (required)
- A description (optional)
- A status (completed or not completed)
- A due date (optional)
The project is divided into two main parts:
- Flask web server
- RESTful API endpoints
- SQLAlchemy ORM
- SQLite database
- Pytest for testing
- React with hooks
- Context API for state management
- API communication with fetch
- Vite for bundling
- Vitest for testing
After your development container is running:
-
Navigate to the backend directory:
cd backend
-
Run the development server:
python run.py
-
Run tests:
pytest
-
Navigate to the frontend directory:
cd frontend
-
Run the development server:
npm run dev
-
Run tests:
npm test
GET /todos
: Retrieve all todo itemsPOST /todos
: Create a new todo itemGET /todos/<id>
: Retrieve a specific todo itemPUT /todos/<id>
: Update a specific todo itemDELETE /todos/<id>
: Delete a specific todo item
Refer to the implementation guide in docs/implementation-guide.md
for detailed steps on implementing the application.
- Enhance the UI with more styling
- Add sorting or filtering options for todos
- Implement search functionality
- Add due date notifications
- Implement categories or tags for todos