22
33## Build Commands
44``` bash
5+ # Quick setup for development
6+ ./setup.sh
7+
58# Install dependencies
69poetry install
710
8- # Run application
11+ # Run application (old monolithic structure)
912poetry run python main.py
1013
14+ # Run application (new modular structure)
15+ poetry run python app.py
16+
17+ # Run tests
18+ poetry run pytest
19+
20+ # Run tests with coverage
21+ poetry run pytest --cov=src --cov-report=html
22+
23+ # Lint code
24+ poetry run flake8
25+ poetry run black --check .
26+ poetry run isort --check .
27+
28+ # Format code
29+ poetry run black .
30+ poetry run isort .
31+
1132# Build Docker container
1233docker build -t bingo .
1334
@@ -16,6 +37,14 @@ docker run -p 8080:8080 bingo
1637
1738# Helm deployment
1839cd helm && ./package.sh && helm install bingo ./bingo
40+
41+ # Using Makefile
42+ make install # Install dependencies
43+ make run # Run application
44+ make test # Run tests
45+ make lint # Run linters
46+ make format # Format code
47+ make build # Build package
1948```
2049
2150## Code Style Guidelines
@@ -27,9 +56,109 @@ cd helm && ./package.sh && helm install bingo ./bingo
2756- ** UI Elements** : Define class constants for styling
2857- ** Logging** : Use Python's logging module with descriptive messages
2958- ** Comments** : Use docstrings for functions and descriptive comments
59+ - ** Line Length** : Max 88 characters (Black's default)
60+ - ** Code Formatting** : Use Black for code formatting and isort for import sorting
3061
3162## Project Structure
32- - ` main.py ` : Core application with NiceGUI implementation
63+ - ` app.py ` : Main entry point for modular application
64+ - ` src/ ` : Source code directory
65+ - ` config/ ` : Configuration and constants
66+ - ` core/ ` : Core game logic
67+ - ` ui/ ` : User interface components
68+ - ` utils/ ` : Utility functions
3369- ` phrases.txt ` : Contains customizable bingo phrases
3470- ` static/ ` : Static assets for fonts and styles
35- - ` helm/ ` : Kubernetes deployment configuration
71+ - ` tests/ ` : Unit and integration tests
72+ - ` helm/ ` : Kubernetes deployment configuration
73+ - ` .github/workflows/ ` : CI pipeline configuration
74+ - ` CHANGELOG.md ` : Release history tracking
75+
76+ ## Git Workflow
77+
78+ ### Branch Naming
79+ - Use feature branches for each change: ` feature/description-of-change `
80+ - Use bugfix branches for bug fixes: ` fix/description-of-bug `
81+ - Use chore branches for maintenance: ` chore/description-of-task `
82+
83+ ### Commit Guidelines
84+ Follow conventional changelog format:
85+
86+ ```
87+ <type>(<scope>): <subject>
88+
89+ <body>
90+
91+ <footer>
92+ ```
93+
94+ 1 . ** Types** :
95+ - ` feat ` : A new feature
96+ - ` fix ` : A bug fix
97+ - ` docs ` : Documentation only changes
98+ - ` style ` : Changes that do not affect meaning (white-space, formatting)
99+ - ` refactor ` : Code change that neither fixes a bug nor adds a feature
100+ - ` perf ` : Change that improves performance
101+ - ` test ` : Adding missing tests or correcting existing tests
102+ - ` chore ` : Changes to the build process or auxiliary tools
103+
104+ 2 . ** Scope** (optional): The module/component affected, e.g., ` core ` , ` ui ` , ` board `
105+
106+ 3 . ** Subject** : Short description in imperative, present tense (not past tense)
107+ - Good: "add feature X" (not "added feature X")
108+ - Use lowercase
109+ - No period at the end
110+
111+ 4 . ** Body** (optional): Detailed explanation of changes
112+ - Use present tense
113+ - Include motivation and context
114+ - Explain "what" and "why" (not "how")
115+
116+ 5 . ** Footer** (optional): Reference issues, PRs, breaking changes
117+
118+ ### Example Commits:
119+ ```
120+ feat(board): add color theme selector
121+
122+ Add ability for users to choose color themes for the bingo board
123+
124+ Resolves #123
125+ ```
126+
127+ ```
128+ fix(ui): resolve client disconnection issues
129+
130+ Handle race conditions during client disconnects to prevent
131+ server exceptions and ensure smooth reconnection
132+
133+ Fixes #456
134+ ```
135+
136+ ## Semantic Versioning
137+
138+ This project follows semantic versioning (SEMVER) principles:
139+
140+ - ** MAJOR** version when making incompatible API changes (X.0.0)
141+ - ** MINOR** version when adding functionality in a backwards compatible manner (0.X.0)
142+ - ** PATCH** version when making backwards compatible bug fixes (0.0.X)
143+
144+ Version numbers are automatically updated by the CI/CD pipeline based on commit messages.
145+ The project uses python-semantic-release to analyze commit messages and determine the appropriate
146+ version bump according to the conventional commit format.
147+
148+ ## CI/CD Pipeline
149+
150+ The project utilizes GitHub Actions for continuous integration and deployment:
151+
152+ 1 . ** CI Job** :
153+ - Runs on each push to main and pull request
154+ - Installs dependencies
155+ - Runs linters (flake8, black, isort)
156+ - Runs all tests with pytest
157+ - Uploads coverage reports
158+
159+ 2 . ** Release Job** :
160+ - Runs after successful CI job on the main branch
161+ - Determines new version based on commit messages
162+ - Updates CHANGELOG.md
163+ - Creates Git tag for the release
164+ - Publishes release on GitHub
0 commit comments