File size: 2,488 Bytes
ef1ad9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# 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

   ```