An open API service indexing awesome lists of open source software.

https://github.com/zayminmaw/detrack-api-clone

Simplified Detrack API clone with FastAPI and Postgres database.
https://github.com/zayminmaw/detrack-api-clone

delivery-api python

Last synced: 10 months ago
JSON representation

Simplified Detrack API clone with FastAPI and Postgres database.

Awesome Lists containing this project

README

          

### Development setup

First create a directory then create a virtual environment in it (PLEASE USE VIRTUAL ENVIRONMENT).

```shell
python3 -m venv
```

To activate your virtual environment go to

#### On Window :

```shell
\Scripts\activate.bat
```

#### On Unix or MacOs :

```shell
source /bin/activate
```

Finally git clone the repository.

```shell
git clone https://github.com/zay467/detrack-api-clone.git
```

Then go into the cloned folder and install requirements (we will be continue working on this directory). While installing setup the ".env" file.

```shell
pip install -r requirements.txt
```

Migrate your models into database.

```shell
# to create or update the models to database
alembic upgrade head
```

Now let's start your server.

```shell
uvicorn main:app --reload
```

#### Useful commands

if you installed new packages during development, don't forget to update the requirement.

```shell
pip freeze > requirements.txt
```

This command is for auto generating the migration files if you add new models or make changes to your existing model. Then don't forget to mirgrate the changes.

```shell
alembic revision --autogenerate -m "init"
```