Code Monkey home page Code Monkey logo

tief-gang-list's Introduction

Tief-Gang-List

This project is a guest management software for events in the Tiefgang Hackspace.

Its main purpose is to enable the Tiefgang crew to better plan their events and to smoothen the reception of guests.

Planned Features

  • Web-Interface for crew members that greet guests at the entry.
    • Easy search for registered people.
    • Simple counter to keep track on the amount of people that're currently on-site.
    • On-site registration for unexpected guests.
    • QR code scanner for people that registered beforehand. (Send via email)
  • Integration with Google Forms to automatically keep track of registrations to an event.
    • Eventually build our own site for guest registration.
  • Management of several events.
  • ...

Project Architecture

Backend

The backend is composed of a simple FastAPI server that's connected to an SQLite database.

Frontend

TODO

Infrastructure Architecture

TODO

tief-gang-list's People

Contributors

dasmerlon avatar dependabot[bot] avatar nukesor avatar

Stargazers

 avatar

Watchers

 avatar  avatar

tief-gang-list's Issues

Think about admin/login

We probably should add some kind of authentication, we need to think about our planned features/views and whether we want to gate some things.

People counting functionality

As discussed, the idea is to track how many people there're currently on-site.

Though, we don't want to track this on a per-guest basis, as we don't want to track our guest.

The idea would be to have a new table.
We then create a new row each time a guest enters or leaves the bunker.
Each row must be associated with an event.

That way, we'll have a good understanding when guests arrive and leave over the course of an event.

I'm not sure how this table should be named though :D

  • guest_count
  • count
  • people_count

"Count" seems a bit misleading, as there's no row with the "total" count.
We rather calculate the current count based on all rows for an events.

Something with arrival would be misleading as well, as this table contains both, arrivals and departure.

We need a word that describes both departures and arrivals :D

Basic Forms

Add basic forms to create and edit new Events.

Those should be on a separate page, as this should work on mobile as well.

Switch to Postgresql

There's no easy way for us to enforce SQLite's foreign key checks with the sqlalchemy fastapi middleware library we're using.

Hence, we should just use a database that's designed for this stuff :D
Let's switch to postgres.

In code:

  • Replace id fields with actual UUID postgres dialect columns
  • Use a local postgresql URI instead of the current sqlite URI
    The rest should stay the same

Out of code:

  • Set up postgresql.
# Install and start postgres
sudo pacman -S postgresql
sudo systemctl enable --now postgresql

# Login as postgres user
sudo su postgres
# Use the createuser helper to create a new database user
# Make sure it has the same name as your linux user
createuser merlon --superuser
# We make your user a supersuer, since you have to create,
# modify and drop databases during development.
# I also adivise to use no password, as we don't save
# anything important in that database anyway.

That should be it :)

Build a basic layout

So, we should have a simple base-layout with:

  • A title
  • Navigation
  • Page content

Everything should be responsive, so the sidebar navigation should convert into something as soon as the screen get's too small

Refactor module scopes

We decided to refactor our python module setup

Models

Database models should be all reimported to app.models.

Models will then be used in combination with that module:
E.g. user = models.User()

Schemas

The goes same for schemas. This allows us to easily see which kind of class we're working with, since they're all named similarily.

Crud

The current crud setup looked good to me.
We currently call stuff like this: crud.user.get.

We might think about using some kind of class abstraction lateron, which implements crud operations for us. This makes the code more generic and decreases boilerplate code, but also makes code a bit less clear, which is why we'll do this at a later stage.

Example for base class: https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/crud/base.py

Seed data

Add a seed subcommand to cli.

This should then call a function which creates some seed data.
I.e. a Guest, an Event and a Registration for that guest + event.

Since this will be outside of a request, the Sqlalchemy-fastapi middleware won't work and we have to create a session manually. This can be done using the scoped_session + sessionmaker functions as can be seen over here:

https://github.com/Nukesor/ultimate-poll-bot/blob/main/pollbot/db.py#L22

Commandline interface

Let's create a small convenience commandline interface.

typer seems to be a reasonable choice for this.
It's fairly straight forward and looks really convenient.

I would propose to have several subcommands:

  • poetry run python ./main run Just start the web server
  • poetry run python ./main createdb Create the database, enable extensions and create the schema
  • poetry run python ./main dropdb Drop the database

We can add other functionalities lateron :)

The Justfile should get shortcuts for those:

  • createdb
  • dropdb
  • resetdb, which is basically a creatdb + dropdb

Database investigation

It would be a good idea to take a look at some database technologies:

  • Setup sqlite3
    • Create a tiefgang database
    • Create a new user table via SQL with a name: str and id: uuid field.
  • Take a look at how to use sqlalchemy's orm feature.
  • Create database models for the schemas that already exist
  • Add some simple logic for adding/removing a user via a route.

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.