Akado2009/MB-trff24

★ 0Forks 0PythonGitHub ↗Compare

README

MB-TRFF24

Overview

This project is designed to handle various backend operations including parsing, logging, and interacting with social media platforms. It is built using FastAPI and includes several utilities for handling files, making HTTP requests, and processing data.

Setup

Prerequisites

  • Python 3.10
  • Docker
  • Docker Compose

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r backend/requirements.txt
  4. Set up environment variables:

    cp backend/.env.local.example backend/.env.local
    # Edit backend/.env.local with your configuration

Running the Application

  1. Start the backend server:

    uvicorn backend.main:app --host 0.0.0.0 --port 7899 --reload
  2. Alternatively, canyou use Docker Compose:

    docker-compose -f deploy/docker-compose.yaml up --build

Usage

API Endpoints

  • Submit File: POST /submit/file
  • Get CSV Template: GET /template/csv
  • Get XLSX Template: GET /template/xlsx

Example Requests

Submit File

curl -X POST "http://localhost:7899/submit/file" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "links_file=@path/to/your/file.csv"

Logging

The project uses loguru for logging. Logs are written to app.log and also output to stderr.

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add new feature').
  5. Push to the branch (git push origin feature-branch).
  6. Create a new Pull Request.

LICENSE

This project is licensed under the MIT License. See the LICENSE file for details.

Issues