anyway/backend/README.md
Helldragon67 d0e837377b
All checks were successful
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m12s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 14s
Update backend/README.md
2024-11-05 14:45:47 +00:00

53 lines
1.8 KiB
Markdown

# Backend
This repository contains the backend code for the application. It utilizes **FastAPI** to quickly create a RESTful API that exposes the endpoints of the route optimizer.
## Getting Started
### Directory Structure
- The code for the Python application is located in the `src` directory.
- Package management is handled with **pipenv**, and the dependencies are listed in the `Pipfile`.
- Since the application is designed to be deployed in a container, the `Dockerfile` is provided to build the image.
### Setting Up the Development Environment
To set up your development environment using **pipenv**, follow these steps:
1. Install `pipenv` on your machine by running:
```bash
sudo apt install pipenv
```
2. Create and activate a virtual environment:
```bash
cd backend/
pipenv shell
```
3. Install the dependencies listed in the `Pipfile`:
```bash
pipenv install
```
4. The virtual environment will be created under:
```bash
~/.local/share/virtualenvs/...
```
5. (Optional) To keep up with changes in the virtual environment, you need to update the required packages if changes occur :
```bash
pipenv install " to install required normal packages
pipenv install --dev # to install required dev packages
```
### Deployment
To deploy the backend docker container, we use kubernetes. Modifications to the backend are automatically pushed to a two-stage environment through the CI pipeline. See [deployment/README](deployment/README.md] for further information.
The deployment configuration is included as a submodule in the `deployment` directory. The standalone repository is under [https://git.kluster.moll.re/anydev/anyway-backend-deployment/](https://git.kluster.moll.re/anydev/anyway-backend-deployment/).
## Development
TBD