Skip to content

Fideludu/FastAPI-Project-Turbit

Repository files navigation

My Project

Overview

This project sets up a MongoDB database using Docker Compose, retrieves data from an external API, and exposes this data through a FastAPI application.

Setup

  1. Start MongoDB with Docker Compose:

    docker-compose up -d
  2. Install Python dependencies:

    pip install -r requirements.txt
  3. Load data into MongoDB:

    python data/load_data.py
  4. Run the FastAPI application:

    uvicorn app.main:app --reload

Endpoints

  • /user_posts_count: Get the total number of posts from each user.
  • /post_comments/{post_id}: Get comments for a specific post.
  • /users: Add a new user.
  • /users/{user_id}: Modify an existing user.
  • /users/{user_id}: Delete a user.

Running Tests

Run the tests using pytest:

pytest tests/

About

A task given to me by Turbit to set up a MongoDB database using Docker Compose, retrieve and store data from an external API, and exposing this data through a FastAPI application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors