Giter VIP home page Giter VIP logo

platzi-twitter-api-fastapi's Introduction

Platzi - Twitter API

This project is part of the course "Curso de FastAPI: Modularización, Datos Avanzados y Errores " of "Platzi"

Table of Contents:

Description

This is project is a simple REST API made with FastAPI for learning purposes.

Features

Features included:

  • Data modeling with pydantic.
  • Data validation.
  • CRUD of users.
  • CRUD of Tweets.
  • SQLAlchemy (MYSQL)
  • Docker dev environment
  • JWT Authentication
  • FastAPI Router
  • MyPY

Requirements:

  • Python >= 3.6
  • Docker and Docker Compose (Optionally)

Installation

  1. Clone or download de repository:

    $ git clone https://github.com/JoseNoriegaa/platzi-twitter-api-fastapi
    
  2. Open the console inside the project directory and create a virtual environment (You can skip this step if you have docker installed).

    $ python3 -m venv venv
    $ source venv/bin/activate
  3. Install the app (You can skip this step if you have docker installed)

    (venv) $ pip install -r requirements.txt

Run it locally

Copy the env.example file into the same directory with the name .env

$ cp ./env.example ./.env

With docker

  1. Run it with Docker Compose.
docker-compose up

Without docker

  1. Configure the environment variables into the .env.
# App
SECRET_KEY=rVsvupYHUbAgOGNMw0ytII_7tkn_iWkBhktVR_i3Tg8=  # You can leave this dev key as is.
DEBUG=True  # If DEBUG = True, the reload option of uvicorn will be enabled
PORT=8000  # Server port

# Database
DATABASE_URL=mysql+pymysql://${YOUR_USER}:${YOUR_PASSWORD}@${HOST}:${PORT}/${DATABASE NAME}  # Configure your database credentials here.
  1. Run the server.
$ python3 main.py

Basic Usage

Once you are running the server open the Swagger UI App to checkout the API documentation.

platzi-twitter-api-fastapi's People

Contributors

josenoriegaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.