Sign inSign up

saif0786/python-assignment

By saif0786

•Updated about 2 years ago

This assignment consists of the API Operations using FastAPI.

Image
API management
0

101

saif0786/python-assignment repository overview

⁠FastAPI Application with MongoDB Atlas Integration

Image Name: saif0786/python-assignment

⁠Overview

This Docker image contains a FastAPI application that interacts with a MongoDB Atlas cluster. It provides endpoints for querying and managing course data, including retrieving course information, chapter details, and submitting ratings.

⁠Features

  • FastAPI Application: A modern, fast (high-performance), web framework for building APIs with Python 3.10 based on standard Python-type hints.
  • MongoDB Atlas Integration: Connects to MongoDB Atlas for cloud-based, scalable database storage.
  • API Endpoints: Includes endpoints for fetching course data, retrieving chapter details, and rating chapters.

⁠Usage

⁠Running the Container

To run the Docker container, you need to type the command as follows

docker run -p 8000:80 saif0786/python-assignment
⁠Accessing the Application

Once the container is running, access the FastAPI application at:

http://localhost:8000

Explore the API documentation and interact with the endpoints directly from your browser using FastAPI's interactive Swagger UI.

⁠API Endpoints

  1. Get All Courses

    GET /fetch-all-courses/
    

    Query Parameters:

    • domain (optional): Filter by course domain.
  2. Get Course Overview

    GET /fetch-specific-record/{course_id}/
    

    Path Parameters:

    • course_id: ID of the course to retrieve.
  3. Get Chapter Information

    GET /fetch-specific-chapter-from-record/{chapter_id}/
    

    Path Parameters:

    • chapter_id: ID of the chapter.
  4. Rate a Chapter

    POST /add-rating/{chapter_id}/
    

    Path Parameters:

    • chapter_id: ID of the chapter.

    Request Body:

    {
      "rating_value": integer
    }
    

⁠Thank you

Tag summary

Content type

Image

Digest

sha256:76d29b8a3…

Size

372 MB

Last updated

about 2 years ago

docker pull saif0786/python-assignment