Giter Club home page Giter Club logo

its_on's Introduction

It's on

Build Status Maintainability Test Coverage

Flag/feature toggle service, written in aiohttp.

API Reference

Basic

Method Endpoint Description
GET /api/docs Api documentation
GET /api/v1/switch List of active flags for the group.

Admin

Endpoint Description
/zbs/login Login form
/zbs/switches List of flags
/zbs/switches/{switch_id} Flag detail

Sample /api/v1/switch output

{
    "count": 2,
    "result": ["test_flag3", "test_flag4"]
}

Installation

Prerequisites

its_on requires an SQL database and a cache storage engine. Currently, only PostgreSQL and Redis are supported as respective backends.

Manual

Clone repo:

$ git clone [email protected]:bestdoctor/public/its_on.git

Install python packages:

$ pip install -r requirements.txt

Specify database and cache settings:

export DYNACONF_REDIS_URL=redis://127.0.0.1:6379/1
export DYNACONF_CACHE_URL=redis://127.0.0.1:6379/1
export DYNACONF_DATABASE__dsn=postgresql://user:[email protected]:5432/its_on

Apply database migrations:

$ alembic upgrade head

Create admin user:

$ python script/create_user.py --login=admmin --password=passwordd --is_superuser

Run server:

$ python -m its_on

Navigate to http://127.0.0.1:8081/api/docs in your browser and you are good to go!

Docker

Example docker-compose.yml file:

version: '3'
services:
  cache:
    image: redis
    container_name: its-on-redis

  db:
    image: postgres
    container_name: its-on-postgres
    environment:
      POSTGRES_PASSWORD: strongpassword
      POSTGRES_USER: itson
      POSTGRES_DB: itson

  web:
    image: bestdoctor/its_on:latest-dev
    container_name: its-on
    environment:
      DYNACONF_HOST: '0.0.0.0'
      DYNACONF_DATABASE__dsn: postgresql://itson:strongpassword@db:5432/itson
      DYNACONF_REDIS_URL: redis://cache:6379/0
      DYNACONF_CACHE_URL: redis://cache:6379/1
    ports:
     - "127.0.0.1:8081:8081"
    depends_on:
      - cache
      - db

Don't forget to create a superuser:

docker exec -t its-on python scripts/create_user.py --login=admin \
                                                    --password=passwordd \
                                                    --is_superuser

Navigate to http://127.0.0.1:8081/api/docs in your browser and you are good to go!

Testing

Run make test

Contributing

We would love you to contribute to our project. It's simple:

  • Create an issue with bug you found or proposal you have. Wait for approve from maintainer.
  • Create a pull request. Make sure all checks are green.
  • Fix review comments if any.
  • Be awesome.

Here are useful tips:

  • You can run all checks and tests with make check. Please do it before TravisCI does.
  • We use BestDoctor python styleguide. Sorry, styleguide is available only in Russian for now.
  • We respect Django CoC. Make soft, not bullshit.

its_on's People

Contributors

kazauwa avatar melevir avatar yakovistomin avatar

Watchers

James Cloos 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.