Skip to content

OpenKMS is a comprehensive knowledge management system designed to streamline training administration, user management, and knowledge sharing within organizations.

Notifications You must be signed in to change notification settings

smattaparthy/OpenKMS

Repository files navigation

OpenKMS - Open Knowledge Management System

License Version Status

OpenKMS is a comprehensive knowledge management system designed to streamline training administration, user management, and knowledge sharing within organizations. Built with modern web technologies, it provides a robust platform for managing training programs, user registrations, and learning resources.

🌟 Features

Core Functionality

  • Training Management: Create, manage, and track training programs and schedules
  • User Administration: Complete user lifecycle management with role-based access control
  • Registration System: Streamlined training enrollment and attendance tracking
  • Knowledge Base: Centralized repository for learning materials and documentation
  • Admin Dashboard: Comprehensive dashboard for system administration and analytics

Technical Features

  • Modern UI/UX: Responsive web interface built with Blazor Server and Bootstrap
  • RESTful API: FastAPI backend with automatic API documentation
  • Authentication & Authorization: JWT-based authentication with role-based permissions
  • Database Management: PostgreSQL with async SQLAlchemy for optimal performance
  • Caching Layer: Redis integration for improved performance
  • Containerized: Docker-compose orchestration for easy deployment

πŸš€ Quick Start

Prerequisites

  • Docker 20.10+
  • Docker Compose 2.0+
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/your-org/openkms.git
    cd openkms
  2. Set up environment

    chmod +x scripts/*.sh
    ./scripts/check-environment.sh
    ./scripts/dev-setup.sh
  3. Start the application

    ./scripts/dev-commands.sh start
  4. Access the application

πŸ“‹ Architecture

System Overview

OpenKMS follows a modern microservices architecture with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend          β”‚    β”‚   Backend          β”‚    β”‚   Infrastructure   β”‚
β”‚                     β”‚    β”‚                     β”‚    β”‚                     β”‚
β”‚  β€’ Blazor Server   │◄──►│  β€’ FastAPI         │◄──►│  β€’ PostgreSQL      β”‚
β”‚  β€’ Bootstrap UI    β”‚    β”‚  β€’ SQLAlchemy      β”‚    β”‚  β€’ Redis           β”‚
β”‚  β€’ C#/.NET 8      β”‚    β”‚  β€’ JWT Auth        β”‚    β”‚  β€’ Docker          β”‚
β”‚  β€’ SignalR        β”‚    β”‚  β€’ Pydantic        β”‚    β”‚  β€’ Nginx (Prod)    β”‚
β”‚                     β”‚    β”‚  β€’ Alembic         β”‚    β”‚                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

Frontend

  • Framework: ASP.NET Core 8 Blazor Server
  • UI Framework: Bootstrap 5 with custom design system
  • Language: C# 12
  • Authentication: JWT tokens with local storage
  • Communication: SignalR for real-time updates

Backend

  • Framework: FastAPI 0.104+
  • Language: Python 3.9+
  • ORM: SQLAlchemy 2.0 with async support
  • Authentication: JWT with Pydantic validation
  • API Documentation: OpenAPI/Swagger auto-generated
  • Database Migrations: Alembic

Infrastructure

  • Database: PostgreSQL 15
  • Cache: Redis 7
  • Containerization: Docker & Docker Compose
  • Web Server: Nginx (Production)
  • SSL/TLS: Let's Encrypt support

πŸ›  Development

Development Setup

For detailed development instructions, see README.DEVELOPMENT.md.

Key Development Commands

# Start development environment
./scripts/dev-commands.sh start

# View logs
./scripts/dev-commands.sh logs
./scripts/dev-commands.sh logs-backend
./scripts/dev-commands.sh logs-frontend

# Run tests
./scripts/dev-commands.sh test-backend
./scripts/dev-commands.sh test-frontend

# Database operations
./scripts/dev-commands.sh migrate      # Run migrations
./scripts/dev-commands.sh migrate-new   # Create migration
./scripts/dev-commands.sh backup       # Create backup

Project Structure

openkms/
β”œβ”€β”€ openkms-backend/          # Python FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ core/            # Core configuration
β”‚   β”‚   β”œβ”€β”€ models/          # SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ schemas/         # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ api/             # API endpoints
β”‚   β”‚   └── services/        # Business logic
β”‚   β”œβ”€β”€ tests/               # Test files
β”‚   └── requirements.txt     # Dependencies
β”œβ”€β”€ openkms-frontend/        # C# Blazor frontend
β”‚   β”œβ”€β”€ Components/          # Blazor components
β”‚   β”‚   β”œβ”€β”€ Auth/           # Authentication components
β”‚   β”‚   β”œβ”€β”€ Admin/          # Admin components
β”‚   β”‚   β”œβ”€β”€ Training/       # Training components
β”‚   β”‚   └── Layout/         # Layout components
β”‚   β”œβ”€β”€ Services/           # Application services
β”‚   β”œβ”€β”€ Models/             # Data models
β”‚   └── Properties/         # Build configuration
β”œβ”€β”€ scripts/                 # Development scripts
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ nginx/                  # Nginx configuration
└── docker-compose.yml       # Container orchestration

πŸ“š Documentation

Core Documentation

User Guides

πŸ”§ Configuration

Environment Variables

The application uses environment variables for configuration. Copy .env.example to .env:

# Database
POSTGRES_PASSWORD=your_secure_password
DATABASE_URL=postgresql://openkms:your_secure_password@postgres:5432/openkms

# Redis
REDIS_URL=redis://redis:6379/0

# Security
SECRET_KEY=your-very-secure-secret-key-here
ALGORITHM=HS256

# Application
DEBUG=False          # Set to False in production
LOG_LEVEL=INFO
ALLOWED_HOSTS=yourdomain.com

# URLs
FRONTEND_URL=https://yourdomain.com
BACKEND_URL=https://api.yourdomain.com

🌐 Deployment

Quick Deployment

For production deployment, see DEPLOYMENT.md.

Production Setup

# Configure production environment
cp .env.example .env.production
# Edit .env.production with production values

# Deploy with production configuration
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

Deployment Options

  • Docker Compose: Recommended for single-server deployments
  • Kubernetes: For orchestrating multiple containers (see deployment guide)
  • Cloud Platforms: AWS, Azure, GCP deployment guides available

πŸ”’ Security

Security Features

  • JWT Authentication: Stateless authentication with secure token handling
  • Role-Based Access Control: Granular permissions for different user roles
  • Password Security: Password hashing with bcrypt and complexity requirements
  • Input Validation: Comprehensive validation using Pydantic schemas
  • SQL Injection Prevention: SQLAlchemy ORM with parameterized queries
  • HTTPS Enforcement: SSL/TLS encryption for all communications

Security Best Practices

  • Secure password requirements (12+ characters, complexity enforced)
  • Regular security updates for all dependencies
  • Environment variable secrets management
  • Request rate limiting
  • CORS configuration
  • Security headers implementation

🎯 User Roles & Permissions

Available Roles

  • EMPLOYEE: Basic user access, can browse and register for trainings
  • KNOWLEDGE_MANAGER: Can create and manage training programs
  • ADMIN: Full system access, user management, and system configuration

Permission Matrix

Feature EMPLOYEE KNOWLEDGE_MANAGER ADMIN
View Trainings βœ… βœ… βœ…
Register for Trainings βœ… βœ… βœ…
Create Trainings ❌ βœ… βœ…
Manage Users ❌ ❌ βœ…
System Administration ❌ ❌ βœ…
View Reports πŸ”’* βœ… βœ…

*Limited to own attendance data

πŸ“Š Monitoring & Analytics

Application Monitoring

  • Health Checks: Automatic health monitoring for all services
  • Performance Metrics: Request times, database queries, cache performance
  • Error Tracking: Comprehensive error logging and alerting
  • User Analytics: Training completion rates, user engagement metrics

Monitoring Tools

  • Prometheus: Metrics collection and alerting
  • Grafana: Dashboard visualization
  • ELK Stack: Log aggregation and analysis
  • Sentry: Error tracking and reporting

πŸ”„ API Integrations

Supported Integrations

  • LDAP/Active Directory: Enterprise user authentication
  • OAuth 2.0: Third-party authentication providers
  • Webhooks: Event notifications to external systems
  • REST API: Full API for external system integration

Integration Points

  • User synchronization with HR systems
  • Training content management systems
  • Learning record stores (LRS)
  • Email and notification systems

🀝 Contributing

We welcome contributions! Please see our contributing guidelines:

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Backend: Follow PEP 8, use black formatter, write comprehensive tests
  • Frontend: Follow C# naming conventions, use XML documentation
  • Testing: Maintain test coverage above 80% for all components

Bug Reports

For bug reports and feature requests, please use the GitHub Issues page.

πŸ“ˆ Performance

Performance Benchmarks

  • Response Time: <200ms for API endpoints (95th percentile)
  • Database Queries: <50ms for common operations with proper indexing
  • Concurrent Users: 1000+ concurrent users with proper scaling
  • Database Size: Optimized for 100,000+ user records

Optimization Features

  • Database indexing strategy
  • Redis caching for frequently accessed data
  • Async processing for non-blocking operations
  • CDN support for static assets
  • Database connection pooling

πŸ§ͺ Testing

Testing Strategy

  • Unit Tests: Component-level testing with mocking
  • Integration Tests: API endpoint testing with database
  • End-to-End Tests: Full user journey testing with Playwright
  • Load Testing: Performance testing under peak load scenarios

Test Coverage

  • Backend: pytest with 80%+ coverage requirement
  • Frontend: xUnit with bUnit for Blazor component testing
  • API: Automated testing with pytest + httpx
  • E2E: Playwright for critical user workflows

πŸ†˜ Support

Getting Help

Troubleshooting

For common issues and solutions, see the troubleshooting sections in:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • FastAPI Team: For the excellent web framework
  • Microsoft: For the Blazor framework and .NET ecosystem
  • Bootstrap Team: For the responsive UI framework
  • PostgreSQL: For the robust database system
  • Docker Team: For containerization technology

πŸ“ž Contact


OpenKMS Logo

Empowering organizations through streamlined knowledge management and training administration.

About

OpenKMS is a comprehensive knowledge management system designed to streamline training administration, user management, and knowledge sharing within organizations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published