Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ sam-lms Public

Open-source Learning Management System for African education. Built with SA educators in mind. Features mobile money, SMS, offline-first curriculum. πŸ‡ΏπŸ‡¦

License

Sudz/sam-lms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SAM LMS - Smart African Learning Management System

License Node.js TypeScript React

A modern, feature-rich Learning Management System designed for African educational institutions, built with TypeScript, React, and cutting-edge authentication.

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 9.0.0
  • PostgreSQL >= 14.0
  • Git for version control

Factory/Droid CLI Integration

SAM LMS includes full Factory/droid CLI integration for automated development workflows:

# Install Factory CLI globally
npm install -g @factory/cli

# Initialize project with droid automation
factory init sam-lms
factory droid setup

# Start automated development workflow
factory droid start

Installation

# Clone the repository
git clone https://github.com/Sudz/sam-lms.git
cd sam-lms

# Install dependencies (automated via droid)
npm run setup

# Configure environment
npm run env:setup

# Start development servers
npm run dev

πŸ“‹ Available Scripts

Development

npm run setup          # Complete project setup with dependencies
npm run dev            # Start all development servers
npm run dev:backend    # Backend development server only
npm run dev:frontend   # Frontend development server only
npm run dev:db         # Database development tools

Testing

npm test               # Run all tests
npm run test:unit      # Unit tests only
npm run test:e2e       # End-to-end tests
npm run test:coverage  # Test coverage report
npm run test:watch     # Watch mode for development

Code Quality

npm run lint           # ESLint + Prettier
npm run lint:fix       # Auto-fix linting issues
npm run type-check     # TypeScript type checking
npm run format         # Format code with Prettier

Database

npm run db:migrate     # Run database migrations
npm run db:seed        # Seed database with sample data
npm run db:reset       # Reset database (dev only)
npm run db:studio      # Open database management studio

Deployment

npm run build          # Production build
npm run build:backend  # Backend production build
npm run build:frontend # Frontend production build
npm run deploy         # Deploy to production
npm run deploy:staging # Deploy to staging

Agent Automation

npm run agent:setup    # Setup agent automation
npm run agent:test     # Run automated tests via agents
npm run agent:deploy   # Automated deployment workflow
npm run agent:monitor  # Start monitoring agents

πŸ—οΈ Project Structure

sam-lms/
β”œβ”€β”€ backend/                 # Node.js/TypeScript API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/     # API route controllers
β”‚   β”‚   β”œβ”€β”€ middleware/      # Express middleware
β”‚   β”‚   β”œβ”€β”€ models/         # Database models
β”‚   β”‚   β”œβ”€β”€ routes/         # API routes
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic
β”‚   β”‚   └── utils/          # Utility functions
β”‚   β”œβ”€β”€ migrations/         # Database migrations
β”‚   └── tests/             # Backend tests
β”œβ”€β”€ frontend/               # React/TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ services/      # API services
β”‚   β”‚   β”œβ”€β”€ stores/        # State management
β”‚   β”‚   └── utils/         # Frontend utilities
β”‚   └── tests/             # Frontend tests
β”œβ”€β”€ infrastructure/         # AWS/Terraform configs
β”œβ”€β”€ docs/                   # Documentation
β”‚   β”œβ”€β”€ agents.md          # Agent automation guide
β”‚   β”œβ”€β”€ deployment-guide.md # Deployment instructions
β”‚   └── aws-setup.md       # AWS configuration
β”œβ”€β”€ .github/               # GitHub workflows
└── supabase/              # Database schemas

πŸ”§ Environment Configuration

Environment Variables

Copy the example environment files and configure:

# Backend environment
cp backend/.env.example backend/.env

# Frontend environment  
cp frontend/.env.example frontend/.env

Required Environment Variables

Backend (.env)

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/sam_lms"

# Authentication
BETTER_AUTH_SECRET="your-secret-key-here"
BETTER_AUTH_URL="http://localhost:3001"

# Payment Processing
PAYSTACK_SECRET_KEY="sk_test_your_paystack_secret"
PAYSTACK_PUBLIC_KEY="pk_test_your_paystack_public"

# SMS Services
AFRICAS_TALKING_USERNAME="your_username"
AFRICAS_TALKING_API_KEY="your_api_key"

# Email Services
RESEND_API_KEY="re_your_resend_api_key"

# AWS Configuration
AWS_ACCESS_KEY_ID="your_access_key"
AWS_SECRET_ACCESS_KEY="your_secret_key"
AWS_REGION="us-east-1"
AWS_S3_BUCKET="sam-lms-uploads"

# Factory/Droid Integration
FACTORY_API_KEY="your_factory_api_key"
DROID_AUTOMATION_TOKEN="your_droid_token"

