Skip to content

This repository contains Group 12's work for CMPE 352 - Spring 2024.

Notifications You must be signed in to change notification settings

bounswe/bounswe2024group12

Repository files navigation

To see the app: https://buchessocial.online/

Setup Instructions

Backend

This project contains the backend for a Django application using MySQL as the database.

Prerequisites

Before running this project, make sure you have the following installed on your machine:

Steps to Run the Backend

You can reach documentation at: Swagger-UI, Json-File, Yaml-file(you can view at swaggerhub

  1. Clone the repository:

    git clone https://github.com/bounswe/bounswe2024group12.git
  2. Navigate to the backend folder:

    cd app/backend
  3. Build and start the Docker containers in the background:

    docker-compose up --build -d

    This will start two services:

    • web: The Django backend service running on port 8000.
    • db: The MySQL database service running on port 3306.

    Important Note! Due to we are inserting 28K games and bunch of data into database, even if we add an interval before backend start. Backend may failed at the build phase( Due to db is not started yet) We solved this issue by adding start.sh script but we are giving some permission during this phase etc. So, that if anything wrongs about permission please reach out.

  4. View logs to monitor the process:

    To view the logs for any service, run:

    docker-compose logs
  5. Apply the database migrations:

    docker-compose exec web python manage.py migrate
  6. Access the application:

    • The application will be running at: http://localhost:8000
    • The Django admin panel will be available at: http://localhost:8000/admin
  7. Stop the containers:

    To stop the containers, run:

    docker-compose down
  8. Show the docker containers:

    To show the docker containers, run:

    docker ps

Testing the Backend

To run all tests for the backend, execute the following command at /backend :

docker-compose exec web bash test.sh

Database Initialization (IMPORTANT)

Due to we put a sql initiator no need to use Commands, you can run by docker-compose scrit at 3rd step OLD We scraped chess games from https://www.pgnmentor.com/ and there is a function at "/app/backend/v1/apps/games/management/commands/import_games.py" to import json file to database. Due to file size is too big (~300MB) we will send it if exact database table is needed.

Frontend

This project contains the frontend for a React application.

Prerequisites

Before running this project, make sure you have the following installed on your machine:

  • Docker
  • Git

Steps to Run the Frontend

  1. Clone the repository:

    git clone https://github.com/bounswe/bounswe2024group12.git
    
  2. Navigate to the frontend folder:

    cd bounswe2024group12/frontend
    
  3. Build the Docker image: First, ensure Docker is running. Then, build the Docker image for the React frontend:

    docker build -t frontend-app .
    
  4. Run the Docker container: After building the Docker image, run the container to start the frontend:

    docker run -p 3000:3000 frontend-app
    
  5. Access the application: Once the container is running, you can access the application in your browser at:

http://localhost:3000

Mobile App

This project contains the mobile app for an Android application.

Prerequisites

Before running this project, make sure you have the following installed on your machine:

  • Docker
  • Git

Steps to Run Mobile

  1. Clone the repository:

    git clone https://github.com/bounswe/bounswe2024group12.git
    
  2. Navigate to the mobile folder:

    cd project/Mobile
    
  3. Install dependencies

    npm install
  4. Start the app

    npx expo start

In the output, you'll find options to open the app in a