API with high performance built with FastAPI, help to improve connection with your Backend Side.
1.0K
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 ⛏
# clone the repo
$ git clone https://github.com/yezz123/DogeAPI
# move to the project folder
$ cd DogeAPI
pipenv a global python project pip install pipenvvirtual environment for this project# creating pipenv environment for python 3
$ pipenv --three
# activating the pipenv environment
$ pipenv shell
# if you have multiple python 3 versions installed then
$ pipenv install -d --python 3.8
# install all dependencies (include -d for installing dev dependencies)
$ pipenv install -d
# Running the application using uvicorn
$ uvicorn main:app
## To run the Application under a reload enviromment use -- reload
$ uvicorn main:app --reload
SQLite Database using SQLAlchemy.MySQL or PostgreSQL you can change the Database_URL here :# here you need to inster the URI that should be used for the connection.
SQLALCHEMY_DATABASE_URL = 'sqlite:///blog.db'
SQLALCHEMY_DATABASE_URL = 'mysql://username:password@server/blog'
blogs and usersclass 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")
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")
.env.sample to .env then insert you String Secret_Key and ACCESS_TOKEN_EXPIRE_MINUTES.openssl rand -hex 32.$ docker build
dogeapi:latest in the list.$ docker images
-p: publish the container's port to the host port.-d: run the container in the background.-i: run the container in interactive mode.-t: to allocate pseudo-TTY.--name: name of the container
$ docker container run -p 5000:5000 -dit --name DOGEAPI dogeapi:latest
$ docker container ps
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
This project is licensed under the terms of the MIT license.
Content type
Image
Digest
Size
486 MB
Last updated
over 5 years ago
docker pull yezz123/dogeapi