Git Product home page Git Product logo

backend's Introduction

Cadet

Build Status Coverage Status Inline docs License

Cadet is the web application powering Source Academy.

  • master is the main development branch, and may be broken, buggy, unstable, etc. It may not work with the frontend, if there are frontend changes that have not yet been merged.
  • stable is the stable branch and should work with the stable branch of the frontend. Note that stable may not have stable history!

Developer setup

System requirements

  1. Elixir 1.13.3
  2. Erlang/OTP 23.2.1
  3. PostgreSQL 13 or 14

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

License

License All sources in this repository are licensed under the Apache License Version 2.

backend's People

Contributors

alcen avatar angelsl avatar aulud avatar blackening avatar bnjmnt4n avatar cheng20010201 avatar chownces avatar chrystalquek avatar dependabot-preview[bot] avatar dependabot[bot] avatar evansb avatar flxffy avatar geshuming avatar indocomsoft avatar j0 avatar jiachen247 avatar jiayushe avatar jonas-chow avatar kevin9foong avatar lizchow avatar martin-henz avatar ning-y avatar rrtheonlyone avatar sciffany avatar seanlowjk avatar shenyicui avatar sreycodes avatar tuesmiddt avatar wong-zz avatar yalechen299 avatar

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.