A modern, feature-rich Learning Management System designed for African educational institutions, built with TypeScript, React, and cutting-edge authentication.
- Node.js >= 18.0.0
- npm >= 9.0.0
- PostgreSQL >= 14.0
- Git for version control
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# 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 devnpm 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 toolsnpm 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 developmentnpm 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 Prettiernpm 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 studionpm 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 stagingnpm 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 agentssam-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
Copy the example environment files and configure:
# Backend environment
cp backend/.env.example backend/.env
# Frontend environment
cp frontend/.env.example frontend/.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"- Development Keys: Use test/sandbox keys for local development
- Production Keys: Store in secure environment variables
- Key Rotation: Regularly rotate API keys (monthly recommended)
- Access Control: Limit API key permissions to minimum required
# 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 environmentSAM LMS includes comprehensive agent automation for development workflows. See docs/agents.md for detailed setup and configuration.
# 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.github/workflows/ci.yml- Continuous Integration.github/workflows/deploy.yml- Deployment pipeline.github/workflows/test.yml- Automated testing.github/workflows/security.yml- Security scanning
- Code Quality: ESLint, Prettier, TypeScript checks
- Testing: Unit tests, integration tests, E2E tests
- Security: Dependency scanning, SAST analysis
- Build: Production builds for frontend and backend
- Deploy: Automated deployment to staging/production
- Development: Auto-deploy on feature branch push
- Staging: Auto-deploy on main branch merge
- Production: Manual approval required
- Unit Tests: Jest + Testing Library
- Integration Tests: Supertest for API testing
- E2E Tests: Playwright for browser automation
- Performance Tests: Lighthouse CI
# 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- Error Tracking: Sentry integration
- Performance: New Relic APM
- Uptime: Pingdom monitoring
- Logs: CloudWatch Logs
# Start monitoring dashboard
npm run monitor:start
# View application metrics
npm run monitor:metrics
# Check system health
npm run monitor:health# Build for production
npm run build
# Deploy to AWS
npm run deploy:production
# Verify deployment
npm run deploy:verifyInfrastructure is managed with Terraform:
# Initialize Terraform
cd infrastructure
terraform init
# Plan infrastructure changes
terraform plan
# Apply changes
terraform apply- 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
SAM LMS supports multiple African languages:
- English (default)
- Swahili
- Amharic
- Yoruba
- Zulu
Translation files are located in frontend/src/locales/.
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- TypeScript: Strict mode enabled
- ESLint: Airbnb configuration
- Prettier: Code formatting
- Conventional Commits: Commit message format
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
For security vulnerabilities, please review our Security Policy and report issues responsibly.
Licensed under the ISC License. See LICENSE for details.
- BetterAuth - Modern authentication for TypeScript
- Paystack - African payment infrastructure
- Africa's Talking - SMS and voice services
- Resend - Email for developers
- Amazon Web Services - Cloud infrastructure
- Factory CLI - Development automation platform
- Issues: Open a GitHub issue for bugs or feature requests
- Documentation: Check the docs/ directory for detailed guides
- Contact: Visit https://saml.co.za/ for more information
- Community: Join our Discord server for discussions
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/