Skip to content

ryanrib14/BrainMinderBack

Repository files navigation

BrainMinder

BrainMinder-server is a FastAPI-based template server designed as a scaffold for various projects. It includes essential features like routing, logging, environmental configuration, and comprehensive unit tests.

Table of Contents

Project Structure

The project follows a structured directory layout:

app
├── config                # Configuration related files (e.g., settings, environment configuration)
├── core                  # Core functionality (e.g., business logic, operations)
│   ├── base              # Base classes or shared functionalities used across the core
│   ├── operations        # Specific class folder example
│   ├── tests             # Tests for the core functionalities
├── models                # Database models or other data representations
├── routers               # API route definitions, handling the HTTP requests
├── schemas               # Pydantic schemas for request/response models
├── services              # Business logic and service layer, coordinating between routers and models
├── utils                 # Utility modules for auxiliary functionality
│   ├── __init__.py       # Initialization file for the utils module
│   ├── dependencies.py   # Dependency injection and management
│   └── main.py           # Main entry point and setup for the application
docs                      # Documentation for the project (e.g., API documentation, user guides)
notebooks                 # Jupyter notebooks for experiments, data analysis, prototyping
tests                     # Test cases for the routes and services
.env                      # Environment variables for local development
.env.example              # Example environment variables file, serving as a template
.gitignore                # Gitignore file specifying files and directories to be ignored by git
.pre-commit-config.yaml   # Configuration for pre-commit hooks, automating code quality checks
docker-compose.yml        # Docker Compose file for running multi-container Docker applications
Dockerfile                # Dockerfile for building the production Docker image
Dockerfile.dev            # Dockerfile for building the development Docker image
poetry.lock               # Lock file generated by Poetry, ensuring consistent dependency versions
pyproject.toml            # Configuration and metadata for Poetry, specifying dependencies and project settings
README.md                 # Project documentation, providing an overview and instructions

Getting Started

Step 1: Clone the Repository

git clone <repository-url>
cd BrainMinder
code . #for vs code users

Step 2: Create a .env File

Create a .env file in the root directory of the project by copying the provided .env.example and filling in the necessary values.

cp .env.example .env

Step 3: Set Up Poetry Environment

Install main dependencies and set up a virtual environment using Poetry.

poetry install

To install both main dependencies and development dependencies:

poetry install --with dev

Step 4: Set Up Pre-commit

Set up pre-commit hooks by installing pre-commit in your environment and then running the installation command in the project root.

pip install pre-commit
pre-commit install

Step 5: Run Tests

Run test cases using pytest to ensure everything is set up correctly.

poetry run pytest

Running With Docker

Using Docker Compose allows you to run your application in a containerized environment, ensuring consistency across different development and production setups.

Step 1: Build and run the Docker Images

Make sure your Docker daemon is running, then build and run the Docker images using the following command:

docker compose up -d --build

Step 2: Just Run the Docker Compose Services

Start the services defined in your docker-compose.yml file:

docker compose up

This command will start all the services defined in the docker-compose.yml file. By default, your FastAPI application will be accessible at http://localhost:8000.

Step 3: Stop the Docker Compose Services

To stop the running services, use:

docker compose down

Notes:

Different repositories will be used for each part of the project: Front-end, Back for Front and Front for AI.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors