· 6 years ago · Oct 15, 2019, 11:04 AM
1# Plutus Bank API
2
3'/register': Provides API functionality for registering user credentials and gesture data with the Bank API and the Gesture API.
4'/auth': Provides functionality for authenticating a user, either with username and password, or username and gesture data.
5After successful authentications, returns a token inside a JSON response which can be used to authenticate further interactions with the Bank API.
6'/reset': Provides functionality for reseting a password in the Bank and Gesture APIs.
7'/clear': Provides functionality for clearing a user record and gesture data stored by the Gesture API.
8'/helloworld/<token>': Provides a helloworld endpoint which requires a token to authenticate, returning some sample response.
9
10# Installation
11
12Installation is pretty straight forward. Create a Centos 7 EC2 (AMI
13ami-9887c6e7) with the staging key, preferrably in the Public Subnet with a
14Public IP enabled. Give it the 'Cyber Concepts Staging SG' so that you can SSH
15into it. Add a security group for it with port 80 enabled for all IPs
16(0.0.0.0/0)
17
18SSH into the staging server (public IP), then SSH into the newly created EC2
19(private IP). The user for the staging server is Ubuntu, the user for the new
20server is centos
21
22```bash
23ssh ubuntu@<ip>
24
25ssh centos@<ip>
26```
27
28Install epel-release, git, python36, python36-pip, python36-virtualenv, nginx,
29make
30
31```bash
32sudo yum install epel-release git
33sudo yum install python36 python36-pip python36-virtualenv
34sudo yum install nginx make
35```
36
37Remove the default server from the `/etc/nginx/nginx.conf`
38
39Clone the Bank API repo, cd into it, run `make` to install the rest.
40
41The Bank API should now be reachable through port 80