Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yezz123/jeffql
fastAPI Simple authentication & Login API using GraphQL and JWT :rocket:
https://github.com/yezz123/jeffql
asyncio docker fastapi fastapi-docker graphene graphql jwt jwt-authentication python python3
Last synced: about 16 hours ago
JSON representation
fastAPI Simple authentication & Login API using GraphQL and JWT :rocket:
- Host: GitHub
- URL: https://github.com/yezz123/jeffql
- Owner: yezz123
- License: mit
- Created: 2019-11-30T13:52:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T23:21:12.000Z (7 months ago)
- Last Synced: 2024-05-22T00:13:13.478Z (6 months ago)
- Topics: asyncio, docker, fastapi, fastapi-docker, graphene, graphql, jwt, jwt-authentication, python, python3
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 29
- Watchers: 2
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![JeffQL](.github/header.svg)
# JeffQL
A Simple FastAPI authentication & Login API using GraphQL and JWT.
> I choose this Name JeffQL cause i have a Low level Friend with a Nickname Jeff i wish he understand that Python and JavaScript is the future :rocket:
## Getting Started
### Prerequisites
- Python 3.8.6 or higher
- FastAPI
- Docker### Project setup
```sh
# clone the repo
$ git clone https://github.com/yezz123/JeffQL# move to the project folder
$ cd JeffQL
```### Creating virtual environment
- Install `pipenv` a global python project `pip install pipenv`
- Create a `virtual environment` for this project```shell
# 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
- To run the [Main](main.py) we need to use [uvicorn](https://www.uvicorn.org/) a lightning-fast ASGI server implementation, using uvloop and httptools.
```sh
# Running the application using uvicorn
$ uvicorn main:app## To run the Application under a reload enviromment use -- reload
$ uvicorn main:app --reload
```## 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.
```sh
$ docker build
```- list all the docker images and you can also see the image `jeffql:latest` in the list.
```sh
$ docker images
```- run the application at port 5000. The various options used are:
> - `-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```sh
$ docker container run -p 5000:5000 -dit --name JeffQL jeffql:latest
```- Check the status of the docker container
```sh
$ docker container ps
```## Preconfigured Packages
Includes preconfigured packages to kick start JeffQL by just setting appropriate configuration.
| Package | Usage |
| ------------------------------------------------------------ | -----------------------------------------------------------------------------|
| [uvicorn](https://www.uvicorn.org/) | a lightning-fast ASGI server implementation, using uvloop and httptools. |
| [graphene-python](https://graphene-python.org/) | a library for building GraphQL APIs in Python easily. |
| [PyJWT](https://pyjwt.readthedocs.io/en/stable/) | a Python library which allows you to encode and decode JSON Web Tokens (JWT).|
| [starlette](https://www.starlette.io/) | a lightweight ASGI framework/toolkit, which is ideal for building high performance asyncio services. |## Contributing
- Join the JeffQL 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.
## License
This project is licensed under the terms of the MIT license.