tutorviz

TutoriAI

A comprehensive classroom management system with AI-powered features.

🚀 Quick Start with Docker

The easiest way to run TutoriAI is using Docker Compose, which will set up all services (frontend, backend, and database) automatically.

Prerequisites

# Start all services in development mode
./docker.sh start dev

# Or manually with docker-compose
docker-compose -f docker-compose.dev.yml up -d

Services will be available at:

Production Mode

# Start all services in production mode
./docker.sh start prod

# Or manually with docker-compose
docker-compose up -d

Docker Management Commands

# View all available commands
./docker.sh help

# Start services
./docker.sh start [dev|prod]

# Stop services
./docker.sh stop [dev|prod]

# Restart services
./docker.sh restart [dev|prod]

# View logs
./docker.sh logs [dev|prod] [service_name]

# Build services
./docker.sh build [dev|prod]

# Check service status
./docker.sh status [dev|prod]

# Clean up all Docker resources
./docker.sh cleanup

Development Features

🛠️ Manual Setup (Alternative)

If you prefer not to use Docker, you can set up the services manually:

Backend Setup

cd backend
npm install
npm run dev

Frontend Setup

cd frontend
npm install
npm start

Database Setup

  1. Install PostgreSQL
  2. Create a database named tutoriai
  3. Run the initialization scripts in backend/docker/postgres/

📁 Project Structure

TutoriAI/
├── frontend/                 # React TypeScript application
├── backend/                  # Node.js Express API
├── docker/                   # Docker configurations
│   ├── postgres/            # Database initialization scripts
│   └── Dockerfile           # Backend container
├── docker-compose.yml        # Production Docker setup
├── docker-compose.dev.yml    # Development Docker setup
├── Dockerfile               # Frontend container
├── nginx.conf               # Nginx configuration
├── docker.sh                # Docker management script
└── README.md                # This file

🔧 Configuration

Environment Variables

The following environment variables can be configured:

Backend:

Frontend:

Database

The PostgreSQL database is automatically initialized with:

🚀 Deployment

Production Deployment

  1. Build the production images:
    ./docker.sh build prod
    
  2. Start production services:
    ./docker.sh start prod
    
  3. Configure your reverse proxy (nginx, Apache) to point to the frontend container

Environment-Specific Configurations

🐛 Troubleshooting

Common Issues

  1. Port conflicts: Ensure ports 3000, 5001, and 5432 are available
  2. Permission errors: Make sure Docker has proper permissions
  3. Database connection: Wait for PostgreSQL to be healthy before starting backend

Logs and Debugging

# View all service logs
./docker.sh logs dev

# View specific service logs
./docker.sh logs dev backend

# Check service status
./docker.sh status dev

Reset Everything

# Clean up all Docker resources and start fresh
./docker.sh cleanup
./docker.sh start dev

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with Docker: ./docker.sh start dev
  5. Submit a pull request

📄 License

This project is licensed under the MIT License.


For more detailed information about specific features, see the docs/ directory.