Skip to content

Commit e139d6f

Browse files
committed
🌍 SwachhZero v0.1.0 β€” AI Platform for Planetary Well-Being
1 parent 64b4a5a commit e139d6f

206 files changed

Lines changed: 45889 additions & 16 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.editorconfigβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{js,jsx,ts,tsx,json,yml,yaml,css,scss}]
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[Makefile]
18+
indent_style = tab

β€Ž.env.exampleβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SwachhZero Environment Variables β€” copy to .env and customize
2+
SZ_ENVIRONMENT=development
3+
SZ_DEBUG=false
4+
SZ_LOG_LEVEL=INFO
5+
SZ_DB_POSTGRES_DSN=postgresql+asyncpg://swachhzero:swachhzero@localhost:5432/swachhzero
6+
SZ_DB_REDIS_DSN=redis://localhost:6379/0
7+
SZ_STORAGE_ENDPOINT=http://localhost:9000
8+
SZ_STORAGE_ACCESS_KEY=minioadmin
9+
SZ_STORAGE_SECRET_KEY=change-me
10+
SZ_KAFKA_BOOTSTRAP_SERVERS=localhost:9092
11+
SZ_ML_DEVICE=auto
12+
SZ_SECURITY_SECRET_KEY=change-me-to-a-random-64-char-string

β€Ž.github/dependabot.ymlβ€Ž

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
labels: ["dependencies", "python"]
9+
10+
- package-ecosystem: npm
11+
directory: "/src/frontend"
12+
schedule:
13+
interval: weekly
14+
open-pull-requests-limit: 5
15+
labels: ["dependencies", "javascript"]
16+
17+
- package-ecosystem: github-actions
18+
directory: "/"
19+
schedule:
20+
interval: weekly
21+
open-pull-requests-limit: 3
22+
labels: ["dependencies", "ci"]
23+
24+
- package-ecosystem: docker
25+
directory: "/docker"
26+
schedule:
27+
interval: weekly
28+
open-pull-requests-limit: 3
29+
labels: ["dependencies", "docker"]

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
- name: Install dependencies
22+
run: pip install -e ".[dev]"
23+
- name: Ruff check
24+
run: ruff check src/ tests/
25+
- name: Ruff format check
26+
run: ruff format --check src/ tests/
27+
- name: Mypy type check
28+
run: mypy src/ --ignore-missing-imports
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
needs: lint
33+
strategy:
34+
matrix:
35+
python-version: ['3.12', '3.13']
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: Install dependencies
42+
run: pip install -e ".[dev]"
43+
- name: Run unit tests
44+
run: pytest tests/unit/ -v --tb=short -x
45+
- name: Run integration tests
46+
run: pytest tests/integration/ -v --tb=short
47+
- name: Upload coverage
48+
uses: codecov/codecov-action@v4
49+
50+
test-frontend:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: '22'
57+
- name: Install dependencies
58+
working-directory: src/frontend
59+
run: npm ci
60+
- name: Type check
61+
working-directory: src/frontend
62+
run: npx tsc --noEmit
63+
- name: Lint
64+
working-directory: src/frontend
65+
run: npx next lint
66+
- name: Build
67+
working-directory: src/frontend
68+
run: npm run build
69+
70+
security:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: actions/setup-python@v5
75+
with:
76+
python-version: '3.12'
77+
- name: Install dependencies
78+
run: pip install bandit safety
79+
- name: Bandit security scan
80+
run: bandit -r src/swachhzero/ -c pyproject.toml || true
81+
- name: Safety dependency check
82+
run: safety check || true
83+
84+
build-docker:
85+
runs-on: ubuntu-latest
86+
needs: [test, test-frontend]
87+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
88+
steps:
89+
- uses: actions/checkout@v4
90+
- name: Set up Docker Buildx
91+
uses: docker/setup-buildx-action@v3
92+
- name: Build API image
93+
run: docker build -f docker/Dockerfile.api -t swachhzero-api:${{ github.sha }} .
94+
- name: Build Frontend image
95+
run: docker build -f docker/Dockerfile.frontend -t swachhzero-frontend:${{ github.sha }} .

