System Manual - bounswe/bounswe2024group5 GitHub Wiki

System Manual for Quizzard: An English Learning Application


Overview

This manual provides instructions for deploying and running the Quizzard application. It covers local deployment for development, cloud deployment for production, and platform-specific deployment for mobile and web applications.


System Requirements

Server Requirements

  • CPU: 2+ cores
  • RAM: Minimum 4GB
  • Storage: 20GB+ available space
  • Operating System: Ubuntu 20.04+ or similar Linux distribution

Development Environment Requirements

  • Node.js 16.x or higher
  • npm 8.x or higher
  • pnpm 8.x or higher
  • Docker 20.x or higher
  • Docker Compose 2.x or higher

Mobile Development Requirements

  • Android Studio (for Android development)
  • Xcode 13+ (for iOS development, Mac only)
  • Android SDK 26 or higher
  • iOS 14.0 or higher
  • Expo CLI tools

Supported Browsers (Web Application)

  • Chrome 88+
  • Firefox 87+
  • Safari 14+
  • Edge 88+

Build and Deploy Instructions

Local Deployment

  1. Install Prerequisites

    • Ensure Git, Docker, and Docker Compose are installed on your machine.
  2. Clone the Repository

    git clone https://github.com/bounswe/bounswe2024group5.git
    cd bounswe2024group5
  3. Build and Run the Application

    docker compose up --build -d
  4. Access the Application Open a web browser and navigate to: http://localhost/

Cloud Deployment

  1. Set Up a Virtual Machine
    • Create a virtual machine on your preferred cloud provider. Ensure:
      • It has a public IP address.
      • HTTP port 80 is open in the firewall settings.
  2. Connect to the VM
    • Use SSH to access the VM. Install Git, Docker, and Docker Compose if not already installed.
  3. Clone the Repository
    git clone https://github.com/bounswe/bounswe2024group5.git
    cd bounswe2024group5
  4. Configure the Frontend
    • Update the IP address in frontend/src/App.tsx to the public IP address of your VM.
  5. Build and Deploy the Application
    docker compose up --build -d
  6. Access the Application
    • Open a web browser and navigate to: http://<VM-IP>/

Local Deployment for Mobile

  1. Install Dependencies

    npm install
    npm install expo
    npm update
  2. Start the App

    npm start
  3. Run on a Device or Emulator

    • Use the Expo Go app or connect your emulator to preview the application.

Local Deployment for Web

  1. Install Dependencies

    pnpm i
  2. Start the App

    pnpm run dev
  3. Access the Application

    • Open your browser and navigate to the provided local development URL.

Database Setup

  1. Database Configuration
    # Database initialization commands
    docker compose up -d database

Security Configurations

  1. SSL/TLS Setup
    • For production, configure HTTPS using Let's Encrypt or similar
    • Update nginx configuration accordingly
  2. Authentication
    • Configure JWT token expiration times

Monitoring and Maintenance

  1. Logging

    • Monitor logs using:
    docker-compose logs -f
  2. Backup Procedures

    # Database backup 
    docker exec -it <mysql-container-id>  mysqldump -u root -p quizzard > backup.sql

Common Issues and Troubleshooting

  1. Connection Issues
    • Check network connectivity
    • Verify port configurations
    • Ensure firewall rules are properly set
  2. Database Issues
    • Verify that the MySQL container is running
    • Check database credentials
    • Ensure sufficient disk space
  3. Mobile Build Issues
    • Clear npm cache: npm cache clean --force
    • Reset Expo cache: expo r -c
    • Verify Android/iOS development tools are properly installed

Disaster Recovery

  1. Backup Restoration

    # Restore database
    cat backup.sql | docker exec -it <mysql-container-id> mysql -u root -p quizzard
  2. System Recovery

    • Document steps to restore from catastrophic failure
    • Include data recovery procedures
    • List emergency contacts

Additional Notes

  • Error Handling:
    • If any errors occur during deployment, ensure all dependencies are correctly installed and the environment variables are properly configured.
  • Scaling:
    • Use orchestration tools like Kubernetes for scaling the application in a production environment.
⚠️ **GitHub.com Fallback** ⚠️