Giter Site home page Giter Site logo

2024-1a-t2-m10-a2's Introduction

2024-1A-T2-M10-A2

This project was a API RESTful developed in Python using FastAPI to manage blog posts! It was a good example of how to use FastAPI to create a simple API with CRUD operations, NGINX to serve the API and Docker to containerize the application and make it easier to deploy.

Features

  • CRUD operations for blog posts (Create, Read, Update and Delete)
  • API RESTful using FastAPI
  • NGINX to serve the API
  • Docker to containerize the application and manage the services
  • Insomnia to test the API
  • Well organized project structure with a clear separation of concerns

How to use

Requirements

Setup

  1. Clone the repository

    git clone [email protected]:ViniciosLugli/2024-1A-T2-M10-A2.git
  2. Change to the project directory

    cd 2024-1A-T2-M10-A2

Running the project

Local

  1. Go to the API directory

    cd api
  2. Set the virtual environment

    python3 -m venv venv
    source venv/bin/activate
  3. Install the dependencies

    pip install -r requirements.txt
  4. Run the API

    python3 src/main.py
  5. Access the API

    The API will be available at http://0.0.0.0:3001

Docker

  1. Run the services

    In the root directory of the project:

    docker compose up --build
  2. Access the API

    The API will be available at http://0.0.0.0:3000

API Endpoints

You can access the API documentation at http://0.0.0.0:3000/docs on docker or http://0.0.0.0:3001/docs on local.

Logs

The logs file are located in the logs/logs.log file. Current logs are commited to the repository for demonstration purposes. based on the demonstration video, the logs are being written to the file.

Insomnia

You can use Insomnia to test the API. You can import the Insomnia file to have all the requests ready to use and test the API!

insomnia

Demo of the project using Insomnia

demo.webm

2024-1a-t2-m10-a2's People

Contributors

vinicioslugli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.