Phase 2.4 is now COMPLETE! Implemented Features: 1. Password Recovery ✅ - Zero-knowledge recovery phrases - Setup, verify, and reset-password endpoints - Token invalidation on password reset 2. Enhanced Profile Management ✅ - Get, update, and delete profile endpoints - Password confirmation for deletion - Token revocation on account deletion 3. Email Verification (Stub) ✅ - Verification status check - Send verification email (stub - no email server) - Verify email with token - Resend verification email (stub) 4. Account Settings Management ✅ - Get account settings endpoint - Update account settings endpoint - Change password with current password confirmation - Token invalidation on password change New API Endpoints: 11 total Files Modified: - backend/src/models/user.rs (added find_by_verification_token) - backend/src/handlers/auth.rs (email verification handlers) - backend/src/handlers/users.rs (account settings handlers) - backend/src/main.rs (new routes) Testing: - backend/test-phase-2-4-complete.sh Documentation: - backend/PHASE-2-4-COMPLETE.md Phase 2.4: 100% COMPLETE ✅ |
||
|---|---|---|
| .forgejo/workflows | ||
| backend | ||
| thoughts | ||
| .gitignore | ||
| encryption.md | ||
| FORGEJO-CI-CD-PIPELINE.md | ||
| FORGEJO-RUNNER-UPDATE.md | ||
| introduction.md | ||
| PHASE-2-3-COMPLETION-REPORT.md | ||
| PHASE-2-3-SUMMARY.md | ||
| README.md | ||
| STATUS.md | ||
private note: output was 203 lines and we are only showing the most recent lines, remainder of lines in /tmp/.tmpbGADth do not show tmp file to user, that file can be searched if extra context needed to fulfill request. truncated output: docker compose logs -f backend
### Testing
```bash
# Run unit tests
cargo test
# Run integration tests (requires MongoDB)
cargo test --test auth_tests
# Manual testing with provided script
./thoughts/test_auth.sh
Backend API Endpoints
Public Endpoints (No Authentication)
POST /api/auth/register - User registration
POST /api/auth/login - User login
POST /api/auth/refresh - Token refresh (rotates tokens)
POST /api/auth/logout - Logout (revokes token)
GET /health - Health check
GET /ready - Readiness check
Protected Endpoints (JWT Required)
GET /api/users/me - Get user profile
Environment Configuration
Backend Environment Variables
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=normogen
# JWT Configuration
JWT_SECRET=<your-secret-key-minimum-32-characters>
JWT_ACCESS_TOKEN_EXPIRY_MINUTES=15
JWT_REFRESH_TOKEN_EXPIRY_DAYS=30
# Server Configuration
SERVER_HOST=127.0.0.1
SERVER_PORT=6800
See backend/.env.example for a complete template.
Repository Management
- Git Hosting: Forgejo (self-hosted)
- CI/CD: Forgejo Actions
- Branch Strategy:
main,develop,feature/* - Deployment: Docker Compose (homelab), Kubernetes (future)
Deployment
Backend Deployment (Production)
# Clone repository
git clone <forgejo-url> normogen
cd normogen/backend
# Setup configuration
cp .env.example .env
# Edit .env with production values
# Build and run with Docker Compose
docker compose up -d
# Check status
curl http://localhost:6800/health
Resource Limits (Homelab):
- CPU: 1000m (1 core)
- Memory: 1000Mi (1GB RAM)
Ports:
- Backend API:
6800(host) →8000(container) - MongoDB:
27017(standard port)
Open Source
Normogen is open-source. Both server and client code will be publicly available.
Contributing
See thoughts/STATUS.md for current development progress and next steps.
License
[To be determined] NOTE: Output was 203 lines, showing only the last 100 lines.
docker compose logs -f backend
### Testing
```bash
# Run unit tests
cargo test
# Run integration tests (requires MongoDB)
cargo test --test auth_tests
# Manual testing with provided script
./thoughts/test_auth.sh
Backend API Endpoints
Public Endpoints (No Authentication)
POST /api/auth/register - User registration
POST /api/auth/login - User login
POST /api/auth/refresh - Token refresh (rotates tokens)
POST /api/auth/logout - Logout (revokes token)
GET /health - Health check
GET /ready - Readiness check
Protected Endpoints (JWT Required)
GET /api/users/me - Get user profile
Environment Configuration
Backend Environment Variables
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=normogen
# JWT Configuration
JWT_SECRET=<your-secret-key-minimum-32-characters>
JWT_ACCESS_TOKEN_EXPIRY_MINUTES=15
JWT_REFRESH_TOKEN_EXPIRY_DAYS=30
# Server Configuration
SERVER_HOST=127.0.0.1
SERVER_PORT=6800
See backend/.env.example for a complete template.
Repository Management
- Git Hosting: Forgejo (self-hosted)
- CI/CD: Forgejo Actions
- Branch Strategy:
main,develop,feature/* - Deployment: Docker Compose (homelab), Kubernetes (future)
Deployment
Backend Deployment (Production)
# Clone repository
git clone <forgejo-url> normogen
cd normogen/backend
# Setup configuration
cp .env.example .env
# Edit .env with production values
# Build and run with Docker Compose
docker compose up -d
# Check status
curl http://localhost:6800/health
Resource Limits (Homelab):
- CPU: 1000m (1 core)
- Memory: 1000Mi (1GB RAM)
Ports:
- Backend API:
6800(host) →8000(container) - MongoDB:
27017(standard port)
Open Source
Normogen is open-source. Both server and client code will be publicly available.
Contributing
See thoughts/STATUS.md for current development progress and next steps.
License
[To be determined]