1
0
Fork 0
mirror of https://github.com/dancojocaru2000/foxbank.git synced 2025-02-21 17:39:34 +02:00
Project, Web Technologies, Year 3, Semester 1
Find a file
2022-01-04 10:27:41 +02:00
.github/workflows Merge pull request #4 from dancojocaru2000/Frontend 2021-12-07 09:57:48 +02:00
.vscode Add root directory to VS Code workspace 2021-11-30 14:06:41 +02:00
client Finished frontend implementation with api 2022-01-04 01:22:27 +02:00
server Add "drop table if exists" for exchange table 2022-01-04 10:05:16 +02:00
FoxBank.code-workspace Implemented initial account support 2021-12-29 10:48:42 +02:00
README.md Added links in README 2022-01-04 10:27:41 +02:00

FoxBank

Project, Web Technologies, Year 3, Semester 1

How to build

The design is modular: the client and the server can be hosted independently. This allows the client to be hosted on a static web host (for example GitHub Pages), and for the server to be hosted on another service. The client must know the address where the server is located.

Client

Make sure to change the baseURL in client/src/api.js. The baseURL should point to the address of the server.

const baseURL = "https://foxbank-api.extras.dcdevelop.xyz";
// or
const baseURL = "http://localhost:5000";

After changing the baseURL, build using the following commands:

cd client
npm install     # or yarn
npm run build   # or yarn run build

After running those commands, the client/public folder contains the client files to be deployed on the server.

Server

The best way to deploy the server is using Docker:

cd server
docker build -t foxbank .

And then run the server using:

PORT=5000       # set port here
DATA_DIR=./data # set directory for server data here
docker run -p $PORT:5000 -v $DATA_DIR:/app/data foxbank

In order to ease the deployment of the server, Docker Compose can be used:

cd server
export PORT=5000 # set port here
docker-compose up -d

Check the server/run.sh script for further reference.


If you don't want to use Docker, use pipenv to install the Python dependencies and run the project manually:

cd server
pipenv install
PORT=5000 # set port here
pipenv run gunicorn -b 0.0.0.0:$PORT server:app