Skip to content

Commit 81f4761

Browse files
Refactor monolith and system-test structure to Python
- Removed all Java-related files and configurations from the monolith directory, including Gradle build files, application classes, controllers, models, and resources. - Deleted the settings.gradle and gradlew files from the monolith project. - Updated the system-test directory to transition from Java to Python, including: - Renamed README.md to reflect Python usage and updated instructions for pytest. - Removed all Java test files and added Python test files for API and UI end-to-end and smoke tests. - Updated build.gradle and Gradle wrapper files to remove Java dependencies. - Added Python test structure with appropriate pytest markers for categorization.
1 parent 8304c43 commit 81f4761

File tree

31 files changed

+125
-1198
lines changed

31 files changed

+125
-1198
lines changed

.gitignore

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,6 @@
1111
.project
1212
.classpath
1313
.settings/
14-
bin/
15-
16-
# Gradle
17-
.gradle/
18-
build/
19-
gradle-app.setting
20-
!gradle-wrapper.jar
21-
!**/src/main/**/build/
22-
!**/src/test/**/build/
23-
24-
# Maven
25-
target/
26-
pom.xml.tag
27-
pom.xml.releaseBackup
28-
pom.xml.versionsBackup
29-
pom.xml.next
30-
release.properties
31-
dependency-reduced-pom.xml
32-
buildNumber.properties
33-
.mvn/timing.properties
34-
.mvn/wrapper/maven-wrapper.jar
35-
!**/src/main/**/target/
36-
!**/src/test/**/target/
37-
38-
# Java
39-
*.class
40-
*.log
41-
*.ctxt
42-
.mtj.tmp/
43-
*.jar
44-
*.war
45-
*.nar
46-
*.ear
47-
*.zip
48-
*.tar.gz
49-
*.rar
50-
hs_err_pid*
51-
replay_pid*
5214

5315
# Python
5416
__pycache__/

monolith/README.md

Lines changed: 74 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,88 @@
1-
# Monolith (Java)
1+
# Monolith Application (Python)
2+
3+
This is the main Python FastAPI application for the ATDD Accelerator Template.
4+
5+
## Quick Start
6+
7+
1. **Set up virtual environment:**
8+
```bash
9+
python -m venv venv
10+
11+
# On Windows
12+
venv\Scripts\activate
13+
14+
# On macOS/Linux
15+
source venv/bin/activate
16+
```
17+
18+
2. **Install dependencies:**
19+
```bash
20+
pip install -r requirements.txt
21+
```
22+
23+
3. **Run the application:**
24+
```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
35+
```
36+
37+
4. **Access the application:**
38+
- Home: http://localhost:8080
39+
- API Docs: http://localhost:8080/docs
40+
- Todo Manager: http://localhost:8080/todos
41+
42+
## Project Structure
243

3-
This is a sample monolithic application written in Java.
4-
5-
## Instructions
6-
7-
Open up the 'monolith' folder
8-
9-
```shell
10-
cd monolith
1144
```
12-
13-
Check that you have Powershell 7
14-
15-
```shell
16-
$PSVersionTable.PSVersion
45+
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
1757
```
1858

19-
Ensure you have JDK 25 installed
59+
## API Endpoints
2060

21-
```shell
22-
java -version
23-
```
61+
- `GET /api/echo` - Echo endpoint
62+
- `GET /api/todos/{id}` - Get todo by ID
63+
- `GET /` - Home page
64+
- `GET /todos` - Todo manager page
2465

25-
Check that JAVA_HOME is set correctly & points to your JDK 25 installation
66+
## Environment Variables
2667

27-
```shell
28-
echo $env:JAVA_HOME
29-
```
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)
3072

31-
Ensure you have Gradle 9.1 installed
73+
## Development
3274

33-
```shell
34-
./gradlew --version
75+
### Running Tests
76+
```bash
77+
pytest src/test/python/
3578
```
3679

37-
Build the application using Gradle
38-
39-
```shell
40-
./gradlew build
41-
```
42-
43-
Run the application
44-
45-
```shell
46-
./gradlew bootRun
80+
### Building Docker Image
81+
```bash
82+
docker build -t atdd-accelerator-template-python .
4783
```
4884

49-
Rebuild and restart the application
50-
51-
```shell
52-
./gradlew build && ./gradlew bootRun
85+
### Running with Docker
86+
```bash
87+
docker run -p 8080:8080 atdd-accelerator-template-python
5388
```
54-
55-
App should now be running on:
56-
http://localhost:8080/

monolith/build.gradle

Lines changed: 0 additions & 29 deletions
This file was deleted.
-42.7 KB
Binary file not shown.

monolith/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)