From dd70f1a1967007c2731f9cdf439cbc1b493889e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolas=20G=C3=B6rlitz?= Date: Mon, 20 May 2024 18:40:25 +0200 Subject: [PATCH] update readme (finally :)) --- README.md | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 85c26e4..785e082 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,38 @@ -# Trainingcenter-Frontend +# Trainingcenter -The trainingcenter-frontend project contains the frontend code for the VATSIM Germany ATC Training Center. Built using React, this project focuses on providing an interactive user interface for both trainees and mentors alike. Data is exchanged with the underlying SQL database using the Express.js based [trainingcenter-backend](https://github.com/vatger/trainingcenter-backend) project. +The trainingcenter project contains the code for the VATSIM Germany ATC Training Center. + +Built using React & Express.js, this project focuses on providing an interactive user interface for both trainees and mentors alike. ## Contact -| Name | Responsible for | Contact | -|:------------:|:---------------:|:-------------------------------------------------:| -| Nikolas G. - 1373921 | * | `git@vatger.de` | +| Name | Responsible for | Contact | +|:--------------------:|:---------------:|:---------------:| +| Nikolas G. - 1373921 | * | `git@vatger.de` | ## Prerequisites -- **Node.js** (https://nodejs.org/en) +- **Node.js** (https://nodejs.org/en) - (`>= 9.8.1`, other versions may work, but are not guaranteed) +- **SQL Server** (e.g. https://mariadb.org/) ## Running the Application -1. Run `npm install` -4. Run `npm run dev` +Firstly, you will need to install the required packages by running `npm install` (we will likely switch to bun or pnpm in the future though...). + +You will also need to have an SQL Database (MariaDB for example) setup and running. Configure the `.env` file located within the `./backend` directory to reflect your local environment. +You can use the `.env.example` file located in the same directory as a starting point. + +### First Run +During the first run, you will likely want to both migrate and seed the database. For this, use the following commands (whilst in the root directory): +1. `npm run seq db:migrate` +2. `npm run seq db:seed:all` (optionally for only a specific seeder: `npm run seq db:seed -- --seed ./path/to/seeder.js`) + +### Starting the Frontend & Backend + +1. To run the Frontend: Run `npm run frontend:dev` +2. To run the Backend: Run `npm run backend:dev` + +## Note to Webstorm users +Due to Webstorm's opinion-ness, throwing within a try block - and hence catching the exception locally is discouraged. +We believe that this flow makes the code more consistent and therefore more readable. This is as usual, however, a personal opinion. + +To disable this behaviour, head to: `Settings | Editor | Inspections` and turn off: `JavaScript and TypeScript > Try statement issues > Exception used for local control-flow`. \ No newline at end of file