🌱 Prod Environment | 🔗 URL |
---|---|
🖥️ Swagger Doc | /docs |
docker run --name mariadb-dev \
-v /path/on/your/system:/var/lib/mysql:Z \
-e MARIADB_DATABASE=db_name \
-e MARIADB_ROOT_PASSWORD=strong-root-password \
-p 3306:3306 \
-d mariadb:latest
If you are on Windows and don't have docker installed on your system, you can download and install MariaDB from here (MariaDB and MySQL are more or less the same thing)
You'll need MariaDB/MySQL for this API to work.Follow the steps mentioned above to quickly spin up a MariaDB/MySQL instance using docker, either on your local machine or some remote machine. If you don't want to use Docker, follow the MariaDB/MySQL documentation then.
You'll also need to make a copy of
.env
file with proper details (.env.example
is given). Follow the below steps next:
- Use Git Bash on Windows (avoid using
cmd
orpowershell
) Better if you use WSLcd server
- Create & activate python virtual environment
- Linux 👉️
python3 -m venv .venv
- Windows or
conda
👉️python -m venv .venv
- Linux 👉️
source .venv/bin/activate
- Windows 👉️
source .venv/Scripts/activate
- Linux 👉️
- Install the requirements
pip install -r requirements.txt
- Run it using the shell script
sh run.sh
- To run the client
cd client
npm install
npm run dev
👉️ Then, follow the steps to deploy the ⚡️ FastAPI server
cd server
cp .env.example .env
- Make sure to edit the
.env
file with proper details sh deploy.sh
- Create and activate the environment as described above, install requirements
- Run the
pytest.sh
scriptcd server
sh pytest.sh
- The directory name has to be
tests
- The filename must start with
test_
- Example: Use name like
test_auth.py
to make tests forauth.py
endpoints
- Example: Use name like