No description
Rate limiting (closes the last security gap #3): - New RateLimiter: in-memory fixed-window IP-based limiter (std::sync::Mutex HashMap, no new deps). Configurable via RATE_LIMIT_MAX (default 100) + RATE_LIMIT_WINDOW_SECS (default 60) env vars. - general_rate_limit_middleware now reads ClientIp from request extensions and rejects with 429 + Retry-After header when over the limit. Wired via from_fn_with_state in app.rs. Lived on AppState as Arc<RateLimiter>. - Deleted the dead auth_rate_limit_middleware (never wired). - 3 unit tests (allows up to N, independent IPs, window reset). E2E crypto lifecycle test: - Full zero-knowledge round-trip against jsdom's real Web Crypto: setup → encrypt → verify ciphertext → unlock with password → decrypt → recover via phrase → rewrap under new password → decrypt. Plus wrong-password/wrong-phrase failures and cross-user key isolation. - Fixed wrapDek/unwrapDek: base64-encode raw DEK bytes (was using TextDecoder which produced non-base64), and make unwrapped DEK extractable (needed for rewrapDek to export). Verified: backend 24 tests 0 warnings; frontend 24 tests, build clean. |
||
|---|---|---|
| .forgejo/workflows | ||
| backend | ||
| docs | ||
| scripts | ||
| web/normogen-web | ||
| .cursorrules | ||
| .gitignore | ||
| .gooserules | ||
| README.md | ||
Normogen
Normogen (Mapudungun for "Balanced Life") is an open-source health data platform for private, secure health data management.
📚 Documentation
All project documentation has been organized into the docs/ directory:
- Documentation Index - Start here for complete documentation
- Product Overview - Project introduction and features
- Quick Start - Get started quickly
- API Documentation - Backend API reference
🚀 Quick Start
# Clone repository
git clone <forgejo-url> normogen
cd normogen/backend
# Setup configuration
cp .env.example .env
# Edit .env with your values
# Run with Docker Compose
docker compose up -d
# Check status (default port is 6500 via NORMOGEN_PORT; Solaria maps it to host 6800)
curl http://localhost:6500/health
📊 Current Status
- Backend: ✅ Phase 2.x feature-complete (Rust + Axum + MongoDB), including drug interactions (Phase 2.8). Security-hardened: token-version validation, hashed refresh-token persistence, fail-fast config, real-IP audit logging. Deployed on Solaria.
- Frontend: 🚧 Early (React + TypeScript) — Login/Register pages + API/store layer exist; router not yet wired.
- Tests: 18 unit + 13 integration (auth + medication), CI-gated with MongoDB.
- Deployment: Docker on Solaria (image built manually — CI can't run DinD on Forgejo).
- See docs/product/STATUS.md for the full breakdown.
🗂️ Documentation Structure
docs/
├── product/ # Product definition, features, roadmap
├── implementation/ # Phase plans, specs, progress reports
├── testing/ # Test scripts and results
├── deployment/ # Deployment guides and scripts
├── development/ # Git workflow, CI/CD, development tools
└── archive/ # Historical documentation
📖 Full Documentation
See the Documentation Index for complete project documentation.
Last Updated: 2026-06-27