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:

    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
    
  1. 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
    
  2. Run pre-commit install command

    Run this command at the root directory

    pre-commit install
    
  3. Create .env file inside respective service folder

    cd loan-service
    cp .env.example .env
    
  4. Run DB migrations:

    cd loan-service
    alembic upgrade head
    
  5. 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