Skip to content

jiayushe/cadet-backend

 
 

Repository files navigation

Cadet

Build Status Coverage Status Inline docs License

Cadet is the web application powering Source Academy.

Developer setup

System requirements

  1. Elixir 1.10.4
  2. Erlang/OTP 23.0.3
  3. PostgreSQL 11.8

It is probably okay to use a different version of PostgreSQL or Erlang/OTP, but using a different version of Elixir may result in differences in e.g. mix format.

Setting up your local development environment

  1. Set up the development secrets (replace the values appropriately)

    $ cp config/dev.secrets.exs.example config/dev.secrets.exs
    $ vim config/dev.secrets.exs
  • To use LumiNUS authentication, specify a valid LumiNUS api_key. Note that the frontend will supply the ADFS client ID and redirect URL (so you will need that too, but not here).
  1. Install Elixir dependencies

    $ mix deps.get
  2. Initialise development database

    $ mix ecto.setup
  3. Run the server on your local machine

    $ mix phx.server
  4. You may now make API calls to the server locally via localhost:4000. The API documentation can also be accessed at http://localhost:4000/swagger.

Obtaining access_token in dev environment

You can obtain an access_token JWT for a user with a given role by simply running:

$ mix cadet.token <role>

For more information, run

$ mix help cadet.token

Style Guide

We follow this style guide: https://github.com/lexmag/elixir-style-guide and https://github.com/christopheradams/elixir_style_guide

Where there is a conflict between the two, the first one (lexmag) shall be the one followed.

Entity-Relationship Diagram

Generated with DBeaver on 17 October 2020

Entity-Relationship Diagram for cadet

About

Backend of Source Academy (Elixir, Ecto, Phoenix, PostgreSQL)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 96.9%
  • HCL 3.1%