β€Ž.github/workflows/docs.ymlβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['docs/**', 'mkdocs.yml']
7+
8+
jobs:
9+
deploy-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.12'
16+
- name: Install dependencies
17+
run: pip install -e ".[docs]"
18+
- name: Build and deploy
19+
run: mkdocs gh-deploy --force
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12'
18+
- name: Build package
19+
run: |
20+
pip install build
21+
python -m build
22+
- name: Create GitHub Release
23+
uses: softprops/action-gh-release@v2
24+
with:
25+
files: dist/*
26+
generate_release_notes: true
27+
- name: Publish to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
password: ${{ secrets.PYPI_TOKEN }}

β€Ž.gitignoreβ€Ž

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
dist/
7+
build/
8+
*.egg-info/
9+
*.egg
10+
.eggs/
11+
.venv/
12+
venv/
13+
env/
14+
.mypy_cache/
15+
.ruff_cache/
16+
.pytest_cache/
17+
.coverage
18+
htmlcov/
19+
*.log
20+
21+
# Node
22+
node_modules/
23+
.next/
24+
out/
25+
.turbo/
26+
27+
# Data & Models
28+
data/raw/
29+
data/processed/
30+
data/interim/
31+
models/checkpoints/
32+
models/artifacts/
33+
*.h5
34+
*.ckpt
35+
*.pt
36+
*.pth
37+
*.safetensors
38+
*.onnx
39+
*.tflite
40+
*.parquet
41+
*.zarr/
42+
*.nc
43+
*.tif
44+
*.tiff
45+
46+
# Environment
47+
.env
48+
.env.local
49+
.env.production
50+
*.pem
51+
*.key
52+
53+
# IDE
54+
.vscode/settings.json
55+
.idea/
56+
*.swp
57+
*.swo
58+
59+
# OS
60+
.DS_Store
61+
Thumbs.db
62+
63+
# Docker
64+
docker-compose.override.yml
65+
66+
# Terraform
67+
.terraform/
68+
*.tfstate
69+
*.tfstate.backup
70+
*.tfvars
71+
72+
# DVC
73+
/data/*.dvc
74+
75+
# Roo AI
76+
.roo/
77+
78+
# Private files
79+
private/

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
args: [--allow-multiple-documents]
9+
- id: check-toml
10+
- id: check-json
11+
- id: check-added-large-files
12+
args: [--maxkb=1000]
13+
- id: check-merge-conflict
14+
- id: detect-private-key
15+
- id: no-commit-to-branch
16+
args: [--branch, main, --branch, release]
17+
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: v0.8.4
20+
hooks:
21+
- id: ruff
22+
args: [--fix]
23+
- id: ruff-format
24+
25+
- repo: https://github.com/pre-commit/mirrors-mypy
26+
rev: v1.13.0
27+
hooks:
28+
- id: mypy
29+
additional_dependencies: [pydantic>=2.10.0]
30+
args: [--ignore-missing-imports]
31+
32+
- repo: https://github.com/PyCQA/bandit
33+
rev: 1.8.2
34+
hooks:
35+
- id: bandit
36+
args: [-r, src/, -c, pyproject.toml]
37+
38+
- repo: https://github.com/commitizen-tools/commitizen
39+
rev: v4.1.0
40+
hooks:
41+
- id: commitizen

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Initial project scaffolding with complete package structure
13+
- Core modules: configuration, logging, exceptions, types, constants
14+
- CLI entry point with data, model, and serve commands
15+
- FastAPI application factory with health check endpoints
16+
- Data pipeline package: ingestion, processing, storage, catalog
17+
- ML model packages: foundation, physics, graphs, RL, federated
18+
- Inference engine, prediction pipeline, and caching stubs
19+
- Monitoring infrastructure: metrics, tracing, alerts
20+
- Celery task definitions for ingestion and training
21+
- Comprehensive test structure with initial unit tests
22+
- Configuration files (default.yaml, production.yaml)
23+
- Makefile with development workflow targets
24+
- Community files: LICENSE, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY
25+
- System architecture documentation
26+
27+
### Infrastructure
28+
29+
- Python 3.11+ with `pyproject.toml` build configuration
30+
- Pre-commit hooks for code quality (ruff, mypy)
31+
- EditorConfig for consistent formatting

0 commit comments

Comments
Β (0)