Skip to content

Commit

Permalink
πŸ“ Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
agn-7 authored Nov 9, 2023
1 parent 94094d3 commit 325297f
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# ifsguid-backend
Simple AI Chat Application
[![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://https://docker.com/)
[![CI](https://github.com/agn-7/ifsguid-backend/workflows/build/badge.svg)](https://github.com/agn-7/ifsguid-backend/actions/workflows/github-actions.yml)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

# IFSGuid Backend
Simple AI Chat Application Powered by gpt4free on top of FastAPI

## Setup
It contains two generic entity models Interaction and Message.
We store all of the data in the Postgres database.
The interaction with the database is done with the [SQLAlchemy](https://www.sqlalchemy.org/) library, and the simple GET and POST endpoints are exposed via the API, which is written with the [FastAPI](https://fastapi.tiangolo.com/) framework.

To manage dependencies, we use [poetry](https://python-poetry.org/).

To launch an API instance, you should:
1. Have a running Postgres instance, e.g. in a container. The application will read the [.env](/.env) file to access the database.
2. Create a virtual environment and install the dependencies in it. You can run `poetry install` for that.
3. Use [start_app.sh](/start_app.sh) to run the server. By default, it will bind to http://localhost:8000.
4. An automatically generated documentation can be found at http://localhost:8000/docs. The endpoints are accessible at http://localhost:8000/api/<endpoint_name>.

You can also run the project via `docker-compose` (i.e. `docker compose up -d`) on port `80` in which you would need the `.docker.env` containing the following variable to create the database:

```
SQLALCHEMY_DATABASE_URI=postgresql://<username>:<password>@ifsguid_db/<db-name>
```


0 comments on commit 325297f

Please sign in to comment.