User and System Manual - bounswe/bounswe2023group1 GitHub Wiki

User Manual

  • User creates an account via providing email&password to the system.
  • System grants default "Victim" role to the user.
  • User can login with his/her credentials to the system.
  • The user can access services for which he has the required role.

System Manual

Prerequisites

  • JDK 17.0.2
  • Maven 3.8.6
  • Intellij or Eclipse IDE

Config Directory Structure - Resq

Application gets the actual path from resq.appdir property and checks for resq directory under that path.

Under main directory structure is:

  • conf
    • appparam.txt: application configuration items are located under this file (web service url, username and pass etc.)
    • logConf.xml: log configuration file.
  • log: Application writes all logs under this directory

Config Directory Structure - Annotation

Application gets the actual path from anno.appdir property and checks for anno directory under that path.

Under main directory structure is:

  • conf
    • appparam.txt: application configuration items are located under this file (web service url, username and pass etc.)
    • logConf.xml: log configuration file.
  • log: Application writes all logs under this directory

Database Connections

Database Type Production Test
PostgreSQL schema: resqdb schema: resqdb
PostgreSQL schema: annotationdb schema: annotationdb

Project Specific Information

Resq

Application context root is /resq/api/v1/. You can reach the application via
https://localhost:8081/resq/api/v1/. To reach the API documentation:
https://localhost:8081/resq/api/v1/swagger-ui.html

Production API Documentation:
https://api.resq.org.tr/resq/api/v1/swagger-ui/index.html

Production URL: https://api.resq.org.tr/resq/api/v1

Annotation

Application context root is /. You can reach the application via
https://localhost:8083/. To reach the API documentation:
https://localhost:8083/swagger-ui.html

Production API Documentation:
https://annotation.resq.org.tr/swagger-ui/index.html

To deploy the backend of the application to the EC2 server, follow the instructions below

  • First, clone the repository with command "git clone https://github.com/bounswe/bounswe2023group1"
  • Place the config folders to the relevant places given below:
    • Place project_env and project_env_prod into the folder bounswe2023group1\resq\backend\resq
    • Place anno_env and anno_env_prod into the folder bounswe2023group1\resq\backend\annotation
    • Place deploy.sh, annoDeploy.sh and aws-key.pem to the outer folder which containts bounswe2023group1.
    • deploy.sh is a script file which builds the docker image of the resq service, pushes it to the remote repository, sshs into ec2, pulls the latest image, and runs it in the docker container of the ec2 instance.
    • annoDeploy.sh is a script file which builds the docker image of the annotation service, pushes it to the remote repository, sshs into ec2, pulls the latest image, and runs it in the docker container of the ec2 instance.
    • Note that, if IP addresses of ec2 instances change, you need to update the ssh command which includes ec2-user@<IP_ADDRESS>. Be careful that in case of ec2 instance stop & starts, IP addresses automatically change.

To access logs of the resq services in docker container of the ec2 instance

  • ssh -i ./aws-key.pem ec2-user@<IP_ADDRESS>
  • sudo docker ps
  • sudo docker exec -it <container_name_or_id> /bin/bash
  • cd ./config/resq/log
  • tail -f resq (OR cat resq)

To access logs of the annotation services in docker container of the ec2 instance

  • ssh -i ./aws-key.pem ec2-user@<IP_ADDRESS>
  • sudo docker ps
  • sudo docker exec -it <container_name_or_id> /bin/bash
  • cd ./config/anno/log
  • tail -f anno (OR cat anno)

To run both the backend and frontend apps on local machine

  • cd bounswe2023group1\resq\backend
  • run 'docker-compose up'
  • Note that, when you are running the application on local machine, you need to update the API_BASE_URL located in AppService.js of the frontend app so that it sends the requests to the locally running backend: const API_BASE_URL = 'http://localhost:8081'
⚠️ **GitHub.com Fallback** ⚠️