Skip to content

Commit 0800277

Browse files
author
Ivan Vaskevych
committed
first commit
0 parents  commit 0800277

30 files changed

+550
-0
lines changed

.deploy/mup.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = {
2+
servers: {
3+
one: {
4+
host: 'TODO place hostname or IP of the server that will be running the portal (it should have Docker installed)',
5+
username: 'TODO username for the above',
6+
pem: 'TODO ssh key for the above'
7+
}
8+
},
9+
10+
meteor: {
11+
name: 'airly-dev-portal',
12+
path: '../',
13+
port: 9090,
14+
servers: {
15+
one: {},
16+
},
17+
buildOptions: {
18+
serverOnly: true,
19+
},
20+
env: {
21+
ROOT_URL: 'https://apiportal.airly.eu/ TODO change me',
22+
MONGO_URL: 'mongodb://localhost/meteor',
23+
PORT: 9090,
24+
},
25+
26+
dockerImage: 'abernix/meteord:base',
27+
deployCheckWaitTime: 60,
28+
29+
enableUploadProgressBar: true
30+
},
31+
32+
mongo: {
33+
oplog: true,
34+
port: 27017,
35+
version: '3.4.1',
36+
servers: {
37+
one: {},
38+
},
39+
},
40+
};

.deploy/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"public": {
3+
4+
}
5+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.idea

.meteor/.finished-upgraders

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file contains information which helps Meteor properly upgrade your
2+
# app when you run 'meteor update'. You should check it into version control
3+
# with your project.
4+
5+
notices-for-0.9.0
6+
notices-for-0.9.1
7+
0.9.4-platform-file
8+
notices-for-facebook-graph-api-2
9+
1.2.0-standard-minifiers-package
10+
1.2.0-meteor-platform-split
11+
1.2.0-cordova-changes
12+
1.2.0-breaking-changes
13+
1.3.0-split-minifiers-package
14+
1.4.0-remove-old-dev-bundle-link
15+
1.4.1-add-shell-server-package

.meteor/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local

.meteor/.id

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file contains a token that is unique to your project.
2+
# Check it into your repository along with the rest of this directory.
3+
# It can be used for purposes such as:
4+
# - ensuring you don't accidentally deploy one app on top of another
5+
# - providing package authors with aggregated statistics
6+
7+
6ze20rn5zlcbp9mx5q

.meteor/packages

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Meteor packages used by this project, one per line.
2+
# Check this file (and the other files in this directory) into your repository.
3+
#
4+
# 'meteor add' and 'meteor remove' will edit this file for you,
5+
# but you can also edit it by hand.
6+
7+
[email protected] # Packages every Meteor app needs to have
8+
[email protected] # Packages for a great mobile UX
9+
[email protected] # The database Meteor supports right now
10+
[email protected] # Compile .html files into Meteor Blaze views
11+
[email protected] # Reactive variable for tracker
12+
[email protected] # Helpful client-side library
13+
[email protected] # Meteor's client-side reactive programming library
14+
15+
[email protected] # CSS minifier run for production mode
16+
[email protected] # JS minifier run for production mode
17+
[email protected] # ECMAScript 5 compatibility for older browsers.
18+
[email protected] # Enable ECMAScript2015+ syntax in app code
19+
[email protected] # Server-side component of the `meteor shell` command
20+
21+
22+
23+
twbs:bootstrap
24+
25+
26+
accounts-facebook
27+
accounts-google
28+
github-config-ui
29+
facebook-config-ui
30+
google-config-ui
31+
force-ssl
32+
meteorhacks:kadira
33+
meteorhacks:zones

.meteor/platforms

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server
2+
browser

.meteor/release

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.meteor/versions

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
meteorhacks:[email protected]
58+
meteorhacks:[email protected]
59+
meteorhacks:[email protected]
60+
meteorhacks:[email protected]
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Web portal for a Kong-based API access
2+
3+
## Purpose
4+
You use [Kong](https://github.com/Kong/kong) to authenticate your API users and you registered your first few manually.
5+
Now it's time to automate the process, but you don't have spare time to create a complicated portal for your users, just yet.
6+
This **API portal** would give your users an opportunity to register and get Kong auth credentials to start using your API.
7+
8+
## Features
9+
There are two main functions:
10+
1. Registration: users can register. That way you have a base of your users.
11+
- Email login and registration: users can register using email and get a confirmation link to their inbox. Only having confirmed the email registration can she get an API key.
12+
- GitHub account login
13+
- Google account login
14+
- Other OAuth integrations are easily added if needed and supported by Meteor (e.g, Facebook)
15+
2. Get an API access key (create a [Kong authentication key](https://getkong.org/plugins/key-authentication/), store it into the Portal's DB and display to the user).
16+
17+
## Usage
18+
This is a template project. You have to enter your infrastructure information, change branding.
19+
Having done this, you can [deploy](#meteor-up-quick-deployment) and start using it.
20+
21+
- There are *TODO* bookmarks throughout the code. Those need to be changed to reflect your infrastructure.
22+
- When freshly installed (or after *meteor reset*), in the *Sign in* dropdown you'll find 'Configure xxxx Login' links in red. Follow the instructions to configure the authentication.
23+
- You'll find Airly logos, URLs, etc. They need to be changed to reflect your brand, URLs and other information.
24+
25+
## Meteor UP quick deployment
26+
There are several methods of deploying the portal. [[1]](https://guide.meteor.com/deployment.html)
27+
To make it easy you can use [Meteor UP](https://github.com/zodern/meteor-up).
28+
All you need to do is:
29+
- install [Docker](https://www.docker.com/) on the server
30+
- install Meteor UP locally
31+
- change *.deploy/mup.js*
32+
- run the deployment as below
33+
```bash
34+
cd .deploy
35+
mup deploy
36+
```
37+
38+
#### Disclaimer
39+
UX is minimalistic, you won't find a trendy UI here.

client/main.css

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* CSS declarations go here */
2+
3+
.navbar-brand {
4+
padding: 5px 15px;
5+
}
6+
7+
8+
.login-buttons-dropdown-align- {
9+
padding-top: 18px;
10+
}

client/main.html

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
4+
<title>Airly API portal</title>
5+
6+
<!-- Favicons -->
7+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
8+
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
9+
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
10+
<link rel="manifest" href="/manifest.json">
11+
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
12+
<meta name="theme-color" content="#ffffff">
13+
</head>
14+
15+
<body>
16+
17+
<nav class="navbar navbar-inverse navbar-fixed-top">
18+
<div class="container">
19+
<div class="navbar-header">
20+
<a class="navbar-brand" href="#">
21+
<img alt="Airly" src="/img/logo.png" height="42">
22+
</a>
23+
{{> loginButtons}}
24+
</div>
25+
<div class="navbar-right">
26+
</div>
27+
</div>
28+
</nav>
29+
30+
<div class="jumbotron">
31+
<div class="container">
32+
<h1>Welcome to Airly API portal</h1>
33+
{{> apiKey}}
34+
</div>
35+
</div>
36+
37+
<div class="container">
38+
<div class="row">
39+
<div class="col-md-6">
40+
<h2>Android App</h2>
41+
<p>If you didn't know, we have a handy app for you<a></a></p>
42+
<p><a class="btn btn-default" href="https://play.google.com/store/apps/details?id=eu.airly.android"
43+
role="button">Get it »</a></p>
44+
</div>
45+
<div class="col-md-6">
46+
<h2>Suggestions, issues?</h2>
47+
<p>Feel free to contact us any time</p>
48+
<p><a class="btn btn-default" href="mailto:[email protected]" role="button">Email us »</a></p>
49+
</div>
50+
</div>
51+
52+
<hr>
53+
54+
<footer>
55+
<div class="col-sm-9">
56+
© 2017 <a href="https://airly.eu">Airly, Inc.</a>
57+
</div>
58+
<div class="col-sm-3">
59+
<p>by Ivan Vaskevych</p>
60+
</div>
61+
</footer>
62+
</div> <!-- /container -->
63+
64+
</body>
65+
66+
67+
<template name="apiKey">
68+
{{#if showGetAccessButton}}
69+
<p><a class="btn btn-primary btn-lg" href="#" role="button" id="getAccess">Get API access »</a></p>
70+
{{/if}}
71+
72+
{{#if notLoggedIn}}
73+
<div class="alert alert-warning" role="alert">Please login in order to get an API access key.</div>
74+
{{else if notVerified}}
75+
<div class="alert alert-warning" role="alert">Please verify your account first. Check your mailbox for a
76+
verification email. Check spambox as well, just in case...
77+
</div>
78+
{{else if accessKey}}
79+
<div class="alert alert-info" role="alert">Congratulations, you've got your access to Airly API! Your api key
80+
is: <br>
81+
<b>{{accessKey}}</b>
82+
</div>
83+
<p>Next steps:</p>
84+
<ul>
85+
<li>Goto <a href="http://apidocs.airly.eu/">API docs</a></li>
86+
<li>Click Authorize and enter your key</li>
87+
<li>Play around with the requests available</li>
88+
<li>Make an app or device that will change the world. Or become famous. Or both.</li>
89+
</ul>
90+
{{/if}}
91+
92+
{{#unless accessKey }}
93+
<a class="btn btn-info btn-lg" role="button" href="http://apidocs.airly.eu/">API docs »</a>
94+
{{/unless}}
95+
96+
{{> tosModalTemplate}}
97+
</template>
98+
99+
<template name="tosModalTemplate">
100+
<div class="modal fade" id="tosModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
101+
<div class="modal-dialog" role="document">
102+
<div class="modal-content">
103+
<div class="modal-header">
104+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
105+
aria-hidden="true">&times;</span></button>
106+
<h4 class="modal-title" id="myModalLabel">Terms of Service</h4>
107+
</div>
108+
<div class="modal-body">
109+
<p>
110+
<input type="checkbox" id="acceptedCheckbox">
111+
I read the <a target="_blank" href="/api-tos-en.pdf">Terms of Service</a> and accept.
112+
</p>
113+
</div>
114+
<div class="modal-footer">
115+
<button type="button" class="btn btn-default" data-dismiss="modal">Disagree</button>
116+
<button type="button" class="btn btn-primary" id="accept" disabled>I Accept</button>
117+
</div>
118+
</div>
119+
</div>
120+
</div>
121+
</template>

0 commit comments

Comments
 (0)