Skip to content

Commit bf7d83f

Browse files
Restructure READMEs: Move detailed instructions to component directories
- Simplified root README to be concise project overview - Updated monolith/README.md with detailed setup instructions and current structure - Updated system-test/README.md with comprehensive testing guide - Root README now focuses on quick start and directs to component READMEs - Removed outdated references to old directory structure - Each component now has appropriate detailed documentation
1 parent 0864389 commit bf7d83f

File tree

3 files changed

+127
-187
lines changed

3 files changed

+127
-187
lines changed

README.md

Lines changed: 17 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -6,128 +6,29 @@
66
[![qa-signoff](https://github.com/optivem/atdd-accelerator-template-python/actions/workflows/qa-signoff.yml/badge.svg)](https://github.com/optivem/atdd-accelerator-template-python/actions/workflows/qa-signoff.yml)
77
[![prod-stage](https://github.com/optivem/atdd-accelerator-template-python/actions/workflows/prod-stage.yml/badge.svg)](https://github.com/optivem/atdd-accelerator-template-python/actions/workflows/prod-stage.yml)
88

9-
This is a Python implementation of the ATDD (Acceptance Test-Driven Development) Accelerator Template, migrated from the original Java version. It provides a complete web application with API endpoints and UI for managing todos, built using FastAPI and modern Python practices.
9+
This is a Python implementation of the ATDD (Acceptance Test-Driven Development) Accelerator Template. It provides a walking skeleton for building applications using Test-Driven Development practices with Python and FastAPI.
1010

11-
## Technology Stack
11+
## Structure
1212

13-
- **Python 3.11+**: Modern Python with type hints
14-
- **FastAPI**: Modern, fast web framework for building APIs
15-
- **Uvicorn**: ASGI server implementation
16-
- **Pydantic**: Data validation using Python type annotations
17-
- **Pytest**: Testing framework with async support
18-
- **HTTPX**: Modern HTTP client for Python
19-
- **Docker**: Containerization
13+
- **`monolith/`** - Main FastAPI application with walking skeleton implementation
14+
- **`system-test/`** - End-to-end and system tests for acceptance testing
15+
- **`.github/`** - CI/CD workflows for commit, acceptance, QA, and production stages
2016

21-
## Project Structure
17+
## Quick Start
2218

23-
```
24-
monolith/
25-
├── src/
26-
│ ├── main/
27-
│ │ ├── python/
28-
│ │ │ └── com/optivem/atddaccelerator/template/monolith/
29-
│ │ │ ├── models/ # Data models (Pydantic)
30-
│ │ │ ├── controllers/ # Request handlers
31-
│ │ │ │ ├── api/ # API endpoints
32-
│ │ │ │ └── web/ # Web page controllers
33-
│ │ │ ├── config.py # Application configuration
34-
│ │ │ └── monolith_application.py # Main FastAPI app
35-
│ │ └── resources/
36-
│ │ └── static/ # Static HTML files
37-
│ └── test/
38-
│ └── python/ # Unit tests
39-
├── requirements.txt # Python dependencies
40-
├── pyproject.toml # Project configuration
41-
└── Dockerfile # Container definition
42-
43-
system-test/
44-
└── src/test/python/ # System and E2E tests
19+
```bash
20+
# Run the application
21+
cd monolith
22+
python -m uvicorn src.main:app --reload --port 8080
23+
24+
# Run tests
25+
cd system-test
26+
pytest . -m smoke
4527
```
4628

47-
## Getting Started
48-
49-
### Prerequisites
50-
51-
- Python 3.11 or higher
52-
- pip (Python package manager)
53-
54-
### Installation
55-
56-
1. **Clone the repository**
57-
```bash
58-
git clone https://github.com/optivem/atdd-accelerator-template-python.git
59-
cd atdd-accelerator-template-python
60-
```
61-
62-
2. **Set up virtual environment**
63-
```bash
64-
cd monolith
65-
python -m venv venv
66-
67-
# On Windows
68-
venv\Scripts\activate
69-
70-
# On macOS/Linux
71-
source venv/bin/activate
72-
```
73-
74-
3. **Install dependencies**
75-
```bash
76-
pip install -r requirements.txt
77-
```
78-
79-
4. **Run the application**
80-
```bash
81-
python -m uvicorn com.optivem.atddaccelerator.template.monolith.monolith_application:app --host 0.0.0.0 --port 8080 --reload
82-
```
83-
84-
5. **Access the application**
85-
- Web UI: http://localhost:8080
86-
- API Documentation: http://localhost:8080/docs
87-
- Todo Manager: http://localhost:8080/todos
88-
89-
### Running with Docker
90-
91-
1. **Build the Docker image**
92-
```bash
93-
cd monolith
94-
docker build -t atdd-accelerator-template-python .
95-
```
96-
97-
2. **Run the container**
98-
```bash
99-
docker run -p 8080:8080 atdd-accelerator-template-python
100-
```
101-
102-
### Running Tests
103-
104-
1. **Unit tests**
105-
```bash
106-
cd monolith
107-
pytest src/test/python/
108-
```
109-
110-
2. **System tests** (requires running application)
111-
```bash
112-
cd system-test
113-
pip install -r requirements.txt
114-
pytest src/test/python/
115-
```
116-
117-
## API Endpoints
118-
119-
- `GET /api/echo` - Simple echo endpoint
120-
- `GET /api/todos/{id}` - Fetch todo by ID from external API
121-
- `GET /` - Home page
122-
- `GET /todos` - Todo manager page
123-
124-
## Configuration
125-
126-
The application can be configured using environment variables:
127-
128-
- `TODOS_API_HOST`: External todos API host (default: https://jsonplaceholder.typicode.com)
129-
- `PORT`: Server port (default: 8080)
130-
- `HOST`: Server host (default: 0.0.0.0)
29+
See individual component READMEs for detailed setup instructions:
30+
- [`monolith/README.md`](monolith/README.md) - Application setup and development
31+
- [`system-test/README.md`](system-test/README.md) - Testing setup and execution
13132

13233
## Migration from Java
13334

monolith/README.md

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
# Monolith Application (Python)
1+
# Monolith Application
22

3-
This is the main Python FastAPI application for the ATDD Accelerator Template.
3+
This is a walking skeleton FastAPI application that serves as the foundation for ATDD development.
4+
5+
## Technology Stack
6+
7+
- **Python 3.11+**: Modern Python with type hints
8+
- **FastAPI**: Modern, fast web framework for building APIs
9+
- **Uvicorn**: ASGI server implementation
10+
- **Pydantic**: Data validation using Python type annotations
11+
- **Pytest**: Testing framework with async support
12+
- **Docker**: Containerization
413

514
## Quick Start
615

@@ -22,59 +31,50 @@ This is the main Python FastAPI application for the ATDD Accelerator Template.
2231

2332
3. **Run the application:**
2433
```bash
25-
python -m uvicorn com.optivem.atddaccelerator.template.monolith.monolith_application:app --host 0.0.0.0 --port 8080 --reload
26-
```
27-
28-
Or use the provided scripts:
29-
```bash
30-
# Windows
31-
start.bat
32-
33-
# Linux/macOS
34-
./start.sh
34+
python -m uvicorn src.main:app --host 0.0.0.0 --port 8080 --reload
3535
```
3636

3737
4. **Access the application:**
3838
- Home: http://localhost:8080
39+
- Health Check: http://localhost:8080/health
3940
- API Docs: http://localhost:8080/docs
4041
- Todo Manager: http://localhost:8080/todos
4142

4243
## Project Structure
4344

4445
```
4546
src/
46-
├── main/
47-
│ ├── python/ # Python source code
48-
│ │ └── com/optivem/atddaccelerator/template/monolith/
49-
│ │ ├── models/ # Data models
50-
│ │ ├── controllers/ # API and web controllers
51-
│ │ ├── config.py # Configuration
52-
│ │ └── monolith_application.py # Main app
53-
│ └── resources/
54-
│ └── static/ # Static HTML/CSS/JS files
55-
└── test/
56-
└── python/ # Unit tests
47+
├── main.py # Main FastAPI application
48+
└── static/ # Static HTML files
49+
tests/
50+
├── test_main.py # Unit tests
51+
└── test_basic.py # Basic smoke tests
52+
requirements.txt # Python dependencies
53+
pyproject.toml # Project configuration
54+
Dockerfile # Container definition
5755
```
5856

5957
## API Endpoints
6058

61-
- `GET /api/echo` - Echo endpoint
59+
- `GET /health` - Health check endpoint
60+
- `GET /` - Home page (HTML)
61+
- `GET /todos` - Todo manager page (HTML)
62+
- `GET /api/echo` - Simple echo endpoint
6263
- `GET /api/todos/{id}` - Get todo by ID
63-
- `GET /` - Home page
64-
- `GET /todos` - Todo manager page
65-
66-
## Environment Variables
67-
68-
- `TODOS_API_HOST` - External API host (default: https://jsonplaceholder.typicode.com)
69-
- `HOST` - Server host (default: 0.0.0.0)
70-
- `PORT` - Server port (default: 8080)
71-
- `DEBUG` - Debug mode (default: false)
64+
- `GET /api/todos` - Get all todos
7265

7366
## Development
7467

7568
### Running Tests
7669
```bash
77-
pytest src/test/python/
70+
# All tests
71+
pytest
72+
73+
# Smoke tests only
74+
pytest -m smoke
75+
76+
# With verbose output
77+
pytest -v
7878
```
7979

8080
### Building Docker Image
@@ -86,3 +86,14 @@ docker build -t atdd-accelerator-template-python .
8686
```bash
8787
docker run -p 8080:8080 atdd-accelerator-template-python
8888
```
89+
90+
## ATDD Development
91+
92+
This is a walking skeleton designed for ATDD development. To add features:
93+
94+
1. Write a failing acceptance test
95+
2. Write minimal code to make it pass
96+
3. Refactor if needed
97+
4. Repeat
98+
99+
Follow the TODO comments in `src/main.py` to add your features using the ATDD approach.

system-test/README.md

Lines changed: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,90 @@
1-
# System Test (Python)
1+
# System Tests
22

3-
This directory contains system tests for the Python application using pytest.
3+
End-to-end and system tests for the ATDD Accelerator Template application.
44

5-
## Instructions
5+
## Overview
66

7-
1. **Navigate to the system-test directory:**
8-
```bash
9-
cd system-test
10-
```
7+
This directory contains system tests that verify the application works correctly when deployed. The tests are designed to run against a live instance of the application.
8+
9+
## Test Types
10+
11+
- **Smoke Tests** (`@pytest.mark.smoke`) - Basic functionality verification
12+
- **E2E Tests** (`@pytest.mark.e2e`) - End-to-end user scenarios
13+
14+
## Test Files
15+
16+
- `test_api_smoke.py` - API smoke tests
17+
- `test_api_e2e.py` - API end-to-end tests
18+
- `test_ui_smoke.py` - UI smoke tests
19+
- `test_ui_e2e.py` - UI end-to-end tests
20+
21+
## Prerequisites
22+
23+
- Python 3.11 or higher
24+
- Running application instance (http://localhost:8080)
1125

12-
2. **Install test dependencies:**
26+
## Setup
27+
28+
1. **Install dependencies:**
1329
```bash
1430
pip install -r requirements.txt
1531
```
1632

17-
3. **Start Docker Containers:**
33+
2. **Start the application with Docker:**
1834
```bash
1935
docker compose up -d
2036
```
2137

22-
4. **Run All Tests:**
23-
```bash
24-
pytest src/test/python/
25-
```
38+
## Running Tests
2639

27-
5. **Run Smoke Tests Only:**
28-
```bash
29-
pytest src/test/python/ -m smoke
30-
```
31-
32-
6. **Run E2E Tests Only:**
33-
```bash
34-
pytest src/test/python/ -m e2e
35-
```
40+
### All Tests
41+
```bash
42+
pytest .
43+
```
3644

37-
7. **Run with verbose output:**
38-
```bash
39-
pytest src/test/python/ -v
40-
```
45+
### Smoke Tests Only
46+
```bash
47+
pytest . -m smoke
48+
```
4149

42-
8. **Stop Docker Containers:**
43-
```bash
44-
docker compose down
45-
```
50+
### E2E Tests Only
51+
```bash
52+
pytest . -m e2e
53+
```
4654

47-
## Test Structure
55+
### Verbose Output
56+
```bash
57+
pytest . -v
58+
```
4859

60+
### Specific Test File
61+
```bash
62+
pytest test_api_smoke.py
4963
```
50-
src/test/python/
51-
├── test_api_e2e.py # API end-to-end tests
52-
├── test_api_smoke.py # API smoke tests
53-
├── test_ui_e2e.py # UI end-to-end tests
54-
└── test_ui_smoke.py # UI smoke tests
64+
65+
## Cleanup
66+
67+
```bash
68+
docker compose down
5569
```
5670

71+
## Expected Endpoints
72+
73+
The tests expect the following endpoints to be available:
74+
75+
### API Endpoints
76+
- `GET /health` - Health check
77+
- `GET /api/echo` - Echo endpoint
78+
- `GET /api/todos/{id}` - Get todo by ID
79+
- `GET /api/todos` - Get all todos
80+
81+
### UI Endpoints
82+
- `GET /` - Home page
83+
- `GET /todos` - Todo manager page
84+
5785
## Requirements
5886

59-
- Python 3.9+
87+
- Python 3.11+
6088
- pytest
6189
- httpx
6290
- Docker (for running the application container)

0 commit comments

Comments
 (0)