Skip to content

A system to handle the speakerlist on Datateknologsektionens meetings.

License

Notifications You must be signed in to change notification settings

Rembane/lemmingpants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lemmingpants

The purpose of this project is to develop a system to manage the speaker list of Datateknologsektionens meetings.

Feel free to fork, do pull requests and post issues!

The name is much inspired by DHack's totem animal, the lemming.

How to run a meeting

Lemmingpants has a Docker image to make deployment easier. To run a meeting you need the lemmingpants/backend-full image. It exposes ports 8000 for websockets and static files and 3000 for the API. One of the static files is the frontend application where you need to set the domain and ports you want to use.

Decide which combination of domains and ports you want to use and run deployment/boot_full_image.sh which will start the backend Docker image with the correct ports and URLs setup for you.

To terminate your SSL connection you can use Nginx. Example configuration below. Adjust ports, domains and so on to suit your needs.

server {
    server_name lemmingpants.example.com
    include ssl.configs/tls-ssl-server.conf;

    # The Postgrest API
    location /pg {
        # Remove the pg-prefix.
        rewrite ^/pg(/.*)$ $1 break;
        proxy_pass http://localhost:3000/;
    }

    # The websockets
    location /ws {
        rewrite ^/ws(/.*)$ $1 break;
        proxy_pass http://localhost:8000/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    # The static files
    location / {
        proxy_pass http://localhost:8000/;
    }
}

server {
    listen 80;
    listen [::]:80;

    server_name lemmingpants.example.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

Development

There are a couple of different ways to install all prerequisites for development, the most arduous one is below. Simple ones are coming, they will involve Docker.

For development you should be good to go if you install the programs below:

Initialize the database

createuser -P lemmingpants
createdb lemmingpants -O lemmingpants
echo 'ALTER DATABASE lemmingpants SET "app.jwt_secret" TO "thisisnotaverygoodsecret";' | psql -d lemmingpants
echo 'CREATE EXTENSION pgcrypto; CREATE EXTENSION pgjwt; CREATE EXTENSION pgtap;' | psql -d lemmingpants
psql -d lemmingpants < init.sql

Running in dev-mode

For development, the local web-server that serves the static resources is run with this command ./dev-server.sh

Building the frontend

Build the frontend by running make dev in the frontend/ directory.

Architecture

Postgrest is used for the backend REST API, while postgrest-websockets handles the websocket part. The backend code is written in SQL and PL/pgSQL. You can find it in init.sql and sql/ with subdirectories.

The frontend is written in Purescript using the library Purescript Halogen. The pretty stuff is made with Bourbon, Bitters and Neat on SASS.

Some references to tools used in this project:

About

A system to handle the speakerlist on Datateknologsektionens meetings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published