Skip to content

Backend System Manual

Muhammed Enes Toptaş edited this page Jan 31, 2021 · 1 revision

System Manual

In this file, we'll walk you through on how you can get the backend and backend related services such as Postgresql Database and Elasticsearch running.

Requirements

  • Docker
  • Docker-Compose
  • Preferably a Linux distribution as the OS

Files required

The docker image of the backend application is stored in the file akademise.tar. Also since we will have 3 containters running in parallel, we will also need a docker-compose.yml. This YAML file can be found in the main directory of this repository. Database dump akademise.db is also required, if you want to restore the database.

How to deploy/run

  1. First change directory to the directory where you keep the file akademise.tar
  2. Run below command to import the image into your docker system
docker image load -i akademise.tar 
  1. Now head in to the directory where you keep the file docker-compose.yml
  2. Open up this file and have a look at line 26
  3. This url should be the url that other people will use to connect to this computer. So change this url accordingly. If you are not planning to expose the backend to outerworld, you might simply write localhost. We use this url to create the links to the static files in the project, such as profile pictures. For example if you provide www.example.com, a profile picture will reside in the url www.example.com/static/avatars/filename.png.
  4. Under database-service tab, you can see the username, password and the database name the project uses. DO NOT change these variables, these are preconfigured in the akademise image, and changing these settings here will cause the backend app not being able to connect to the database.
  5. After saving the file after changes, again head in to the directory of the file docker-compose.yml
  6. Now run below command to run the docker-compose
docker-compose up -d
  1. After docker does it's thing, we are done. You can reach the rest API on port 3000, the database on port 5432 and the elasticsearch client on port 9200

Restoring the database

The database is initially empty, to restore the database follow directions below:

  1. Run the below command to copy the dump into Postgresql container
docker cp akademise.db bounswe2020group6_database-service_1:/
  1. Then run the below command to enter the Postgresql container
docker exec -it bounswe2020group6_database-service_1 bash
  1. Make sure you are inside of the container
  2. Finally run below command inside the container to import the dump
psql akademise < akademise.db

🎓 Team Members

User Manuals

System Manuals

💻 Project

🗓 Meeting Notes 352

🗓 Meeting Notes 451

Milestones

📎 Assignments

🔍 Issue Labels

📞 Communication Plan

📝 Research

Project Plan

Brain Storms

Clone this wiki locally