Skip to content

Base for the FastAPI Microservice Architecture Backend for the Mock Interview and Mental Health Platform

Notifications You must be signed in to change notification settings

InterviewAndHealth/Microservices-Backend-FastAPI-Base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices FastAPI Backend Base

This repository will be used as the base for the microservice architecture backend for the mock interview project.

Architecture

  • app: Responsible for handling the FastAPI application.
    • database: Responsible for handling the database operations.
      • models: Responsible for handling the database models.
      • repository: Responsible for handling the database operations for a specific entity.
    • services: Responsible for handling the business logic.
    • routes: Responsible for handling the API routes.
    • utils: Responsible for handling the utility functions.
    • types: Responsible for handling the type definitions for request and response payloads and broker messages.
    • dependencies.py: Responsible for handling the dependencies and middlewares.

Broker

In the services directory, there is a broker directory that is responsible for handling the communication between the services. The broker is divided into two parts:

  • events: Responsible for handling the events between the services.
  • rpc: Responsible for handling the Remote Procedure Calls (RPC) between the services.

Setup

  1. Clone the repository.

  2. Create a virtual environment.

python3 -m venv .venv
  1. Activate the virtual environment.
source .venv/bin/activate # Linux or macOS
.venv\Scripts\activate # Windows
  1. Install the dependencies.
pip install -r requirements.txt
  1. Start the docker containers.
docker-compose up -d
  1. Setup the environment variables in the .env file.

  2. Run the FastAPI application.

python3 -m app

About

Base for the FastAPI Microservice Architecture Backend for the Mock Interview and Mental Health Platform

Topics

Resources

Stars

Watchers

Forks

Languages