Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

devsetgo/starlette-dashboard

Repository files navigation

Python:

image Code style: black Python 3.6 Python 3.7

CI/CD Pipeline:

codecov Actions Status Actions Status

SonarCloud:

Maintainability Rating Reliability Rating Quality Gate Status Bugs

Starlette - Dashboard Template (pre-release)

Note: The AdminLTE 3.0 template has thousands of issues according to SonarCloud. All are due to template issues and issues within JavaScript for UI dependencies. Working on determining a way to solve these issues or frankly just ignore them.

Utilizing Starlette to render the AdminLTE 3.0 template. This is a basic example to be used as the base/skeleton/template for Starlette applciations.

Starlette Dashboard

Use it

Run APP

First Change directory to 'app'

Update .env file with your settings

cp .env_sample .env

Or use docker image

docker run mikeryan56/starlette-dashboard:latest

UVICORN Run Development (pick one):

    uvicorn main:app --port 5000 --reload
    python3 main.py
    ./scripts/dev_run.sh
Run Production (pick one):
    uvicorn main:app --workers 2 --port 5000
    gunicorn -c gunicorn_cfg.py main:app
    # Note: gunicorn is the config for the dockerfile
    ./script/prd_run.sh

Docker

    Docker: docker pull mikeryan56/starlette-dashboard:latest (not implemented)

Run Tests

python3 -m pytest
./scripts/tests.sh

Create coverage badge

not needed if tests run from ./scripts/tests.sh

    coverage-badge -o coverage.svg -f

Pre-Commit & Hooks

Not needed if ./scripts/tests.sh is run. It will install and update.

    - Follow install instructionsL: [https://pre-commit.com/#install](https://pre-commit.com/#install)
    - pre-commit install
    - pre-commit run -a

Issues/Bugs

  • cleanup

TODO

  • Create tests

    • Minimum of 80% (Goal to maintain - can drop during build cycles)
    • Exception Testing
    • Mock requests call
  • Better organization

    • Use of Endpoints (equivalent to Flask Blueprints) - starlette routes and endpoint (/app/routes)
  • Configuration Scripts

  • Access Controls

    • OAuth via GitHub
    • Mock GITHub Oath
    • Require Authentication on specified routes
    • Profile Page to see you repos and other Github data (limited to 100 items)
  • Gunicorn/Uvicorn configuration

  • Logging (using Loguru)

  • Setup CI/CD Pipeline for test and deployment

    • SonarCloud
    • Github Actions found in .github/workflow/actions
      • tests - matrix run of Python 3.6 and 3.7
        • CodeCove.io upload
      • docker-rc - docker build and push when pull request approved for release-candidate branch (calendar version - rc)
      • docker-master - docker build and push when pull request approved for master branch (calender version and latest)
      • ensure docker build only happens after pull_request approved and merged into higher branch
  • Twelve Factor App ready

  • Build a cookiecutter template for

  • Add code comments

  • Websocket example

  • Docker

    • Docker Image
    • Docker-Compose
      • Docker Swarm settings
    • Kubernetes Kompose
  • Tutorials/Documentation

    • Basic Overview
    • Explantion of Functions
    • Explantion of Configuration

Screenshots

Starlette SRTDashboard Starlette SRTDashboard Starlette SRTDashboard Starlette SRTDashboard Starlette SRTDashboard

About

Starlette Dashboard using a dashboard template (currently AdminLTE 3.0). This is intended to be a base to build other applications from as a simple start.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published