Skip to content

Commit 88db4e7

Browse files
committed
Enhance documentation and setup guides; add MkDocs workflow for deployment
1 parent f3c249f commit 88db4e7

33 files changed

+728
-15
lines changed

.github/workflows/docs.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- 'LEARN.md'
10+
- 'README.md'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-deploy:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Install MkDocs
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install mkdocs mkdocs-material
31+
32+
- name: Build site
33+
run: mkdocs build --strict
34+
35+
- name: Deploy to GitHub Pages
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./site

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,9 @@ If you have any questions or need assistance, feel free to reach out by:
114114
- Mailing me at: zaber@zealtyro.com
115115

116116
Thank you for helping to improve this project! 😊
117+
118+
---
119+
120+
For a more detailed contributor environment and workflow, see the Developer Setup guide:
121+
122+
- docs/developer-setup.md

LEARN.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Learn Zeython
2+
3+
Welcome to Zeython! This guide walks you from zero to productive with the modular MVC framework.
4+
5+
Zeython is created by Md Mahedi Zaman Zaber and is the improved, advanced version of MVC-Python.
6+
7+
- Repository: https://github.com/zaber-dev/Zeython
8+
- License: GPL-3.0-or-later
9+
10+
## Who is this for?
11+
12+
- Python developers who want a clean MVC foundation with services (web, Discord, and more)
13+
- Teams that value configuration-driven, modular architecture
14+
- Learners exploring service-oriented application design with Flask
15+
16+
## Quick Start
17+
18+
1) Clone and install
19+
20+
```bash
21+
git clone https://github.com/zaber-dev/Zeython.git
22+
cd Zeython
23+
pip install -r requirements.txt
24+
```
25+
26+
2) Configure environment
27+
28+
Create a `.env` in the project root (see `.env_example` if present):
29+
30+
```env
31+
FLASK_HOST=127.0.0.1
32+
FLASK_PORT=5000
33+
DATABASE_URL=sqlite:///database.db
34+
```
35+
36+
3) Run
37+
38+
```bash
39+
python config/application.py
40+
```
41+
42+
Open http://127.0.0.1:5000/
43+
44+
## What you’ll build/learn
45+
46+
- MVC structure with clear separation of concerns
47+
- Service management: register, enable, run in parallel
48+
- Database layer and models with enhanced features
49+
- Web routes and APIs, plus optional Discord integration
50+
51+
## Concepts map
52+
53+
- Architecture overview: docs/architecture.md
54+
- Getting started: docs/getting-started.md
55+
- Configuration: docs/configuration.md
56+
- Models and database: docs/models.md, docs/database.md
57+
- Services: docs/services/web.md, docs/services/discord.md
58+
- APIs and routes: docs/api.md
59+
- Advanced topics: docs/authentication.md, docs/file-management.md, docs/vendor-integrations.md,
60+
docs/error-monitoring.md, docs/deployment.md, docs/testing.md, docs/faq.md
61+
62+
For developers:
63+
- docs/developer-setup.md
64+
- docs/coding-standards.md
65+
- docs/service-development.md
66+
- docs/debugging.md
67+
68+
## Recommended path
69+
70+
1. Read docs/getting-started.md
71+
2. Skim docs/architecture.md
72+
3. Configure web service and run a local server
73+
4. Explore docs/models.md and docs/database.md, then add a simple model
74+
5. Add/modify a route in routes/web.py and a controller
75+
6. Optional: enable Discord service and add a command
76+
7. Deploy with Docker (docs/deployment.md)
77+
78+
## Examples
79+
80+
See EXAMPLES.md for end-to-end snippets, including creating custom services.
81+
82+
## Troubleshooting
83+
84+
- Port already in use: change FLASK_PORT or stop the conflicting process.
85+
- Flask not installed: ensure `pip install -r requirements.txt` succeeded.
86+
- Database errors: verify DATABASE_URL and that `database/db.py` initializes correctly.
87+
88+
## Next steps
89+
90+
- Explore tests in `tests/` and add your own.
91+
- Contribute improvements—see CONTRIBUTING.md.
92+
93+
Happy building with Zeython!

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Zeython is created by **Md Mahedi Zaman Zaber** and is the improved and advanced
99

1010
Repository: https://github.com/zaber-dev/Zeython
1111

12+
## Documentation
13+
14+
- Start here: [LEARN.md](LEARN.md)
15+
- Full docs: [docs/index.md](docs/index.md)
16+
- Developer guide: [docs/developer-setup.md](docs/developer-setup.md)
17+
1218
## Key Features
1319

