# OSRM Backend using FastApi
## Overview
OSRM Mali Backend is a FastAPI-based web service that provides routing information for Mali using OpenStreetMap data and the OSRM (Open Source Routing Machine) engine. This service offers an API endpoint for calculating routes between two points in Mali, returning distance and duration information.
## Features
- Route calculation between two geographical points in Mali
- Distance and duration estimation for routes
- API key authentication for secure access
- Dockerized application for easy deployment
- Integration with OSRM for efficient routing calculations
## Prerequisites
- AlmaLinux (or compatible RHEL-based distribution)
- Docker
- Docker Compose (optional, for easier management)
- Mali OSM data (automatically downloaded in the Dockerfile)
## Setup
### 1. Install Docker on AlmaLinux
First, update your system:
```bash
sudo dnf update -y
```
Install required packages:
```bash
sudo dnf install -y yum-utils device-mapper-persistent-data lvm2
```
Add the Docker repository:
```bash
sudo dnf config-manager --add-repo
download.docker.com
```
Install Docker:
```bash
sudo dnf install -y docker-ce docker-ce-cli containerd.io
```
Start and enable Docker service:
```bash
sudo systemctl start docker
sudo systemctl enable docker
```
Add your user to the docker group (optional, for running Docker without sudo):
```bash
sudo usermod -aG docker $USER
```
Log out and log back in for the group changes to take effect.
### 2. Download the project files
use wget to download the project files:
```bash
wget
github.com
unzip main.zip
cd osrm-mali-backend-main
```
### 3. Configure the environment
Create a `.env` file in the root directory with the following content (not required if the `.env` file already exists in the repo):
```
OSRM_URL=
localhost
LOG_LEVEL=INFO
API_KEY=your_secret_api_key_here
```
Replace `you …