REST API for processing data from external REST API (Flexibee) and forwards them processed further to frontend and backend app
For get this code from repository to your local pc you can use this steps:
Fork this repository to your Github account or clone this repository to local PC.
git clone https://github.com/BMWdejf/FastAPI-backend.git
Open folder with code in IDE (PyCharm or VSC)
Open terminal window and run this commands:
python -m venv venv
or
python3 -m venv venv
for user which you have MacOs or Linux next step is
source venv/bin/activate
for user which you have Windows
.\venv\Scripts\activate
You must see "(venv)" in leftside your terminal
For next step it is important install packages from requirements.txt
pip install -r requirements.txt
after finishing will be testing runing code on localhost server
hypercorn app.core.main:app --reload
if all work correctly open link in your browser
you must get
{"message":"FastAPI works!"}
if the first tine deploying on Railway.app you need install Railway CLI to your PC.
For more informations following this link Installing the Railway CLI
In a Terminal, enter the following command:
brew install railway
or npm for Windows
npm i -g @railway/cli
if you want to know what commands you can use, enter the following commnad in terminal
railway --help
the first step is to log in to your Railway account
railway login
follow the instructions until successful login.
now you must create a new project
railway init -n fastapi-backend-3
now is last step for deploying your first app to Railway.app
railway up
in terminal you must see:
[2024-05-17 18:12:48 +0000] [12] [INFO] Running on http://[::]:7186 (CTRL + C to quit)
Now is really the last step. You must generate your public URL address in your app. Click on your app in Railway dashboard, go to section "Settings" now find section "Networking" and click on the button "Generate domain". After few times you open the generated link in your browser.