Giter VIP home page Giter VIP logo

dogeapi's Introduction

Star Badge

DogeAPI ๐ŸŒ™:

Introduction ๐Ÿ‘‹๐Ÿป

  • FastApi is built on a Python framework called Starlette which is a lightweight ASGI framework/toolkit, which is itself built on Uvicorn.
  • Ideal for building high performance asyncio services with seriously impressive performance.
  • That why DogeAPI is here, an API with high performance built with FastAPI & SQLAlchemy, help to improve connection with your Backend Side and stay relate using SQLite3 & a secure Schema Based on Python-Jose a JavaScript Object Signing and Encryption implementation in Python.

I use ๐Ÿค”

  • fastapi : FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
  • uvicorn : Uvicorn is a lightning-fast ASGI server implementation, using uvloop and httptools.
  • sqlalchemy : SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
  • passlib : Passlib is a password hashing library for Python 2 & 3, which provides cross-platform implementations of over 30 password hashing algorithms, as well as a framework for managing existing password hashes.
  • bcrypt : Good password hashing for your software and your servers.
  • python-jose : The JavaScript Object Signing and Encryption (JOSE) technologies - JSON Web Signature (JWS), JSON Web Encryption (JWE), JSON Web Key (JWK), and JSON Web Algorithms (JWA) - collectively can be used to encrypt and/or sign content using a variety of algorithms.
  • python-multipart : streaming multipart parser for Python.

Installation ๐Ÿ’ผ

  • With a simple steps you can install DogeAPI.
  • clone the repository:
git clone https://github.com/yezz123/DogeAPI.git
  • Create & activate a python3 virtual environment (optional, but very recommended).
  • Install requirements:
pip install -r requirements.txt
  • Run the app locally :
uvicorn main:app --reload
  • Port already in use? Close the other app, or use a difference port:
uvicorn main:app --port 8001 --reload

Into Code ๐Ÿ

  • If you want to Set environment variables you need to check token.py and use :
openssl rand -hex 32
  • To get a string like this.
SECRET_KEY = "a4ee1c733a80a5ac8824ac21b90ee6ae0158aee6642880fb2675929f99b1a677"
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 30
  • I Use a simple Model to implement with Database & the default configuration.
  • This for the Blog Table
class Blog(Base):
    __tablename__ = "blogs"
    id = Column(Integer, primary_key=True,index=True)
    title = Column(String)
    body = Column(String)
    user_id = Column(Integer, ForeignKey("users.id"))
    creator = relationship("User", back_populates="blogs")
  • This for The Users Table
class User(Base):
    __tablename__ = "users"
    id = Column(Integer, primary_key=True,index=True)
    name = Column(String)
    email = Column(String)
    password = Column(String)
    blogs = relationship("Blog", back_populates="creator")
  • For database i use SQLAlchemy.ORM to create a sessions.
SessionLocal = sessionmaker(bind=engine, autocommit=False, autoflush=False)
Base = declarative_base()

Contributing โญ

  • Read CONTRIBUTING.md
  • Contributions are welcome!
  • Please share any features, and add unit tests! Use the pull request and issue systems to contribute.

Reference

Credits & Thanks ๐Ÿ†

Medium Twitter Discord

dogeapi's People

Contributors

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