File size: 2,658 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 |
# Introduction
This microservice comprehensively manages all aspects pertaining to user documents. From creation to retrieval and updates, it efficiently handles all operations related to user documents, ensuring seamless functionality and accessibility.
## Tech Stack
### Backend Framework:
- **FastAPI:** Employed as the backend framework, FastAPI offers a high-performance, Python-based platform for crafting APIs. Its asynchronous capabilities enable efficient handling of concurrent requests, making it well-suited for modern web development.
### Database:
- **Azure Cosmos DB:** Selected as the database solution, Azure Cosmos DB provides a globally distributed, multi-model database service. Its scalability and flexibility empower seamless storage and management of diverse data types, facilitating the development of robust and adaptable applications.
- **Azure Blob Storage:** Azure Blob Storage is utilized for storing documents and files, complementing the system's capabilities to efficiently manage and organize non-relational data.
### Monitoring:
- **Azure Application Insights:** Integrated for monitoring the application, Azure Application Insights provides comprehensive insights into application performance, usage, and issues, enabling proactive management and optimization.
## Functionality
- **User Document CRUD:** Seamlessly handles CRUD operations for user documents, providing essential functionalities such as creation, retrieval, updating, and deletion. Access these APIs via the router at `/file` .
## Installation
1. Clone this repository to your local machine:
```bash
https://github.com/miralabsai/document-service.git
```
2. Navigate to the project directory:
```bash
cd document-service
```
3. Create a virtual environment (recommended) using `venv` or `virtualenv`:
```bash
# Using venv
python -m venv venv
# Activate the virtual environment
source ./venv/Scripts/activate
```
4. Install the required dependencies:
```bash
pip install -r requirements.txt
```
## Setting up Environment Variables
1. Copy the `.env.example` file to create a new `.env` file:
```bash
cp .env.example .env
```
2. Edit the `.env` file and provide appropriate values for the environment variables.
## Running the service
To run the service, use the following command:
```bash
python -m uvicorn app.main:app --reload --port 5001
```
This will start the server on http://localhost:5001.
You can now access the Swagger UI for interactive documentation at http://localhost:5001/docs.
|