Giter Site home page Giter Site logo

yezz123 / dogeapi Goto Github PK

View Code? Open in Web Editor NEW
137.0 4.0 35.0 200 KB

API with high performance to create a simple blog and Auth using OAuth2 ⛏

Home Page: https://blog.yezz.me/blog/Build-and-Secure-an-API-in-Python-with-FastAPI

License: MIT License

Dockerfile 1.98% Python 76.37% JavaScript 6.71% CSS 9.05% HTML 4.08% Makefile 1.54% Procfile 0.27%
fastapi backend sqlalchemy rest-api swagger-ui uvicorn api sqlite python3 asyncio

dogeapi's Introduction

DOGEAPI

Star Badge

DogeAPI

API with high performance built with FastAPI & SQLAlchemy, help to improve connection with your Backend Side to create a simple blog and Cruds with OAuth2PasswordBearer ⛏

Getting Started

Prerequisites

  • Python 3.8.6 or higher
  • FastAPI
  • Docker

Project Setup

# clone the repo
$ git clone https://github.com/yezz123/DogeAPI

# move to the project folder
$ cd DogeAPI

Creating Virtual Environment

  • Create a virtual environment using virtualenv.
# creating virtual environment
$ virtualenv venv

# activate virtual environment
$ source venv/bin/activate

# install all dependencies
$ pip install -r requirements.txt

Running the Application

  • To run the Main we need to use uvicorn a lightning-fast ASGI server implementation, using uvloop and httptools.
# Running the application using uvicorn
$ uvicorn main:app --reload

Environment Variables

  • SECRET_KEY: A secret key for signing Json Web Token.
  • DATABASE_URL: The database url to connect to the database.
  • ACCESS_TOKEN_EXPIRE_MINUTES: The access token expire minutes.

change all the environment variables in the .env.sample and don't forget to rename it to .env.

Configured Environment

Models

  • Here for the Models.py, i create 2 tables based on the requirements for this project blogs and users

Running the Docker Container

  • We have the Dockerfile created in above section. Now, we will use the Dockerfile to create the image of the FastAPI app and then start the FastAPI app container.
  • Using a preconfigured Makefile tor run the Docker Compose:
# Pull the latest image
$ make pull

# Build the image
$ make build

# Run the container
$ make start

Preconfigured Packages

Includes preconfigured packages to kick start DogeAPI by just setting appropriate configuration.

Package Usage
uvicorn a lightning-fast ASGI server implementation, using uvloop and httptools.
Python-Jose a JavaScript Object Signing and Encryption implementation in Python.
SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
starlette a lightweight ASGI framework/toolkit, which is ideal for building high performance asyncio services.
passlib a password hashing library for Python 2 & 3, which provides cross-platform implementations of over 30 password hashing algorithms
bcrypt Good password hashing for your software and your servers.
python-multipart streaming multipart parser for Python.

yapf packages for linting and formatting

Contributing

  • Join the DOGEAPI Creator and Contribute to the Project if you have any enhancement or add-ons to create a good and Secure Project, Help any User to Use it in a good and simple way.
  • Check all information here at docs's Folder to understand to how to contribute or to Read the Code of Conduct.

License

This project is licensed under the terms of the MIT license.

dogeapi's People

Contributors

artyomvancyan avatar bswck avatar dependabot[bot] avatar imgbotapp avatar jpoehnelt avatar yezz123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dogeapi's Issues

Json error

Json does not contain the name of pepepopo, and why are you giving your variables meaningful names ? i can't find a single pepepopo variable this code.
Steps to reproduce the behavior:

  1. Modifies every variable name to pepe
  2. Click on repush the code
    Expected behavior
    A clear and clean code to read.

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.