Skip to content

Commit

Permalink
Initialize Broiestbot standalone app.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Sep 29, 2024
1 parent 048496d commit add256d
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 2,371 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ clean:
find . -type d -wholename './logs/*' -exec rm -rf {} +
find . -type d -wholename './.reports/*' -exec rm -rf {} +
find . -type d -wholename '**/.webassets-cache/' -exec rm -rf {} +
rm -rf './pythonmyadmin/static/.webassets-cache/'
rm -rf './broiestbot_db/static/.webassets-cache/'
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# PythonMyAdmin
# broiestbot-db

![Python](https://img.shields.io/badge/Python-^3.10-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
![Flask](https://img.shields.io/badge/Flask-2.2.5-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
![Dash](https://img.shields.io/badge/Dash-v^2.14.0-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
![Flask-SQLAlchemy](https://img.shields.io/badge/Flask--SQLAlchemy-^3.1.1-red.svg?longCache=true&style=flat-square&logo=scala&logoColor=white&colorA=4c566a&colorB=bf616a)
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c)
[![GitHub Issues](https://img.shields.io/github/issues/toddbirchard/pythonmyadmin.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/pythonmyadmin/issues)
[![GitHub Stars](https://img.shields.io/github/stars/toddbirchard/pythonmyadmin.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/pythonmyadmin/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/toddbirchard/pythonmyadmin.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/pythonmyadmin/network)
[![GitHub Issues](https://img.shields.io/github/issues/toddbirchard/broiestbot-db.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/broiestbot-db/issues)
[![GitHub Stars](https://img.shields.io/github/stars/toddbirchard/broiestbot-db.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/broiestbot-db/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/toddbirchard/broiestbot-db.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/toddbirchard/broiestbot-db/network)

Lightweight Python GUI for exploring and modifying data in database. Spoof of PhpMyAdmin - not affiliated in any way.
Lightweight Python GUI for exploring and modifying data in database. Branded version of [pythonmyadmin](https://github.com/toddbirchard/pythonmyadmin)

## Getting Started

Expand All @@ -27,7 +27,7 @@ Replace the values in **.env.example** with your values and rename this file to
Get up and running with `make deploy`:

```shell
$ git clone https://github.com/toddbirchard/pythonmyadmin.git
$ cd pythonmyadmin
$ git clone https://github.com/toddbirchard/broiestbot_db.git
$ cd broiestbot-db
$ make deploy
```
2 changes: 0 additions & 2 deletions pythonmyadmin/__init__.py → broiestbot_db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def create_app() -> Flask:

with app.app_context():
# Import parts of our application
from . import routes
from .assets import compile_js_assets, compile_style_assets
from .tables import table_view

Expand All @@ -31,7 +30,6 @@ def create_app() -> Flask:
compile_style_assets(app)

# Register App Blueprint
app.register_blueprint(routes.main_bp)
app = table_view.create_dash_view(app)

LOGGER.info("Flask app initialized.")
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pythonmyadmin/models.py → broiestbot_db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from flask import current_app as app

from pythonmyadmin import db
from broiestbot_db import db


class Command(db.Model):
Expand Down
1 change: 1 addition & 0 deletions broiestbot_db/static/dist/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ header {
display: flex;
align-items: center;
justify-content: space-between;
max-width: 800px;
width: 1000px;
max-width: 96vw;
margin: auto;

Expand Down Expand Up @@ -77,28 +77,4 @@ header {
}
}
}

.right-nav {
@media (max-width: 600px) {
display: none;
}

.nav-link,
a {
margin-left: 25px;
color: #70829d;
font-size: 1.1em;
text-decoration: none;
transition: all 0.3s ease-out;

&:hover {
cursor: pointer;
opacity: 0.7;
}

i {
margin-right: 3px;
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
<h1>BROIESTBOT</h1>
</a>
</div>
<div class="right-nav">
<a href="/table/commands/"><i class="fas fa-list"></i> Commands</a>
<a href="/database/"><i class="fas fa-database"></i> Database</a>
<a href="/users/"><i class="fas fa-user-friends"></i> Users</a>
</div>
</nav>
</header>
<main class="layout-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create_dash_view(server: Flask) -> Flask:
dash_app = Dash(
server=server,
external_stylesheets=external_stylesheets,
routes_pathname_prefix="/table/commands/",
routes_pathname_prefix="/",
)

# Override the underlying HTML template
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions broiestbot_db/templates/nav.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<header>
<nav>
<div class="left-nav">
<a href="/"><i class="fas fa-robot logo"></i>
<h1 class="site-name">BROIESTBOT</h1>
</a>
</div>
</nav>
</header>
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Config:
"""Global configuration variables."""

# General Config
APP_NAME = "pythonmyadmin"
APP_NAME = "broiestbot_db"
ENVIRONMENT = environ.get("ENVIRONMENT")

# Flask Config
Expand Down
10 changes: 5 additions & 5 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# Fetch deployment environment from environment variables.
ENVIRONMENT = environ.get("ENVIRONMENT")

proc_name = "pythonmyadmin"
proc_name = "broiestbot-db"
wsgi_app = "wsgi:app"
bind = "unix:pythonmyadmin.sock"
bind = "unix:broiestbot-db.sock"
threads = 4
workers = 2

Expand All @@ -25,9 +25,9 @@
elif ENVIRONMENT == "production":
access_log_format = "%(h)s %(l)s %(u)s %(t)s %(r)s %(s)s %(b)s %(f)s %(a)s"
daemon = True
accesslog = "/var/log/pythonmyadmin/info.json"
errorlog = "/var/log/pythonmyadmin/error.json"
accesslog = "/var/log/broiestbot-db/info.json"
errorlog = "/var/log/broiestbot-db/error.json"
loglevel = "trace"
dogstatsd_tags = "env:production,service:pythonmyadmin,language:python"
dogstatsd_tags = "env:production,service:broiestbot-db,language:python"
else:
raise ValueError(f"Unknown environment provided: `{ENVIRONMENT}`. Must be `development` or `production`.")
Loading

0 comments on commit add256d

Please sign in to comment.