Skip to content

Repository files navigation

LearnCo - Simulated Business Web Platform for University Teaching

edtech docker javascript nextjs nodejs postgresql simulation strapi university web-app

Simulate. Learn. Succeed.

LearnCo is an open-source, self-hosted platform that creates realistic simulated business environments for university education. It bridges the gap between theoretical knowledge and practical application by providing students with hands-on experience in a controlled, realistic corporate setting.

📖 Project Description

LearnCo transforms traditional university teaching by offering:

  • Authentic Business Simulation: Students interact with a fully-functional corporate website, complete with public-facing pages and secure internal systems
  • AI-Powered Interactions: Engage with simulated employees through intelligent chatbots, each with distinct personalities and roles
  • Multi-Disciplinary Learning: Supports diverse courses from web development to cybersecurity, all using the same realistic business context
  • Scenario-Based Education: Instructors can create custom scenarios tailored to specific learning objectives
  • Safe Learning Environment: Students can explore, make mistakes, and learn without real-world consequences

Designed specifically for resource-conscious university departments, LearnCo uses 100% open-source technologies and can be self-hosted on modest hardware or cloud infrastructure.

🚀 Features

  • Public Website: Simulated company website with editable content
  • Password-Protected Areas: Secure access to documents and resources
  • AI-Powered Chatbots: Simulated employees with different personas
  • Appointment Scheduling: Realistic meeting scheduling with chatbots
  • Document Management: Support for various file types with access control
  • Scenario Management: Create and manage different teaching scenarios
  • Time-Based Content: Materials that unlock based on schedule

🛠️ Technology Stack

  • Frontend: Next.js 14 with TypeScript, Tailwind CSS
  • CMS: Strapi 4 (headless CMS)
  • Backend: Node.js with Express
  • Database: PostgreSQL 15
  • Cache: Redis 7
  • Storage: MinIO (S3-compatible)
  • Reverse Proxy: Nginx
  • LLM: Ollama (self-hosted) or OpenRouter API
  • Container: Docker & Docker Compose

📋 Prerequisites

  • Docker and Docker Compose installed
  • Node.js 18+ (for local development)
  • 8GB RAM minimum (16GB recommended for running Ollama)
  • 20GB free disk space

🚀 Quick Start

  1. Clone the repository

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

    npm run setup:env

    This will create a .env file with secure random values. Review and update as needed.

  3. Start the services

    docker-compose up -d
  4. Access the applications

🔧 Configuration

Environment Variables

Key environment variables in .env:

  • POSTGRES_*: Database configuration
  • MINIO_*: Object storage settings
  • JWT_SECRET: Authentication secrets
  • LLM_PROVIDER: Choose between 'ollama' or 'openrouter'
  • BUSINESS_HOURS_*: Configure chatbot availability

Initial Setup

  1. Create Strapi Admin User

  2. Configure Content Types

    • Set up public page content types
    • Configure document categories
    • Create user roles and permissions
  3. Set Up MinIO Buckets

📁 Project Structure

learnco/
├── frontend/          # Next.js frontend application
├── backend/           # Express API server
├── cms/              # Strapi CMS
├── database/         # PostgreSQL init scripts
├── nginx/            # Nginx configuration
├── storage/          # MinIO data (git-ignored)
├── data/             # Docker volumes (git-ignored)
├── scripts/          # Utility scripts
├── docker-compose.yml
└── .env.example

🧑‍💻 Development

Local Development

# Start development environment
npm run dev

# Run specific service
docker-compose up frontend -d

# View logs
docker-compose logs -f [service-name]

# Stop all services
docker-compose down

Adding New Features

  1. New API Endpoint

    • Add route in backend/src/routes/
    • Create controller in backend/src/controllers/
    • Update API documentation
  2. New Frontend Page

    • Create page in frontend/src/pages/
    • Add components in frontend/src/components/
    • Update navigation
  3. New Chatbot Persona

    • Add to database seed file
    • Configure in Strapi
    • Set availability schedule

🔒 Security Considerations

  • All secrets are auto-generated during setup
  • Passwords are hashed using bcrypt
  • JWT tokens for authentication
  • Role-based access control (RBAC)
  • Document access logging
  • Rate limiting on API endpoints

🐛 Troubleshooting

Common Issues

  1. Port conflicts

    • Check if ports 80, 3000, 8000, 1337, 5432 are in use
    • Modify port mappings in docker-compose.yml
  2. Database connection errors

    • Ensure PostgreSQL container is healthy
    • Check database credentials in .env
  3. Storage issues

    • Verify MinIO is running: docker-compose ps minio
    • Check bucket permissions

Logs

# View all logs
docker-compose logs

# View specific service logs
docker-compose logs -f backend

# Check container status
docker-compose ps

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📄 License

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

🙏 Acknowledgments

  • Built for university teaching and learning
  • Designed to be intentionally vulnerable for security courses
  • Not intended for production use

📞 Support

For issues and questions:

  • Create an issue on GitHub
  • Contact the development team
  • Check the documentation wiki

About

LearnCo provides a simulated business environment web platform for university students to practice real-world business scenarios, built with Next.js, Node.js, PostgreSQL, and Strapi.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages