pereztr5 / cyboard

Scoring engine for cyber defense competitions
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

Project Refactoring #36

Closed tbutts closed 6 years ago

tbutts commented 6 years ago

Applied some TLC across many source files, and the design of the http endpoints. I'm looking to make further sweeping changes that build on top of this.

Commit log:

Revert "Merge pull request #33 from pereztr5/grafana-pg"

    My goal is to roll the grafana graphs ourselves, removing the
    dependency of a whole service, which wasn't able to produce
    all the visualizations we wanted anyway.

    This reverts commit 11e0648cbc1ba1e989c196145bcf1bb8131847e5, reversing
    changes made to 26f6ceb9d23f08ce79963a6a4717aaf8c6e2ee10.

Models: Refactor core app structs into `models`

    This is the start of my efforts to clean up and apply best practices,
    as the source code is pretty tangled as it stands.

Server: Rejigger many http endpoints, middleware

    This commit cleanly separates out:
    * static assets
    * server rendered templates
    * API endpoints

    Using gorilla/mux's new built in middleware support, the route building
    has been made cleaner than with good ol' negroni. While I like negroni,
    the API mixed with gorilla, mixed with the go stdlib can be confusing.
    Trying to use plain old http.Handlers as middleware methods feels
    cleaner. Or perhaps just having spent the time figuring all the logic
    out is what's giving me confidence here.

Reorganize src files for handlers, templates, etc.

server: Rename a few files