Skip to content

strachob/LargeScaleComputation

 
 

Repository files navigation

Getting Started

Prerequisities

  • Python 3.*
  • PostgresSQL
  • Nodejs This project was bootstrapped with Create React App.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You can just run docker-compose up -d --build in main folder to have all setup ready to development. Also you can edit and live view your changes in both front and backend apps.

In order to run this application, you need to have npm (Node Package Manager) installed. It comes with Node.js.

Setup FrontEnd

In the Pop-Grupa-A-Frontend project directory, you can run:

npm install

Installs required dependencies for starting up the project. (it might take a while, so wait patiently)

After installing all dependencies, run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Setup Backend

I advise to go through tutorial linked below, which I based flask API.

Python guide I followed for creating basic flask api structure.

In the Pop-Grupa-A-Backend project directory, you can run:

pip install -r requirements.txt

Installs required dependencies for starting up the project. (it might take a while, so wait patiently)

Next, when you have your local postgres database balticlsc created with user admin and password 123456 run:

python manage.py db upgrade -- applies migration to database

After installing all dependencies, run:

python manage.py run

Runs the app in the development mode.
Open http://localhost:5000 to view it in the browser.

API will reload if you make edits.
You will also see any lint errors in the console.

Browse docker database with pgAdmin4 manager

If you have pgadmin4 installed on your machine, launch it and create a new server with information from docker-compose.yml file.

  • Port: 5433
  • IP: 127.0.0.1
  • Login: admin
  • password: 123456 Then you will be able to browse database through pgadmin4 manager.

Docker

Docker for Windows Installation
To create and run docker images follow instruction below:

  1. Launch Powershell IDE or different console
  2. Navigate to directory containing 2 projects with docker-compose.yml file
  3. In console run docker-compose up -d --build - it will build images and spin up the containers. They will be accessed on localhost:3000 and localhost:5000. Any changes made in both projects will be automatically refreshed in containers (hot-reloading)

Note:

Migration to database in entrypoint.sh might not be applied due to windows line endings. To fix that, you may have to go inside API container and run the script automatically.

  • docker exec -it backend-pop sh - this command moves you inside the container
  • python manage.py db upgrade - runs migration to postgres database

Note2:

If you want to browse docker-created database, run those commands:

  • docker exec -it postgres sh
  • psql -U admin balticlsc

Build status

How to link pull request in GitHub to Azure Devops Board
Board Status

About

Project for Software Design class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 54.5%
  • JavaScript 41.5%
  • Dockerfile 1.9%
  • HTML 1.2%
  • CSS 0.5%
  • Mako 0.3%
  • Shell 0.1%