Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
profetia committed Dec 3, 2022
1 parent 3281c60 commit f3b3891
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@ dmypy.json
*.csv
*dump

*.dump
*.dump

/postgres/data
32 changes: 31 additions & 1 deletion README.md
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/).
13 changes: 13 additions & 0 deletions docker-compose.yml
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

0 comments on commit f3b3891

Please sign in to comment.