ans123's picture
Initial upload from Colab
ef1ad9e verified
# Miralabs Backend
## Overview
Miralabs Backend is a comprehensive back-end system that supports various services for the Miralabs platform. It includes services for AI, authentication, communication, document management, loans, and users.
## Folder Structure
Below is a brief overview of the key directories and files in this project:
```
miralabs-backend/
β”œβ”€β”€ .github/ # GitHub-specific files and actions
β”œβ”€β”€ .vscode/ # Visual Studio Code settings
β”œβ”€β”€ ai_service/ # AI service module
β”œβ”€β”€ auth-service/ # Authentication service module
β”œβ”€β”€ communication-service/ # Communication service module
β”œβ”€β”€ document_service/ # Document management service module
β”œβ”€β”€ loan_service/ # Loan service module
β”œβ”€β”€ user_service/ # User management service module
β”œβ”€β”€ .gitignore # Git ignored files
β”œβ”€β”€ .pre-commit-config.yaml # Pre Commit config file
β”œβ”€β”€ README.md # Project README file
└── requirements.txt # Common dependencies
```
## Setup
### Prerequisites
- Python 3.x
- Database (e.g., PostgreSQL, MySQL)
### Installation
1. **Clone the repository:**
```sh
git clone <repository_url>
cd miralabs-backend
```
2. **Create and Activate VirtualEnv:**
- Create venv
```
python -m venv venv
```
- Activate in Mac
```
source .venv/bin/activate
```
- Activate in Windows
```
.venv/Source/Activate
```
3. **Install dependencies:**
Replace _[respective-service-folder-name]_ with any of the following available services:
- loan-service
- user-service
- document-service
- ai-service
```sh
pip install -r [respective-service-folder-name]/requirements.txt
```
4. **Run pre-commit install command**
Run this command at the root directory
```
pre-commit install
```
5. **Create .env file inside respective service folder**
```
cd loan-service
cp .env.example .env
```
6. **Run DB migrations:**
```sh
cd loan-service
alembic upgrade head
```
7. **Start the services:**
Each service can be started individually. For example, to start the `ai-service`:
```sh
cd ai-service
uvicorn app.main:app --reload --port 8002
```