Skip to content

Big school project talking about APIs and Webhooks, more information in README.md

Notifications You must be signed in to change notification settings

luannbertaud/YEP-Area

Repository files navigation

Better Uptime Badge Server: https://api.yep-area/
Better Uptime Badge UI: https://yep-area.cf
Containers
Mirror

Action REAction

About

This is the Area: Epitech year ead project, of Gildas Gonzalez, Baptiste Renouf, Van Hoang, Pablo Etienne and Luann Bertaud. The goal of this project is to implement a system of actions and reactions triggered by different services and APIs.

Deployment

All this project can be manage with docker-compose.
In order to pass your API keys to the container you can use a .env file, at the root of the repository. Here in an example. Also if you enable the SERV_ENABLE_SSL please provide the fullchain.pem (cert) and privkey.pem (key) files in api/certificates and web/certificates. In this case the server/web will only respond to https requests.
Then to start the containers simply run docker-compose up. /!\ If you decide to not start either the server or web container, be sure to update the nginx conf file for the reverse proxy. Also you can update this file to fit your dns.

If you want to try the REST API by only starting the server container, here is a postman collection containing some requests. And you can find the REST API documentation here.

Usage

Authentication:

You can register or login into the Area in two different ways.

Native auth:

  • email (required)
  • firstname (optional)
  • lastname (optional)
  • password

Third parts login: google

Services subscription

The services page allows you to authorize different services that will provide you several Actions or Reactions.

  • Github:
    • GithubWebhook (push), GithubWorkflowFailed, GithubNewPullRequest
    • GithubCreateIssue
  • Google:
    • GmailWebhook (new email)
    • GmailSendEmail
  • Spotify:
    • SpotifyTrackChangeWebhook, SpotifyMonthArtistChangeWebhook (top month artist)
    • SpotifyNext, SpotifyPlay (select a song)
  • Twitter:
    • TwitterTweet
  • Discord:
    • DiscordMessageReceived (on server)
    • DiscordMessage (send message)
  • Epitech:
    • EpitechNotifWebhook
  • Custom:
    • CustomPost (send payload to your endpoint)

Flow creation

After authorizing some services, you will be able to select some Applets to construct a flow. Some Applets may need to be configured at creation: for example for a GithubNewPullRequest you must provide the owner of the repository in order to allow the Area to monitor the right repository. After being created, each flow can be disable if needed.

Specs

  1. WEB

    • Architecture: SCS
    • Technologie: React
    • Served on: 8081
    • Developpers: Van, Pablo
  2. MOBILE

    • Architecture: SCS
    • Technologie: React Native
    • Build: Put the apk in web shared volume
    • Developpers: Gildas, Baptiste
  3. SERVER

    • Architecture: MC
    • Technologie: Python3
    • Served on: 8080
    • Developper: Luann
  4. DATABASE

    • Architecture: see table scheme below
    • Technologie: Postgresql
    • Served on: 5432
    • Developper: Luann

USERS TABLE

Uuid Name Password Email googleToken oauth
PrimaryKey User name User password (if not googleLogin) User email if provided GoogleLogin token (null if native auth) Authenticated service tokens

ACTIONS TABLE

Uuid Title Description Type User uuid Enabled Content Children
PrimaryKey Action Title Action Description Area Action Type (ex: GithubNewPullRequest) Uuid of action owner Action state Action parameters Reactions to trigger

REACTIONS TABLE

Uuid Title Description Type User uuid Enabled Content
PrimaryKey Reaction Title Reaction Description Area Reaction Type (ex: GithubCreateIssue) Uuid of reaction owner Reaction state Reaction parameters

DBDATA TABLE

Version
Version of database (For migration purposes)


  • drawing Gildas Gonzalez
  • drawing Baptiste Renouf
  • drawing Van Hoang
  • drawing Pablo Etienne
  • drawing Luann Bertaud