This project consists of a corporate system for aviation schools.
This project requires python3. You can find a installation guide and integration with VS code on this link
It is important to create a virtual environment, that isolates the project's dependencies. To do this, we will use the built-in command of python 3:
python -m venv venv
where the last venv is the folder's name where the virtual enviroment configuration will exist.
Now activate the virtual environment:
venv\Scripts\activate
The front-end is built using react and it is located at client folder. In order to setup the front, do:
cd client
npm install # to install all node dependecies
To install dependencies necessary for the api project, do:
pip install -r requirements.txt
you can run the project with the following commands.
FrontEnd:
cd client && npm start
Backend:
cd src && python app.py
If you use vscode, you can just Run Build Task (Ctrl + Shift + B) to build and run the backend and the frontend at the same time.
The Frontend will be running on http://localhost:3000/. To see more commands for testing e deploying the frontend, see the README.md on the client folder
The backend api will be running on http://localhost:8888/api root. If you go to this socket, you can see a swagger documentation for the api, that allows you to see the documentation for all endpoints and test which one of them.
You can test the endpoints using a rest API software of your choice or even via console through the curl. Example:
curl http://127.0.0.1:5000/api/instructor
Using your local backend to receive Client Calls
Currently, the client source is calling the API through the following link: https://cors-anywhere.herokuapp.com/http://ec2-18-212-165-41.compute-1.amazonaws.com/api
This is the url from our backend deploy on AWS. We don't assure that this server will be running at the time you are testing so we highly recommend that you change the api call to your local backend http://localhost:8888/api
To do this simply replace all calls to the backend on the client source.
src
├── api # rest api framework module.
| ├── endpoinsts # endpoints splitted by context.
| └── api.py # api information
├── application # UseCases module.
├── common # Common code that is used by all modules
├── core # module with all the business logic, entity (domain) models.
├── persistance # All persistance related stuff goes here.
├── presentation # The React frontend goes here.
├── app.py # the api app will start from here.