Janus 2.0 is a simple, fast, and secure personnel and access control management system for high-security, air-gapped environments.
Built with lessons learned from Janus 1.0 - Complete rewrite focusing on simplicity over complexity.
| Aspect | Janus 1.0 | Janus 2.0 | Improvement |
|---|---|---|---|
| Layers | 4 (Controller β Service β Repository β DB) | 1 (Handler β DB) | 75% simpler |
| Build Time | 2-3 minutes | < 30 seconds | 6x faster |
| API Response | 200ms | < 50ms | 4x faster |
| Dependencies | 80+ | ~40 | 50% fewer |
| Code Lines | 27,000 | ~13,500 | 50% less |
βββββββββββββββββββββββββββββββββββββββ
β Frontend (React + TypeScript) β
β Port: 15510 β
βββββββββββββββ¬ββββββββββββββββββββββββ
β REST API (JWT)
βββββββββββββββΌββββββββββββββββββββββββ
β Backend (Rust + Rocket) β
β Port: 15520 β
βββββββββββββββ¬ββββββββββββββββββββββββ
β SQLx (Direct queries)
βββββββββββββββΌββββββββββββββββββββββββ
β PostgreSQL Database β
β Port: 15530 | DB: janus2 β
βββββββββββββββββββββββββββββββββββββββ
Port Allocation: 15500-15599 range (see PORT-ALLOCATION.md)
- Rust 1.70+ - Performance and safety
- Rocket 0.5+ - Web framework
- SQLx 0.7+ - Database (compile-time checked)
- PostgreSQL 15+ - Database
- React 18+ with TypeScript
- Vite 5+ - Build tool
- TanStack Router - File-based routing
- TanStack Query - Server state
- shadcn/ui + Tailwind CSS - UI components
- Docker + Docker Compose
- Single command:
docker-compose up
- Rust 1.70+
- Node.js 20+
- PostgreSQL 15+ (or Docker)
- Docker 24+ (for deployment)
# Clone repository
git clone <repository-url>
cd janus-2.0
# Start PostgreSQL
docker-compose up -d postgres
# Backend
cd backend
cargo build
cargo test
cargo run
# Frontend (in another terminal)
cd frontend
npm install
npm run dev- Frontend: http://localhost:15510
- Backend API: http://localhost:15520
- Health Check: http://localhost:15520/api/health
- PostgreSQL: localhost:15530 (Docker)
Complete documentation is in the /docs folder:
- QUICK-START.md - 5-minute overview
- 09-LESSONS-LEARNED.md -
β οΈ Read this FIRST! - 00-OVERVIEW.md - Vision and goals
- 01-REQUIREMENTS.md - Complete requirements
- 02-ARCHITECTURE.md - System architecture
- 03-TECHNOLOGY-STACK.md - Technology details
- 11-IMPLEMENTATION-PLAN.md - Week-by-week roadmap
- β User authentication (JWT)
- β Personnel management (CRUD)
- β Vendor management (CRUD)
- β Basic RBAC (4 roles)
- β Three-tier access control (Computer, Data, Physical)
- β Access card management
- β Clearance expiration tracking
- β Audit logging
- β Compliance reporting
"Simplicity Over Complexity"
- Direct over Abstract - Query database directly, no Repository pattern
- Standard over Custom - Use framework features, no custom DI containers
- Complete over Perfect - 100% complete features, no mock data
- Fast over Flexible - Performance is a feature
- Clear over Clever - Obvious code over clever abstractions
# Backend tests
cd backend
cargo test
# Frontend tests
cd frontend
npm test
# E2E tests
npm run test:e2eCoverage Goals:
- Backend: 80% minimum
- Frontend: 70% minimum
- E2E: Critical user journeys
docker-compose up -ddocker-compose -f docker-compose.prod.yml up -d- Backend build: < 30 seconds β
- Frontend build: < 10 seconds β
- API response: < 50ms (p95) β
- Database queries: < 10ms β
- Uptime: 99.9% β
- Authentication: JWT with 8-hour expiry
- Password Hashing: bcrypt (cost factor 12)
- Authorization: Role-based access control
- Audit Trail: Complete audit logging
- Input Validation: Comprehensive validation
- Current Phase: MVP 1 - Week 1 β COMPLETED
- Next Phase: MVP 1 - Week 2 (Frontend Development)
- Timeline: 3-4 weeks remaining to production
- β Backend directory structure with feature modules
- β Frontend configuration with TanStack Router
- β Docker setup for PostgreSQL
- β Environment configuration
- β Both backend and frontend build successfully
- β Health check endpoint working
- β Day 1: Database Schema + Authentication (JWT)
- β Day 2: Personnel GET APIs (List + Get by ID)
- β Day 3: Personnel CRUD Complete (POST/PUT/DELETE)
- β Day 4: Vendors CRUD Complete (All 5 endpoints)
- β Day 5: Audit Logging System (Query and filtering)
- β Day 6: Code cleanup, zero warnings, Week 1 wrap-up
Backend Foundation: Complete and production-ready! π
- β³ Frontend setup (React + TypeScript + Vite)
- β³ TanStack Router + TanStack Query
- β³ Authentication UI
- β³ Personnel management UI
- β³ Vendor management UI
- β³ Audit log viewer
GET /- Welcome messageGET /api/health- Health check with database statusPOST /api/auth/login- User authentication (returns JWT)GET /api/personnel- List all personnel (paginated, requires auth)GET /api/personnel/:id- Get personnel by ID (requires auth)POST /api/personnel- Create new personnel (requires auth)PUT /api/personnel/:id- Update personnel (partial, requires auth)DELETE /api/personnel/:id- Soft delete personnel (requires auth)GET /api/vendors- List all vendors (paginated, requires auth)GET /api/vendors/:id- Get vendor by ID (requires auth)POST /api/vendors- Create new vendor (requires auth)PUT /api/vendors/:id- Update vendor (partial, requires auth)DELETE /api/vendors/:id- Soft delete vendor (requires auth)GET /api/audit- Query audit logs with filtering (requires auth)
Week 1 Complete: All backend core functionality implemented and tested!
Next Steps: Week 2 - Frontend Development (React + TypeScript)
- Read
/docs/09-LESSONS-LEARNED.mdfirst! - Follow the implementation plan in
/docs/11-IMPLEMENTATION-PLAN.md - Backend first (per project requirements)
- Test as you go (TDD)
- No mock data, no TODO comments
MIT License - see LICENSE file for details
Copyright (c) 2025 Vidar Brevik
- Documentation:
/docsfolder - Repository: https://github.com/vbrevik/janus-2.0
- Issues: https://github.com/vbrevik/janus-2.0/issues
- Discussions: https://github.com/vbrevik/janus-2.0/discussions
Janus 2.0 - Secure, Simple, and Fast
Built with lessons learned from Janus 1.0