Skip to content

jacobbridges/nvxz.flags

Repository files navigation

nvxz.flags

Tiny feature flag server.
 
License GitHub contributors Stars Forks Issues

Features

  • Fast: Built with FastAPI and SQLite.
  • Tiny: Less than 1k lines of code.
  • No external dependencies: Uses SQLite database
  • Easy deployment: Deploy with coolify or grab the docker image.

Getting Started

I currently run nvxz.flags on coolify, but you can grab the alpine image and run it wherever you like.

API Docs

More detailed API docs are available on swagger at /docs/ after install.

🔌 Register New User

POST /users/
Example Body
{
  "username": "john",
  "password": "jingleheimersmith"
}
Parameters
name type data type description
username required string Username on the platform
password required string Password for login
Responses
http code content-type response
201 application/json <User object returned>
400 application/json {"detail": "Bad Request"}
409 application/json {"detail": "Username is taken"}
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8000/users/

🔌 Login

POST /auth/token/ OAuth2 Schema
Parameters
name type data type description
grant_type required string Part of OAuth2 scheme. Set to "password"
username required string Username on the platform
password required string Password for login
Responses
http code content-type response
200 application/json <session token returned>
400 application/json {"detail": "Invalid username or password"}
Example cURL
curl -X 'POST' 'https://localhost:8000/auth/token' \
 -H 'accept: application/json' \
 -H 'Content-Type: application/x-www-form-urlencoded' \
 -d 'grant_type=password&username=test&password=test'

Built With

FastAPI SQLite Pydantic

About

Simple feature flag server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages