System Manual - bounswe/bounswe2024group5 GitHub Wiki
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.
- CPU: 2+ cores
- RAM: Minimum 4GB
- Storage: 20GB+ available space
- Operating System: Ubuntu 20.04+ or similar Linux distribution
- 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
- 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
- Chrome 88+
- Firefox 87+
- Safari 14+
- Edge 88+
-
Install Prerequisites
- Ensure Git, Docker, and Docker Compose are installed on your machine.
-
Clone the Repository
git clone https://github.com/bounswe/bounswe2024group5.git cd bounswe2024group5
-
Build and Run the Application
docker compose up --build -d
-
Access the Application Open a web browser and navigate to:
http://localhost/
- 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.
- Create a virtual machine on your preferred cloud provider. Ensure:
- Connect to the VM
- Use SSH to access the VM. Install Git, Docker, and Docker Compose if not already installed.
- Clone the Repository
git clone https://github.com/bounswe/bounswe2024group5.git cd bounswe2024group5
- Configure the Frontend
- Update the IP address in frontend/src/App.tsx to the public IP address of your VM.
- Build and Deploy the Application
docker compose up --build -d
- Access the Application
- Open a web browser and navigate to:
http://<VM-IP>/
- Open a web browser and navigate to:
-
Install Dependencies
npm install npm install expo npm update
-
Start the App
npm start
-
Run on a Device or Emulator
- Use the Expo Go app or connect your emulator to preview the application.
-
Install Dependencies
pnpm i
-
Start the App
pnpm run dev
-
Access the Application
- Open your browser and navigate to the provided local development URL.
-
Database Configuration
# Database initialization commands docker compose up -d database
- SSL/TLS Setup
- For production, configure HTTPS using Let's Encrypt or similar
- Update nginx configuration accordingly
- Authentication
- Configure JWT token expiration times
-
Logging
- Monitor logs using:
docker-compose logs -f
-
Backup Procedures
# Database backup docker exec -it <mysql-container-id> mysqldump -u root -p quizzard > backup.sql
- Connection Issues
- Check network connectivity
- Verify port configurations
- Ensure firewall rules are properly set
- Database Issues
- Verify that the MySQL container is running
- Check database credentials
- Ensure sufficient disk space
- Mobile Build Issues
- Clear npm cache:
npm cache clean --force
- Reset Expo cache:
expo r -c
- Verify Android/iOS development tools are properly installed
- Clear npm cache:
-
Backup Restoration
# Restore database cat backup.sql | docker exec -it <mysql-container-id> mysql -u root -p quizzard
-
System Recovery
- Document steps to restore from catastrophic failure
- Include data recovery procedures
- List emergency contacts
- 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.