A lightweight team task management platform (think Trello-lite) built to demonstrate Continuous Integration (CI) in DevOps. TaskFlow showcases a realistic full-stack project with automated testing, Docker containerisation, and a GitHub Actions CI pipeline.
taskflow-project/
βββ backend/ # FastAPI + SQLite + SQLAlchemy
β βββ app/
β β βββ main.py # App entry point & CORS config
β β βββ models.py # SQLAlchemy ORM models
β β βββ database.py # DB connection & session factory
β β βββ schemas.py # Pydantic request/response schemas
β β βββ crud.py # Database operations
β β βββ routes/
β β βββ users.py # Auth endpoints (register, login)
β β βββ tasks.py # Task CRUD endpoints
β βββ tests/
β β βββ test_api.py # Pytest test suite (20+ tests)
β βββ requirements.txt
β βββ Dockerfile
β
βββ frontend/ # React + Axios
β βββ src/
β β βββ App.js # Root component & state management
β β βββ api.js # Axios instance with auth interceptors
β β βββ components/
β β β βββ Login.js # Login form
β β β βββ Register.js # Registration form
β β β βββ TaskList.js # Task grid with cards
β β β βββ TaskForm.js # Create / edit task modal
β β βββ __tests__/
β β βββ components.test.js # Jest + RTL test suite
β βββ public/index.html
β βββ nginx.conf
β βββ package.json
β βββ Dockerfile
β
βββ .github/
β βββ workflows/
β βββ ci.yml
β
βββ docker-compose.yml
βββ README.md
| Tool | Version |
|---|---|
| Python | 3.11+ |
| Node.js | 20+ |
| npm | 9+ |
| Docker | 24+ (optional) |
git clone https://github.com/your-username/taskflow-project.git
cd taskflow-projectcd backend
# Create a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000
- Interactive API docs (Swagger UI): http://localhost:8000/docs
- Alternative docs (ReDoc): http://localhost:8000/redoc
- Health check: http://localhost:8000/health
Open a new terminal:
cd frontend
# Install dependencies
npm install
# Start the development server
npm startThe React app will open at http://localhost:3000
The frontend is pre-configured to proxy API requests to
http://localhost:8000
cd backend
source venv/bin/activate
# Run all tests with verbose output
pytest tests/ -v
# Run with coverage report
pytest tests/ -v --cov=app --cov-report=term-missingTest coverage includes:
- Health check endpoint
- User registration (success, duplicate username, duplicate email)
- User login (success, wrong password, nonexistent user)
- Task creation (success, unauthenticated, invalid assignee)
- Task retrieval (list, single, not found)
- Task update (success, unauthorised)
- Task completion
- Task deletion (success, unauthorisd)
- Task assignment to team members
cd frontend
# Run all tests once (CI mode)
npm test
# Run in watch mode (development)
npm run test -- --watchTest coverage includes:
- Login component renders all fields correctly
- Register component renders all fields correctly
- Navigation between Login and Register works
- TaskList renders tasks from props
- TaskList shows empty state correctly
- Task action buttons (complete, edit, delete) fire correct callbacks
- TaskForm renders in create and edit modes
- TaskForm calls onSubmit with correct form data
# Build and start all services
docker-compose up --build
# Run in background
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop all services
docker-compose downServices started:
| Service | URL |
|---|---|
| Frontend | http://localhost:80 |
| Backend | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
# Backend
docker build -t taskflow-backend ./backend
docker run -p 8000:8000 taskflow-backend
# Frontend
docker build -t taskflow-frontend ./frontend
docker run -p 80:80 taskflow-frontendDATABASE_URL=sqlite:///./taskflow.db
ALLOWED_ORIGINS=http://localhost:3000REACT_APP_API_URL=http://localhost:8000The CI pipeline is defined in .github/workflows/ci.yml and runs automatically on every push or pull request to the main and develop branches.
Push / PR to main or develop
β
βΌ
ββββββββββββββββ βββββββββββββββββββββ
β Backend β β Frontend β
β (Python) β β (Node.js) β
β β β β
β 1. Checkout β β 1. Checkout β
β 2. Python 11 β β 2. Node.js 20 β
β 3. pip ci β β 3. npm ci β
β 4. pytest β β 4. npm test β
β β β 5. npm run build β
ββββββββ¬ββββββββ ββββββββββ¬ββββββββββββ
β β
ββββββββββββ¬βββββββββββββ
βΌ
βββββββββββββββββ
β Docker Build β
β Validation β
β β
β Build backend β
β Build frontendβ
ββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββ
β CI Summary β
β β
or β β
βββββββββββββββββ
| Job | What it does |
|---|---|
backend |
Sets up Python, installs deps, runs 20+ pytest tests |
frontend |
Sets up Node.js, installs deps, runs Jest tests, builds production bundle |
docker-build |
Validates that both Dockerfiles build without errors (runs after both tests pass) |
ci-summary |
Prints a summary report of all job outcomes |
- Dependency caching β
pipandnpmcaches are preserved between runs for speed - Parallel jobs β Backend and frontend run simultaneously, not sequentially
- Build artifacts β Production build is uploaded and available for 7 days
- Failure artifacts β Test database saved on failure for debugging
- Conditional execution β Docker build only runs if tests pass
| Method | Endpoint | Description |
|---|---|---|
| POST | /users/register |
Register a new user |
| POST | /users/login |
Login and receive access token |
| GET | /users/ |
List all users |
| GET | /users/{id} |
Get user by ID |
All task endpoints require
Authorization: Bearer <token>header
| Method | Endpoint | Description |
|---|---|---|
| GET | /tasks/ |
List all tasks |
| POST | /tasks/ |
Create a new task |
| GET | /tasks/{id} |
Get task by ID |
| PUT | /tasks/{id} |
Update a task |
| DELETE | /tasks/{id} |
Delete a task |
| PATCH | /tasks/{id}/complete |
Mark task as completed |
# 1. Register
curl -X POST http://localhost:8000/users/register \
-H "Content-Type: application/json" \
-d '{"username":"alice","email":"alice@example.com","password":"secret123","full_name":"Alice Smith"}'
# 2. Login
curl -X POST http://localhost:8000/users/login \
-H "Content-Type: application/json" \
-d '{"username":"alice","password":"secret123"}'
# 3. Create task (use token from login response)
curl -X POST http://localhost:8000/tasks/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer demo-token-1" \
-d '{"title":"Fix the login bug","priority":"high","status":"todo"}'| Layer | Technology |
|---|---|
| Backend Framework | FastAPI 0.111 |
| Language | Python 3.11 |
| Database | SQLite |
| ORM | SQLAlchemy 2.0 |
| Password Hashing | passlib (bcrypt) |
| Frontend Framework | React 18 |
| HTTP Client | Axios |
| Backend Testing | Pytest |
| Frontend Testing | Jest + React Testing Library |
| Containerisation | Docker + Docker Compose |
| CI/CD | GitHub Actions |
| Web Server | Nginx (production frontend) |
- Fork this repo to your GitHub account
- Push a change to
mainor open a pull request - Watch the Actions tab β all 4 jobs run automatically
- Try breaking a test (
assert False) to see the pipeline fail in red - Fix it and push again to see it go green
Built to demonstrate CI/CD best practices in a realistic full-stack context.