Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.
/ cadet Public archive
forked from source-academy/backend

The backend powering Source Academy.

License

Notifications You must be signed in to change notification settings

geshuming/cadet

 
 

Repository files navigation

Cadet

Build Status Coverage Status Inline docs

Cadet is the web application powering Source Academy.

Developer Setup

System Requirements

  1. Elixir 1.8
  2. Erlang/OTP 21
  3. PostgreSQL (>= 9.6)

Setting Up Local Development Environment

  1. Setup the development secrets (replace the values appropriately)
$ cp config/secrets.exs.example config/secrets.exs
$ vim config/secrets.exs
  • A valid luminus_api_key, luminus_client_id, luminus_client_secret and luminus_redirect_url are required for the application to properly authenticate with LumiNUS.
  • A valid cs1101s_repository, cs1101s_rsa_key is required for the application to run with the --updater flag. Otherwise, the default values will suffice.
  1. Install Elixir dependencies
$ mix deps.get
  1. Initialise development database
$ mix ecto.setup
  1. Run the server in your local machine
$ mix phx.server
  1. 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 access_token JWT of a user with a given role by simply running:

$ mix cadet.token <role>

For more information, run

$ mix help cadet.token

Handling CORS Preflight Request

We recommend setting up nginx to handle preflight checks using the following config file.

If you do this, do remember to point cadet-frontend to port 4001 instead of 4000

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

Last generated on 1 January 2019

Entity-Relationship Diagram for cadet

License

MIT

About

The backend powering Source Academy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 96.8%
  • HCL 3.2%