Git Product home page Git Product logo

rota-api's Introduction

Rota API

A simple rota management application, written in Scala.

Installation (macOS)

  1. Install Scala and SBT
brew install coursier/formulas/coursier && cs setup && brew install sbt
  1. Install dependencies and start the local server:
sbt run

The API should now be running on http://localhost:3000

Tests

sbt test

Deploy

The application is packaged into a fat JAR using sbt-assembly, then a Docker image is built from this JAR and deployed to a fly.io instance using the fly CLI tool.

sbt packageApplication && fly deploy

Authentication

This API does not currently support authentication or authorization.

rota-api's People

Contributors

russellyeo avatar

Watchers

 avatar

Forkers

aytenaker

rota-api's Issues

Update a rota

Update an existing rota

PATCH /rotas/:id

  • name - string, optional
  • description - string, optional
  • assigned - string, optional

Add users to a rota

Add users to a rota

POST    /rotas/:id/users
  • users - array of strings, required

Create staging environment

In order to test changes without breaking things in production, I would like to have a separate staging environment for the rota api

Requirements

  • Set up a staging database in supabase
  • Create a new application on fly.io for the staging application, with the necessary secrets to point to the new supabase database
  • Split the fly.toml configuration into 2 files (fly.production.toml and fly.staging.toml) pointing the latter to the new application
  • Update Makefile with commands to deploy to each environment

e.g.

fly deploy --config fly.staging.toml

Resources

Store Slack installations

Add a new database table to store Slack installations and tokens for OAuth authentication

Resources

Example

{
  team: { id: 'T012345678', name: 'example-team-name' },
  enterprise: undefined,
  user: { token: undefined, scopes: undefined, id: 'U01234567' },
  tokenType: 'bot',
  isEnterpriseInstall: false,
  appId: 'A01234567',
  authVersion: 'v2',
  bot: {
    scopes: [
      'chat:write',
    ],
    token: 'xoxb-244493-28*********-********************',
    userId: 'U012345678',
    id: 'B01234567'
  }
}

Tables

slack_installations

Column Name Data Type Description Constraints
team_id text The unique identifier of the Slack Team where the app is installed. Primary Key
user_id text The unique identifier of the user in context.
token_type text The type of token being used.
is_enterprise_install boolean Flag indicating whether the application is installed in an enterprise-wide context.
app_id text The unique identifier of the installed Slack application.
auth_version text Version of the authorization protocol used.
bot_id text The unique identifier of the bot associated with the installation.

slack_bots

Column Name Data Type Description Constraints
id text The primary key of the table, used to uniquely identify each bot. Primary Key
token text The token used to authenticate the bot.
user_id text The user who owns or manages the bot.

slack_bot_scopes

Column Name Data Type Description Constraints
bot_id text The identifier corresponding to a particular bot. Foreign Key (References id from slack_bots table)
scope text The scope or permissions for a particular bot.

The table definition in markdown format with PostgreSQL data types would be:

slack_teams

Column Name Data Type Description Constraints
id text The unique identifier of a Slack Team. Primary Key
team text The name of the Slack team.
is_enterprise boolean Flag indicating whether the team is an enterprise team.

slack_users

Column Name Data Type Description Constraints
id text The unique identifier of a Slack user. Primary Key
token text The token used to authenticate the user. Optional field. None

slack_user_scopes

Column Name Data Type Description Constraints
user_id text The identifier corresponding to a particular user. Foreign Key (References id from slack_users table)
scope text Defines the scope or permissions for a particular user. None

Insert a new rota

Insert a new rota

POST /rotas/
  • name - string, required
  • description - string, optional

Authentication

App: rota-api

This is the feature branch for several issues related to authentication

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.