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
Clone the repository:
git clone <repository_url> cd miralabs-backend
Create and Activate VirtualEnv:
- Create venv
python -m venv venv
- Activate in Mac
source .venv/bin/activate
- Activate in Windows
.venv/Source/Activate
Install dependencies:
Replace [respective-service-folder-name] with any of the following available services:
- loan-service
- user-service
- document-service
- ai-service
pip install -r [respective-service-folder-name]/requirements.txt
Run pre-commit install command
Run this command at the root directory
pre-commit install
Create .env file inside respective service folder
cd loan-service cp .env.example .env
Run DB migrations:
cd loan-service alembic upgrade head
Start the services: Each service can be started individually. For example, to start the
ai-service
:cd ai-service uvicorn app.main:app --reload --port 8002