API Key Management

  1. Development Keys: Use test/sandbox keys for local development
  2. Production Keys: Store in secure environment variables
  3. Key Rotation: Regularly rotate API keys (monthly recommended)
  4. Access Control: Limit API key permissions to minimum required

Secure Key Storage

# Using AWS Secrets Manager (production)
aws secretsmanager create-secret --name "sam-lms/production" --secret-string file://secrets.json

# Using environment-specific configs
npm run env:production  # Load production environment
npm run env:staging     # Load staging environment
npm run env:development # Load development environment

πŸ€– Agent Automation

SAM LMS includes comprehensive agent automation for development workflows. See docs/agents.md for detailed setup and configuration.

Quick Agent Setup

# Install agent dependencies
npm run agent:install

# Configure agent environment
npm run agent:configure

# Start automation agents
npm run agent:start

# Monitor agent activity
npm run agent:dashboard

πŸ”„ CI/CD Pipeline

GitHub Actions Workflows

  • .github/workflows/ci.yml - Continuous Integration
  • .github/workflows/deploy.yml - Deployment pipeline
  • .github/workflows/test.yml - Automated testing
  • .github/workflows/security.yml - Security scanning

Pipeline Stages

  1. Code Quality: ESLint, Prettier, TypeScript checks
  2. Testing: Unit tests, integration tests, E2E tests
  3. Security: Dependency scanning, SAST analysis
  4. Build: Production builds for frontend and backend
  5. Deploy: Automated deployment to staging/production

Deployment Environments

  • Development: Auto-deploy on feature branch push
  • Staging: Auto-deploy on main branch merge
  • Production: Manual approval required

πŸ§ͺ Testing Strategy

Test Types

  • Unit Tests: Jest + Testing Library
  • Integration Tests: Supertest for API testing
  • E2E Tests: Playwright for browser automation
  • Performance Tests: Lighthouse CI

Running Tests

# Complete test suite
npm test

# Specific test categories
npm run test:unit
npm run test:integration
npm run test:e2e
npm run test:performance

# Test coverage
npm run test:coverage

πŸ“Š Monitoring & Analytics

Application Monitoring

  • Error Tracking: Sentry integration
  • Performance: New Relic APM
  • Uptime: Pingdom monitoring
  • Logs: CloudWatch Logs

Analytics Dashboard

# Start monitoring dashboard
npm run monitor:start

# View application metrics
npm run monitor:metrics

# Check system health
npm run monitor:health

πŸš€ Deployment

Production Deployment

# Build for production
npm run build

# Deploy to AWS
npm run deploy:production

# Verify deployment
npm run deploy:verify

Infrastructure as Code

Infrastructure is managed with Terraform:

# Initialize Terraform
cd infrastructure
terraform init

# Plan infrastructure changes
terraform plan

# Apply changes
terraform apply

πŸ›‘οΈ Security Features

  • Authentication: BetterAuth with multiple providers
  • Authorization: Role-based access control (RBAC)
  • Data Encryption: AES-256 encryption for sensitive data
  • API Security: Rate limiting, input validation, CORS
  • Security Headers: Helmet.js security headers
  • Vulnerability Scanning: Automated dependency checks

🌍 Localization

SAM LMS supports multiple African languages:

  • English (default)
  • Swahili
  • Amharic
  • Yoruba
  • Zulu

Translation files are located in frontend/src/locales/.

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

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

Code Standards

  • TypeScript: Strict mode enabled
  • ESLint: Airbnb configuration
  • Prettier: Code formatting
  • Conventional Commits: Commit message format

πŸ“‹ Issue Templates

When reporting bugs or requesting features, please use our issue templates:

  • Bug Report: .github/ISSUE_TEMPLATE/bug.yml
  • Feature Request: .github/ISSUE_TEMPLATE/feature_request.yml

πŸ”’ Security

For security vulnerabilities, please review our Security Policy and report issues responsibly.

πŸ“œ License

Licensed under the ISC License. See LICENSE for details.

πŸ™ Acknowledgments

πŸ’¬ Support

🌟 Project Status

SAM LMS is under active development. Key features:

  • βœ… BetterAuth integration (email/password, magic links)
  • βœ… Paystack payment processing
  • βœ… Africa's Talking SMS notifications
  • βœ… Resend email integration
  • βœ… PostgreSQL database with migrations
  • βœ… React frontend with Vite
  • βœ… Factory/droid CLI integration
  • βœ… Automated testing suite
  • βœ… CI/CD pipeline
  • 🚧 Course management system
  • 🚧 User dashboard and progress tracking
  • 🚧 Advanced analytics and reporting
  • 🚧 Mobile application

Built with passion for African learners β€” https://saml.co.za/

About

Open-source Learning Management System for African education. Built with SA educators in mind. Features mobile money, SMS, offline-first curriculum. πŸ‡ΏπŸ‡¦

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •