The goal of this project is to discover Kotlin and Node.JS (REACT) through the creation of a business application. To do this,we have implemented a software suite that functions similar to that of IFTT and/or Zapier. This software suite will be broken into three parts :
- An application server to implement all the features listed below (see Features)
- A web client to use the application from your browser by querying the application server
- A mobile client to use the application from your phone by querying the application server
Thoses parts have to be shelter on docker and more precisely with docker-compose that use containers.
To install our project, you just have too clone our Github repository from here: AREA
$ git clone https://github.com/Jostyck9/AREA.git
$ cd AREA/
Like we said, we actually use docker, it's kind of easy to launch the project. But before, there is things we must talk. Our project use ngrok. Your must launch it before launching our project. How to launch ngrok:
$ cd ./AreaApi/
$ ./ngrok http 8080
This command create a communication tunnel between API's and our application.
API's ? Oh yeah, you have also things to do with that before starting the project. You have to modificate Two Files. Two .env file. One is in AreaWeb part, the other one is in the AreaApi part.
First we'll edit the AreaApi .env. Never close the terminal which is hosting ngrok !!
Open an other one, go inside our project folder. When you edit the .env file, don't edit the line above ServrUrl
line. For the SERVER_URL. Edit ID
with the link with your ngrok link.
You've see that below, you have a lots of items to provide. To have thoses items. Just sign up with thoses links and inquire the information in the .env
$ cd ./AreaApi/
$ nano .env
For Twitter, click here
* Visit [Twitter](https://developer.twitter.com/en/apps)
* Sign in with your twitter account
* Click on 'Create an app'
* Fill your Application details
* Enable Sign in with Twitter
* Add Callback URL = https://your-url-ngrok.io/auth/twitter/callback
* Click on 'Permissions'
* Click on 'Edit'
* Add 'Read, write, and Direct Messages' permissions
* Click on 'Keys and tokens'
* Click on 'Generate' access token and access secrete token
* Add your access token, access secret token, API key and API secret key inside the .env file
* Click on 'Dev environments'
* Click on 'Set up dev environment' for 'Account Activity API' section
* Select a name for your environment
* Select your app
* Add your environment name selected in the .env
For Spotify, click here
Spotify:
- Aller sur la platforme developper : https://developer.spotify.com/dashboard/login
- Connectez-vous
- Créer une application et remplissez les champs demandés (rien de special)
- Vous êtes apres redirigé sur la page de l'application
- Vous pouvez y voir le client-id et le client-secret mais caché (vous pouvez le montrer qd vs voulez), ce sont les CLES à mettre dans le .env de /AreaApi
- Faites "Edit settings"
- Mettez en url callback l'url en "https://...ngrok.io/auth/spotify/callback" de ngrok qu'il a généré
For Github, click here
* Visit [Github] (https://github.com/settings/developers)
* Sign in with your github account
* Create an 'OAuth AP'
* Fill the required fields (Application name, Homepage URL)
* Add Callback URL = https://your-url-ngrok.io/auth/github/callback
* Add your access tokens in your .env file
* Client ID as GITHUB_KEY
* Client secret as GITHUB_SECRET
For Discord, click here:
* Sign in with your Discord account
* Click on 'New Application'
* Register your app by giving it a name
* Click on 'Bot' on the left side panel then on 'Add Bot'
* Add your bot token in your .env file as DISCORD_TOKEN /!\ Be careful not to click on 'Reveal Token' or to push it on Github or it will make your bot token deprecated /!\
* Click on 'OAuth2' on the left side panel
* Check 'bot' on the 'scopes' panel
* Then on 'bot permissions' check the following
* View Audit Log
* View Server Insights
* Manage Channels
* View Channels
* Send Messages
* Read Message History
* Add the url that appeared on the 'scopes' panel in your .env file as DISCORD_BOT_URL (ex: https://discordapp.com/api/oauth2/authorize?client_id=0000000000&permissions=00000&scope=bot)
For Dropbox, click here
* Visit [Dropbox](https://www.dropbox.com/developers)
* Click on 'Create apps'
* Sign in with your Dropbox account
* Create a new app
* Select 'Dropbox API'
* Select 'Full Dropbox'
* Select a name for your app
* Click on 'Create app'
* Set up your app
* Add Redirect URI's = https://your-url-ngrok.io/auth/dropbox/callback
* Generated access token
* Click on 'Enable additional users'
* Click on 'Apply for production'
* Add 'App key' and 'App secret' inside the .env file
* Add Webhook URI's = https://your-url-ngrok.io/dropbox/webhook
* the server API and ngrok must be launch for this action (do this action at the end)
For Mail, click here Only outlook live or hotmail can work for the project
* Create your account and after it's done, just simply put your account in the MAIL and MAIL_PASSWORD env variables
SERVER_URL=https://ID.ngrok.io
TWITTER_ENV=
TWITTER_KEY=
TWITTER_SECRET=
GITHUB_KEY=
GITHUB_SECRET=
DISCORD_TOKEN=
DISCORD_APP_TOKEN=
DISCORD_BOT_URL=
SPOTIFY_KEY=
SPOTIFY_SECRET=
DROPBOX_KEY=
DROPBOX_SECRET=
MAIL=
MAIL_PASSWORD=
Now let's go in our AreaWeb folder.
$ cd ./AreaWeb/
$ nano .env
You hjust have to to two things.
REACT_APP_SERVER_AUTH=https://ID.ngrok.io
REACT_APP_SERVER_URI=http://your.beautiful.internet.protocol:8080 (192.168.1.1 like)
REACT_APP_URI=http://your.beautiful.internet.protocol:8081 (192.168.1.1 like)
Finally ! The configuration. You'll finally launch our project. To launch it, go to the root folder of our project and simply to this command
$ docker-compose build && docker-compose up
OR
$ docker-compose up --build
Like we said previsously, there is three parts in our project. You have to links. To acces to our API, open your browser and put this URL
But you'll see nothing. You just can access to our swagger documentation and test our project with request. To acces to swagger, got to this URL:
If you want to test our project with the web version just put this link in your browser:
You'll have to register. After this manipulation. Don't forget to link your github, Twitter and others services we offer. Go to the home page, and enjoy the creation of yours AREA's ! You want to do it and your smartphone ? Go here and download our free apk. Soon available on the Play Store
Services | Actions | Reactions |
---|---|---|
Discord | Messaged received A user joined A user is banned |
Send message Create channel |
Tweet |
Tweet |
|
Github | Push Pull request |
X |
Spotify | Music added |
Add music Play Music Pause music |
X |
Send mail |
|
Timer | To to interval |
X |
Dropbox | File is added File deleted |
X |
Twitch | X |
Stream started |
Get the about.json file with all the informations about the services
- A completed request will return a
200
response code, and inside the body a Json with the API informations as the services availables and the their actions / reactions - When performing an action that is restricted,
400
will be returned together with a json containing a message field.
Send a list of the user's Areas
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
- A completed request will return a
200
response code, and inside the body a Json with an array of all the area created by the user - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Create an area between an action and a reaction
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
BODY FIELD | VALUE |
---|---|
action_id | Required The id of the action to trigger |
reaction_id | Required The id of the reaction to perform |
action_parameters | Required The json with the action's parameters |
reaction_parameters | Required The json with the reaction's parameters |
- A completed request will return a
200
response code, and inside the body a Json with a message - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Get informations for a specific area
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
Path FIELD | VALUE |
---|---|
id | Required id of the area |
- A completed request will return a
200
response code, and inside the body a json containingthe area created by the user - When performing an action that is restricted,
404
or401
or403
will be returned together with a json containing a message field.
Delete a specific area
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
Path FIELD | VALUE |
---|---|
id | Required id of the area |
- A completed request will return a
200
response code, and inside the body a json with a message field - When performing an action that is restricted,
404
or401
or403
will be returned together with a json containing a message field.
Register the user inside our service
BODY FIELD | VALUE |
---|---|
name | Required The name of the user |
Required The email of the email | |
password | Required The password of the user |
- A completed request will return a
200
response code, and inside the body a Json with a token field and the token to use - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Login the user inside our service
BODY FIELD | VALUE |
---|---|
Required The email of the email | |
password | Required The password of the user |
- A completed request will return a
200
response code, and inside the body a Json with a token field and the token to use - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Login the user with github or associate his account with github (If no token given, create or log the user)
QUERY FIELD | VALUE |
---|---|
cb | Required The callback to redirect the user after loging |
token | Optional The token of the user |
- A completed request will redirect the user, and after completing connection, he will be redirect to the url given in
cb
with in query thestatus
that can beOK
||KO
and if he is connecting, atoken
field with our api token - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Associate account with dropbox
QUERY FIELD | VALUE |
---|---|
cb | Required The callback to redirect the user after loging |
token | Required The token of the user |
- A completed request will redirect the user, and after completing connection, he will be redirect to the url given in
cb
with in query thestatus
that can beOK
||KO
and atoken
field with our api token - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Associate account with spotify
QUERY FIELD | VALUE |
---|---|
cb | Required The callback to redirect the user after loging |
token | Required The token of the user |
- A completed request will redirect the user, and after completing connection, he will be redirect to the url given in
cb
with in query thestatus
that can beOK
||KO
and atoken
field with our api token - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Associate account with twitter, needs to use the ngrok base url in https
QUERY FIELD | VALUE |
---|---|
cb | Required The callback to redirect the user after loging |
token | Required The token of the user |
- A completed request will redirect the user, and after completing connection, he will be redirect to the url given in
cb
with in query thestatus
that can beOK
||KO
and atoken
field with our api token - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Associate account with discord
QUERY FIELD | VALUE |
---|---|
token | Required The token of the user |
- A completed request will redirect the user to the discord auth
- When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Log out the user out of our service api
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
- A completed request will return a
200
response code, and inside the body a Json with a message field - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Log out the user out of our service api from all his device
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
- A completed request will return a
200
response code, and inside the body a Json with a message field - When performing an action that is restricted,
404
or401
will be returned together with a json containing a message field.
Get the auth user informations
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
- A completed request will return a
200
response code, and inside the body a Json with a message - When performing an action that is restricted,
403
will be returned together with a json containing a message field.
Update password
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
BODY FIELD | VALUE |
---|---|
password | Required The password to be changed by the user |
- A completed request will return a
200
response code, and inside the body a Json with a message - When performing an action that is restricted,
403
will be returned together with a json containing a message field.
Update username
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
BODY FIELD | VALUE |
---|---|
username | Required The username to be changed by the user |
- A completed request will return a
200
response code, and inside the body a Json with a message - When performing an action that is restricted,
403
will be returned together with a json containing a message field.
Get name
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
- A completed request will return a
200
response code, and inside the body a Json with a message - When performing an action that is restricted,
403
will be returned together with a json containing a message field.
Get all the services auth and their status
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
- A completed request will return a
200
response code, and inside the body a Json Array with a name and boolean to know if the user is connected - When performing an action that is restricted,
403
will be returned together with a json containing a message field.
Get all the services auth and their status
HEADER FIELD | VALUE |
---|---|
Authorization | Required A valid access token from the Area Auth service |
BODY FIELD | VALUE |
---|---|
nameService | Required The nameService use to get all the services auth |
- A completed request will return a
200
response code, and inside the body a Json Array with a name and boolean to know if the user is connected - When performing an action that is restricted,
403
will be returned together with a json containing a message field.
Send a list of available services
- A completed request will return a
200
response code, and inside the body a Json Array with a list of all available services - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Send info about a service
BODY FIELD | VALUE |
---|---|
nameService | Required The nameService use to get all the services auth |
- A completed request will return a
200
response code, and inside the body a Json Array with a the service's informations. - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Get actions from a specified service
BODY FIELD | VALUE |
---|---|
nameService | Required The nameService use to get all the services auth |
- A completed request will return a
200
response code, and inside the body a Json Array with the actions of the specified service - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Get an action from a specified service
BODY FIELD | VALUE |
---|---|
nameService | Required The nameService use to get all the services auth |
nameAction | Required The nameAction use to get the information of it |
- A completed request will return a
200
response code, and inside the body a Json Array with specified action of the specified service - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Get reactions from a specified service
BODY FIELD | VALUE |
---|---|
nameService | Required The nameService use to get all the services auth |
- A completed request will return a
200
response code, and inside the body a Json Array with the reactions of the specified service - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Get reactions from a specified service
BODY FIELD | VALUE |
---|---|
nameService | Required The nameService use to get all the services auth |
nameReaction | Required The nameReaction use to get the information of it |
- A completed request will return a
200
response code, and inside the body a Json Array with specific reaction of the specified service - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Get a reaction from a specified service
BODY FIELD | VALUE |
---|---|
idReaction | Required The idReaction use it's own information |
- A completed request will return a
200
response code, and inside the body a Json Array with specific reaction of the specified service - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
Get a action from a specified service
BODY FIELD | VALUE |
---|---|
idAction | Required The idAction use it's own information |
- A completed request will return a
200
response code, and inside the body a Json Array with specific action of the specified service - When performing an action that is restricted,
401
to404
will be returned together with a json containing a message error field.
You can acces to different documentation. First one is the Swagger documentation on this URL:
In our repository, there is a pdf which explain each part of our project (Documentation.pdf)
You can also generate documentation from code. You just have to do this (Requirements -> yarn) :
$ cd ./AreaWeb/
$ yarn docs:build
$ firefox docs/index.html
$ cd ./AreaApi/
$ yarn docs:build
$ firefox docs/index.html
Hugo Berthome, Romane Bézier, Esther Bailloux, Clément Dumaine, Fabien Brosset and Gabin Warnier-de-Wailly