1420
### 🏗️ **Truly Modular Architecture**

docs/api.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# API and Routes
2+
3+
- Web routes are defined in `routes/web.py`
4+
- API blueprint is defined in `routes/api.py` and registered by the web service
5+
6+
## Adding routes
7+
```python
8+
# routes/web.py
9+
from flask import current_app as app
10+
11+
@app.route('/hello')
12+
def hello():
13+
return 'Hello, Zeython!'
14+
```
15+
16+
## API blueprint
17+
```python
18+
# routes/api.py
19+
from flask import Blueprint
20+
21+
api = Blueprint('api', __name__)
22+
23+
@api.route('/status')
24+
def status():
25+
return {'ok': True}
26+
```

docs/architecture.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Architecture
2+
3+
Zeython follows a modular MVC architecture with a service manager that runs services in parallel.
4+
5+
## High-level
6+
- Core (interfaces, config, service manager)
7+
- Services (web/Flask, optional Discord, your plugins)
8+
- Models (business entities, validation, caching, audit)
9+
- Controllers (web and service-specific logic)
10+
- Routes (web and API Blueprints)
11+
- Resources (templates and static assets)
12+
13+
## Service manager
14+
- Register service classes
15+
- Create instances from configuration
16+
- Start/stop services safely
17+
- Status/health reporting
18+
19+
## Threads and lifecycle
20+
- Services extend ThreadedService and run in their own thread
21+
- is_enabled() gates startup
22+
- start/stop/join managed via the manager
23+
24+
See EXAMPLES.md for examples and config/application.py for bootstrapping.

docs/authentication.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Authentication
2+
3+
Covers user authentication, JWT tokens, sessions, and OAuth integration patterns in Zeython.
4+
5+
- Password hashing in Users model
6+
- Session tracking with device info
7+
- JWT creation/validation/revocation
8+
- OAuth provider stubs (Google, GitHub, Discord)

docs/coding-standards.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Coding Standards
2+
3+
Consistent, readable code helps everyone contribute effectively.
4+
5+
## General
6+
- Follow PEP 8 style
7+
- Prefer type hints throughout
8+
- Small, focused functions
9+
- Descriptive names; avoid abbreviations
10+
11+
## Project conventions
12+
- Services extend `ThreadedService`
13+
- Use `service_manager` to register and manage services
14+
- Keep routes thin; place logic in controllers/services
15+
- Models use enhanced base model features
16+
17+
## Errors and logging
18+
- Raise specific exceptions from `app.Models.error_handling`
19+
- Log using module-level loggers
20+
21+
## Tests
22+
- Put tests under `tests/`
23+
- Cover happy paths and 1-2 edge cases

docs/config-reference.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Configuration Reference
2+
3+
Comprehensive reference of environment variables and config keys.
4+
5+
## App
6+
- APP_NAME: Default app display name (default: Zeython)
7+
- APP_LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR)
8+
9+
## Web Service
10+
- FLASK_HOST: Enables the web service when set (e.g., 0.0.0.0)
11+
- FLASK_PORT: Port (default: 5000)
12+
- FLASK_DEBUG: true/false (default: false)
13+
14+
## Discord Service
15+
- DISCORD_TOKEN: Enables the Discord service
16+
- DISCORD_PREFIX: Command prefix (default: !)
17+
18+
## Database
19+
- DATABASE_URL: SQLAlchemy connection string (e.g., sqlite:///database.db)
20+
21+
## Custom Services
22+
- YOURSERVICE_ENABLED: true/false
23+
- YOURSERVICE_...: other keys as needed
24+
25+
See `app/Core/config.py` for defaults and helpers (get, set, is_service_enabled, get_service_config).

docs/configuration.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Configuration
2+
3+
Zeython configuration is environment-driven with safe defaults.
4+
5+
## App settings
6+
- APP_NAME (default: Zeython)
7+
- APP_LOG_LEVEL (default: INFO)
8+
9+
## Web service
10+
- FLASK_HOST (enable when set)
11+
- FLASK_PORT (default: 5000)
12+
- FLASK_DEBUG (default: false)
13+
14+
## Discord service (optional)
15+
- DISCORD_TOKEN (enables Discord service)
16+
- DISCORD_PREFIX (default: !)
17+
18+
## Database
19+
- DATABASE_URL (e.g., sqlite:///database.db)
20+
21+
## Service-specific configs
22+
Use config.get_service_config(name) to retrieve service configs.
23+
24+
See `app/Core/config.py` for resolution order and helpers.

0 commit comments

Comments
 (0)