Code Monkey home page Code Monkey logo

tabletop-40k-utils's Introduction

tabletop utils

Resources used

The likeness of the faction icons do not belong to me. They are property of Games Workshop.

The icons themselves were pulled from these sources:

Goals with the project

Web tool that will do things like:

  • render uploaded battlescribe HTML rosters in a more manageable way
  • generate match rules / settings
  • custom rollable tables

Requirements

  • relational database. uses RDS in prod, but you can use sqlite, mysql, etc.
  • python 3.8
  • aws s3 bucket access

Local Setup

set flask environment variable to use local config

(linux) export FLASK_ENV=development
(powershell) $Env:FLASK_ENV="development"

create config file

touch tabletop_utils/tabletop_utils/config/default.py

replace <values> with yours

SECRET_KEY = "<your secret key>"

SQLALCHEMY_DATABASE_URI = '<database connection string>'
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
TEMPLATES_AUTO_RELOAD = True

install python dependencies

I recommend using venv to manage your project specific dependencies

pip install -r requirements.txt

apply migrations

flask db upgrade

If using vscode, create a launch.json file to run this in the debugger

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Flask",
            "type": "python",
            "request": "launch",
            "module": "flask",
            "env": {
                "FLASK_APP": "app.py",
                "FLASK_ENV": "development",
                "FLASK_DEBUG": "1"
            },
            "args": [
                "run"
            ],
            "jinja": true
        }
    ]
}

if not, you can run with

gunicorn --bind 0.0.0.0:3000 wsgi:app --reload

Running the Container

build the image

docker build -f Dockerfile -t tabletop-utils .

run the container

sudo docker run --network=host -e FLASK_ENV=development tabletop_utils

tabletop-40k-utils's People

Contributors

skeltont avatar dependabot[bot] avatar cooper-jackson avatar

Stargazers

 avatar Jonah George avatar

tabletop-40k-utils's Issues

Implement functional login

Since this tool is private for me, I just want the login to be a single password. I might live to regret this, but I think it's simple enough.

  • html template
  • auth / security helper module using bcrypt
  • WTForms form processing & validation, just the one field for password.
  • secure session?

I think to use the secure session I need to have https which means I need a cert. If i'm gonna get a cert I should probably buy a domain but because this is the first ticket, I will probably put this off.

improve wargaming list index page

  • User can click a roster to view it
  • User can view their rosters or public rosters
  • Section for user's recent rosters, recent public rosters feed, and All rosters

Figure out how to handle config in deploy.

Since I'm going all the way in on AWS with this project I should probably use secrets manager for my application config variables. Right now, we load them in via configs/default.py and I was hoping to template a configs/production.py

Either way, the app will not run in its current state without a good config setup

Wire app up to an actual database

Right now it just uses sqlite but not really. I'd like to explore the database settings/configuration in Lightsail and then store those credentials in the production config. Dunno if that's the best or if I should just add a db to my docker-compose.

Clean up javascript across rosters show/index

Right now the js in those files is slapped in and could use some reoganization. Consider using a better front-end framework than jQuery if we deem it valuable. Perhaps export js to assets dir.

Add db migration suite

Currently, all database modifications are done by hand or by sql scripts. Adding migrations to seed and structure the database are necessary for any future collaborative work and simpler deployments.

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.