|
# Introduction
|
|
|
|
This microservice is dedicated to user management, encompassing a wide range of functionalities essential for user onboarding and management. From initial registration to ongoing user profile maintenance, it orchestrates the entire user onboarding flow with efficiency and reliability.
|
|
|
|
## 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.
|
|
|
|
## Functionality
|
|
|
|
- **User Onboarding:** This service orchestrates the user onboarding process, providing APIs for user profile management. Users can seamlessly navigate through various stages of onboarding, including account creation, personal information submission, and verification.
|
|
|
|
## Installation
|
|
|
|
1. Clone this repository to your local machine:
|
|
|
|
```bash
|
|
git clone https://github.com/miralabsai/user-service.git
|
|
```
|
|
|
|
2. Navigate to the project directory:
|
|
|
|
```bash
|
|
cd user-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.
|
|
|