All Projects → Gingernaut → microAuth

Gingernaut / microAuth

Licence: MIT license
A fast, documented, and tested python3 API boilerplate

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to microAuth

Sanic
Async Python 3.7+ web server/framework | Build fast. Run fast.
Stars: ✭ 15,660 (+65150%)
Mutual labels:  sanic, api-server
java-crud-api
No description or website provided.
Stars: ✭ 24 (+0%)
Mutual labels:  api-server
expressive
A NodeJS API framework built on ExpressJs bootstrapped with conventions to minimize code. (Includes Typescript Support ⭐️)
Stars: ✭ 28 (+16.67%)
Mutual labels:  api-server
mythra
Music retrieval CLI and API using rust
Stars: ✭ 50 (+108.33%)
Mutual labels:  api-server
nei
NEI 接口管理平台 源代码
Stars: ✭ 308 (+1183.33%)
Mutual labels:  api-server
sanic-admin
sanic-admin is a command line tool for automatically restarting sanic.
Stars: ✭ 15 (-37.5%)
Mutual labels:  sanic
snutt
SNU Timetable
Stars: ✭ 38 (+58.33%)
Mutual labels:  api-server
sanic-plugin-toolkit
Easily create Plugins for Sanic!
Stars: ✭ 49 (+104.17%)
Mutual labels:  sanic
django-kcproject-starter
Kickstart Coding's Django Project Starter Template
Stars: ✭ 14 (-41.67%)
Mutual labels:  hackathon-starter
lcbo-api
A crawler and API server for Liquor Control Board of Ontario retail data
Stars: ✭ 152 (+533.33%)
Mutual labels:  api-server
noire-server
Hapi Boilerplate
Stars: ✭ 20 (-16.67%)
Mutual labels:  api-server
Transformer-QG-on-SQuAD
Implement Question Generator with SOTA pre-trained Language Models (RoBERTa, BERT, GPT, BART, T5, etc.)
Stars: ✭ 28 (+16.67%)
Mutual labels:  api-server
Asher.Ai
Welcome to the API side of Asher, where all the language processing happens.
Stars: ✭ 20 (-16.67%)
Mutual labels:  api-server
FSharp.JsonApi
Use F# to create and consume flexible, strongly typed web APIs following the JSON:API specification
Stars: ✭ 20 (-16.67%)
Mutual labels:  api-server
pimba
Pimba is a minimalist command-line tool written in Go to publish and serve static files.
Stars: ✭ 12 (-50%)
Mutual labels:  api-server
Aliexpress-API
An Personal API For Fetching Product Details On Aliexpress.com
Stars: ✭ 60 (+150%)
Mutual labels:  api-server
sanic-ext
Extended Sanic functionality
Stars: ✭ 26 (+8.33%)
Mutual labels:  sanic
Ara-Server
The server for Ara.
Stars: ✭ 17 (-29.17%)
Mutual labels:  api-server
robot-mind-meld
A little game powered by word vectors
Stars: ✭ 31 (+29.17%)
Mutual labels:  sanic
endpoints
Lightweight REST api backend framework that automatically maps urls to python modules and classes
Stars: ✭ 30 (+25%)
Mutual labels:  api-server

Microauth

A fast, documented, and tested python3 API boilerplate application

Tired of reinventing the wheel every time you need user authentication in a project?

Fill out a simple config file and have RESTful API endpoints for everything needed for account management.

Screenshot

Features:

  • Full API documentation via Swagger at /docs
  • Account confirmation and password resets via email, powered by Sendgrid
  • Production Docker setup
  • Thorough unit test coverage
  • json logging

Running locally (first time)

uses Python3.6+, Docker, and Docker-compose

  1. Create a virtual environment for dependencies with python3 -m venv .venv/. Activate it with source .venv/bin/activate.
  2. Dependencies are managed with Poetry. Install dependencies with poetry install.
  3. Run pre-commit install to configure git commit hooks (for flake8 checking and black formatting).
  4. Copy default.env to a new file .env.
  5. Run docker-compose up -d database to run a local PostgreSQL instance for testing and development.
  6. Initialize the database with python3 app/utils/init_db.py.
  7. Run the application with python3 app/main.py.

View documentation at http://localhost:8000/docs

Production

  1. Create a PostgreSQL instance on the cloud provider of your choice (AWS, Digital Ocean, etc).
  2. Fill out .env with your credentials, and change API_ENV to PRODUCTION.
  3. Initialize the database with python3 app/utils/init_db.py
  4. Build the project with docker build -t microauth .
  5. Run with docker run -p 8000:8000 -d microauth

Tests

Run test suite with pytest --cov=app tests/.

Email Resets (Optional)

If you would like users to be able to verify their email address and reset their passwords, sign up for a Sendgrid Account and add your API Key to .env.

Credit for the email HTML templates

Adding new models

  1. Create sqlalchemy model in app/models/.
  2. Create database queries for the model in app/db/
  3. Create Pydantic "Schema" in app/schemas/ for API validation and documentation
  4. Import model in alembic/env.py and utils/init_db.py

Now you should be ready to apply a change to your existing database with alembic. alembic revision -m "made some change" --autogenerate (generates migration plan in alembic/versions/) alembic upgrade head (applies database changes)

Testing

Tests are always run against the local docker PostgreSQL instance. The database is re-initialized before each test, and after the last test is run.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].