This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,4 +136,6 @@ dmypy.json | |
*.csv | ||
*dump | ||
|
||
*.dump | ||
*.dump | ||
|
||
/postgres/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
# Horras Backend: Backend of Horras, the Haikou Online Ride-hailing Records Analysis System | ||
|
||
This is the backend of Horras, the Haikou Online Ride-hailing Records Analysis System. It is a Fastapi project with a PostgreSQL database. | ||
See the frontend project [here](https://github.com/yanglinshu/horras). | ||
See the frontend project [here](https://github.com/yanglinshu/horras). | ||
|
||
## Dependencies | ||
Horras Backend is built on top of the following dependencies: | ||
- [Fastapi](https://fastapi.tiangolo.com/) | ||
- [PostgreSQL](https://www.postgresql.org/) | ||
- [Prisma](https://www.prisma.io/) | ||
- [Docker](https://www.docker.com/) | ||
|
||
## Installation | ||
Horras Backend runs its database in a Docker container. To install the database, run the following command: | ||
```bash | ||
docker-compose up -d | ||
``` | ||
|
||
To install the backend, run the following commands: | ||
```bash | ||
pip install -r requirements.txt | ||
|
||
prisma db push | ||
|
||
uvicorn horras_backend.main:app --host 0.0.0.0 | ||
``` | ||
|
||
For compatibility reasons, running the backend in a Docker container is not recommended. | ||
|
||
## Usage | ||
The backend is a Fastapi project. To access the API documentation, go to `http://localhost:8000/docs`. | ||
|
||
## License | ||
This repository is licensed under the [MIT License](https://choosealicense.com/licenses/mit/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '2' | ||
services: | ||
postgres: | ||
build: | ||
context: ./postgres | ||
dockerfile: Dockerfile | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- ./postgres/data:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=dummy123 |