Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 2.02 KB

README.md

File metadata and controls

56 lines (35 loc) · 2.02 KB

Mensaplan

Garching's hottest new tool to find friends while eating.

Features

  • Cool and responsive web interface
  • Current mensa menu with food ratings
  • Private groups for friend groups, clubs, ...
  • API for (Discord) Bots like WoBot

phone.png PC.png

Techstack

  • Elixir and Phoenix for the backend
  • HEEx (HTML + Embedded Elixir) and TailwindCSS for the frontend

Developing

Running

  • Run mix setup to install and setup dependencies
  • Start the Phoenix server with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Authentication

Authentication is done via Discord, so you'll need to

  • Setup an Application
  • Add http://localhost:4000/auth/discord/callback to the OAuth2 -> Redirects.
  • Save the Client ID and Client Secret, you need to pass them as environment variables. For example put them into a .env file and then run export $(cat .env | xargs).

You can also use uberauth directly with your favorite OpenID provider, add the strategy to mix.exs, configure it in config.exs and replace the sign-in link.

User ids < 10 are reserved, these ids can only be assigned via direct DB access. User 1 is considered admin and can access special pages like the Dashboard. User 2 is used for the API, for example groups created via the API are owned by User 2.

API

The API uses the environment variable API_TOKEN to authorize requests, they need to include it as a bearer token.

Deploying

Wherever you want, requirements: can run Elixir and has a database.

Don't forget to set the environment variables.

I use Gigalixir. New versions are deployed with git push gigalixir main.