Niyama is a comprehensive Policy as Code platform built with modern technologies and best practices. The system has been developed using a multi-agent approach with 5 specialized agents, resulting in a production-ready platform with advanced AI capabilities, comprehensive testing, and full observability.
- Advanced Google Gemini integration for intelligent policy generation
- Compliance framework mapping (SOC2, HIPAA, GDPR)
- Policy optimization and performance analytics
- Intelligent recommendations and security insights
- Fine-grained RBAC with organization-specific roles
- JWT authentication with refresh token support
- Permission-based access control
- Scalable user and organization management
- 80%+ test coverage across frontend and backend
- Cross-browser E2E testing with Playwright
- Performance testing with k6
- Security scanning and quality gates
- Kubernetes manifests with monitoring
- Docker containers optimized for security
- CI/CD pipeline with automated testing
- Prometheus/Grafana observability stack
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β AI Service β
β (React + TS) βββββΊβ (Go + Gin) βββββΊβ (Gemini API) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Nginx β β PostgreSQL β β Redis Cache β
β (Static) β β (Database) β β (AI Cache) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- React Query for state management
- Vitest for unit testing
- Playwright for E2E testing
- Go 1.21 with Gin framework
- GORM for database ORM
- PostgreSQL for primary database
- Redis for caching and sessions
- JWT for authentication
- Testify for testing
- Docker with multi-stage builds
- Kubernetes for orchestration
- GitHub Actions for CI/CD
- Prometheus for monitoring
- Grafana for visualization
- k6 for performance testing
- Google Gemini API for policy generation
- Compliance framework mapping
- Policy performance analytics
- Intelligent recommendations
niyama/
βββ backend-go/ # Go backend service
β βββ internal/
β β βββ config/ # Configuration management
β β βββ database/ # Database connection and models
β β βββ handlers/ # HTTP handlers
β β βββ middleware/ # Authentication and RBAC
β β βββ models/ # Data models
β β βββ services/ # Business logic
β βββ main.go
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ test/ # Test setup
β βββ package.json
βββ k8s/ # Kubernetes manifests
βββ tests/ # E2E and performance tests
βββ .github/workflows/ # CI/CD pipeline
βββ docs/ # Documentation
- Go 1.21+
- Node.js 18+
- Docker
- Kubernetes cluster (optional)
-
Clone the repository
git clone https://github.com/adhit-r/niyama-policy-as-code.git cd niyama-policy-as-code
-
Start the backend
cd backend-go go mod download go run main.go
-
Start the frontend
cd frontend npm install npm run dev
-
Access the application
- Frontend: http://localhost:3003
- Backend API: http://localhost:8000
# Build and run with Docker Compose
docker-compose up -d
# Apply Kubernetes manifests
kubectl apply -f k8s/
# Frontend tests
cd frontend
npm run test
# Backend tests
cd backend-go
go test ./...
# E2E tests
npx playwright test
# Performance tests
k6 run tests/performance/load-test.js
- Frontend: 80%+ coverage with Vitest
- Backend: 80%+ coverage with Go testing
- E2E: Cross-browser testing with Playwright
- Performance: Load testing with k6
- Authentication: JWT with refresh tokens
- Authorization: RBAC with fine-grained permissions
- Security Scanning: OWASP ZAP, gosec, npm audit
- Container Security: Non-root users, minimal images
- Network Security: Kubernetes network policies
- Metrics: Prometheus for metrics collection
- Visualization: Grafana dashboards
- Logging: Structured logging with slog
- Health Checks: Kubernetes health probes
- Alerting: Prometheus alerting rules
- Policy Generation: AI-powered policy creation
- Compliance Mapping: Automated compliance framework mapping
- Performance Analytics: Policy performance insights
- Recommendations: Intelligent optimization suggestions
- Security Insights: Automated security recommendations
- Frontend: Optimized with React.memo and useMemo
- Backend: Connection pooling and caching
- Database: Optimized queries with GORM
- Caching: Redis for AI responses and sessions
- CDN: Static asset optimization
- SOC2: Security and availability controls
- HIPAA: Healthcare data protection
- GDPR: Data privacy and protection
- Custom Frameworks: Extensible compliance mapping
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
This project was developed using a multi-agent approach with 5 specialized agents:
- Agent 1: Backend Infrastructure Specialist
- Agent 2: Frontend & UI Specialist
- Agent 3: DevOps & Infrastructure Specialist
- Agent 4: Testing & Quality Specialist
- Agent 5: AI & Advanced Features Specialist
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review the troubleshooting guide
Status: β
Production Ready
Version: 1.0.0
Last Updated: 2024