├── .dockerignore
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── Screenshot.png
├── docker-compose.yml
├── frontend
├── .babelrc
├── .dockerignore
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── Dockerfile
├── README.md
├── build
│ ├── build.js
│ ├── check-versions.js
│ ├── dev-client.js
│ ├── dev-server.js
│ ├── utils.js
│ ├── webpack.base.conf.js
│ ├── webpack.dev.conf.js
│ └── webpack.prod.conf.js
├── config
│ ├── base.env.js
│ ├── dev.env.js
│ ├── index.js
│ ├── prod.env.js
│ └── test.env.js
├── index.html
├── package.json
├── src
│ ├── api.js
│ ├── auth.js
│ ├── components
│ │ ├── App.vue
│ │ ├── Service.vue
│ │ ├── Services.vue
│ │ ├── Settings.vue
│ │ └── UserMenu.vue
│ ├── config.js
│ ├── main.js
│ └── utils
│ │ └── notifications.js
├── static
│ ├── .gitkeep
│ ├── favicon.ico
│ ├── images
│ │ ├── icons
│ │ │ ├── atlassian.png
│ │ │ ├── authorizedotnet.jpg
│ │ │ ├── aws.png
│ │ │ ├── azure.png
│ │ │ ├── bitbucket.png
│ │ │ ├── box.png
│ │ │ ├── chargify.png
│ │ │ ├── circleci.png
│ │ │ ├── cloudflare.png
│ │ │ ├── codeclimate.png
│ │ │ ├── codeship.png
│ │ │ ├── compose.png
│ │ │ ├── datadog.png
│ │ │ ├── disqus.png
│ │ │ ├── dnsimple.png
│ │ │ ├── do.png
│ │ │ ├── docker.png
│ │ │ ├── dropbox.png
│ │ │ ├── duo.png
│ │ │ ├── dyn.png
│ │ │ ├── fastly.png
│ │ │ ├── ftrack.png
│ │ │ ├── gcloud.png
│ │ │ ├── github.png
│ │ │ ├── gitlab.png
│ │ │ ├── gocardless.png
│ │ │ ├── gotomeeting.png
│ │ │ ├── harvest.png
│ │ │ ├── hashicorp.png
│ │ │ ├── heroku.png
│ │ │ ├── honeybadger.png
│ │ │ ├── linode.png
│ │ │ ├── loggly.jpg
│ │ │ ├── mailgun.png
│ │ │ ├── maxcdn.png
│ │ │ ├── newrelic.png
│ │ │ ├── npm.png
│ │ │ ├── opbeat.png
│ │ │ ├── packagecloud.png
│ │ │ ├── pagerduty.png
│ │ │ ├── pingdom.png
│ │ │ ├── pingidentity.png
│ │ │ ├── pusher.png
│ │ │ ├── pyinfra.png
│ │ │ ├── quay.png
│ │ │ ├── redislabs.png
│ │ │ ├── rollbar.png
│ │ │ ├── rubygems.png
│ │ │ ├── sendgrid.png
│ │ │ ├── sendwithus.png
│ │ │ ├── sentry.png
│ │ │ ├── shotgun.png
│ │ │ ├── slack.png
│ │ │ ├── sparkpost.png
│ │ │ ├── statusio.png
│ │ │ ├── statuspage.png
│ │ │ ├── stormpath.png
│ │ │ ├── stripe.png
│ │ │ ├── travis.png
│ │ │ ├── twilio.png
│ │ │ ├── victorops.png
│ │ │ ├── vultr.png
│ │ │ └── weblate.png
│ │ ├── loading.gif
│ │ └── logo.png
│ └── main.css
└── yarn.lock
├── isserviceup
├── __init__.py
├── api
│ ├── __init__.py
│ ├── auth.py
│ ├── status.py
│ └── user.py
├── app.py
├── celeryapp.py
├── config
│ ├── __init__.py
│ ├── celery.py
│ ├── config.py
│ └── gunicorn.py
├── helpers
│ ├── __init__.py
│ ├── decorators.py
│ ├── exceptions.py
│ ├── github.py
│ └── utils.py
├── managers.py
├── models
│ ├── __init__.py
│ ├── favorite.py
│ └── user.py
├── notifiers
│ ├── __init__.py
│ ├── cachet.py
│ ├── notifier.py
│ └── slack.py
├── services
│ ├── __init__.py
│ ├── atlassian.py
│ ├── authorizedotnet.py
│ ├── aws.py
│ ├── azure.py
│ ├── bitbucket.py
│ ├── box.py
│ ├── chargify.py
│ ├── circleci.py
│ ├── cloudflare.py
│ ├── codeclimate.py
│ ├── codeship.py
│ ├── compose.py
│ ├── datadog.py
│ ├── digitalocean.py
│ ├── disqus.py
│ ├── dnsimple.py
│ ├── docker.py
│ ├── dropbox.py
│ ├── duo.py
│ ├── dyn.py
│ ├── fastly.py
│ ├── ftrack.py
│ ├── gcloud.py
│ ├── github.py
│ ├── gitlab.py
│ ├── gocardless.py
│ ├── gotomeeting.py
│ ├── harvest.py
│ ├── hashicorp.py
│ ├── heroku.py
│ ├── honeybadger.py
│ ├── linode.py
│ ├── loggly.py
│ ├── mailgun.py
│ ├── maxcdn.py
│ ├── models
│ │ ├── __init__.py
│ │ ├── gitlab.py
│ │ ├── service.py
│ │ ├── statusio.py
│ │ ├── statuspage.py
│ │ └── weblate.py
│ ├── newrelic.py
│ ├── npm.py
│ ├── opbeat.py
│ ├── packagecloud.py
│ ├── pagerduty.py
│ ├── pingdom.py
│ ├── pingidentity.py
│ ├── pusher.py
│ ├── pypi.py
│ ├── quay.py
│ ├── redislabs.py
│ ├── rollbar.py
│ ├── rubygems.py
│ ├── sendgrid.py
│ ├── sendwithus.py
│ ├── sentry.py
│ ├── shotgun.py
│ ├── slack.py
│ ├── sparkpost.py
│ ├── statusio.py
│ ├── statuspage.py
│ ├── stormpath.py
│ ├── stripe.py
│ ├── travis.py
│ ├── twilio.py
│ ├── victorops.py
│ ├── vultr.py
│ └── weblate.py
└── storage
│ ├── __init__.py
│ ├── favorites.py
│ ├── services.py
│ ├── sessions.py
│ └── users.py
├── requirements.in
├── requirements.txt
└── shared
└── .gitkeep
/.dockerignore:
--------------------------------------------------------------------------------
1 | .git
2 | frontend/node_modules/**/*
3 | frontend/node_modules
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 | *.pyc
3 | .idea
4 | .env*
5 | celerybeat*
6 | static
7 | shared/*
8 | !shared/.gitkeep
9 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:3.5
2 |
3 | RUN useradd --user-group --create-home --shell /bin/false app
4 |
5 | ENV INSTALL_PATH /isserviceup
6 | RUN mkdir -p $INSTALL_PATH && chown app:app $INSTALL_PATH
7 |
8 | WORKDIR $INSTALL_PATH
9 |
10 | COPY requirements.txt requirements.txt
11 | RUN pip install -r requirements.txt
12 |
13 | USER app
14 |
15 | COPY . .
16 |
17 | CMD gunicorn -c "isserviceup/config/gunicorn.py" isserviceup.app:app
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IsServiceUp
2 |
3 | IsServiceUp helps you monitor all the cloud services you rely on in a single web page.
4 |
5 | You can customize it with the services you want to monitor and host it on your own server.
6 |
7 | 
8 |
9 | Sorry, Compose, bad timing :smile:
10 |
11 | ## How to run
12 | ### Using Docker
13 | `docker-compose up --build`
14 |
15 | and you're up and running! :sparkles:
16 | ### List of services
17 | You can customize very easily the list of services you want to monitor by editing the variable `SERVICES` in the [config file](https://github.com/marcopaz/is-service-up/blob/master/isserviceup/config/config.py).
18 |
19 | ## How to contribute
20 | If you want to add something to the project, please fork this repository and create a Pull request.
21 |
22 | ### Extend it with a new service
23 |
24 | The way services are handled is based on a _plugin_ system, so monitoring a new service is straightforward: you can either file a feature request and hope that someone will implement the plugin, or you can implement it yourself. If you do decide to implement a plugin for a new service, we'd be thankful if you could share it with everyone by creating a pull request on this repository...thanks!
25 |
26 | Of course, creating a plugin for a new service is only possible if the service exposes a status page. Find that out first.
27 |
28 | Next, figure out if the status page is built using [Atlassian StatusPage](https://www.statuspage.io/). If that's the case, check out [this commit](https://github.com/marcopaz/is-service-up/commit/39df5a9124a01d39d66e7637a297896827a4262e) for an example on how to create your plugin.
29 |
30 | If it's a more generic status page, then the implementation depends on the specific service. If you're lucky, the status will be exposed through a beautiful API, like in [the case of GitHub](https://github.com/marcopaz/is-service-up/blob/master/isserviceup/services/github.py). Otherwise, find your inspiration from all others services that we have implemented for you. Good luck! :satellite:
31 |
32 | ## Maintainers
33 | * [Marco Pazzaglia](https://github.com/marcopaz)
34 | * [Alessandro Cosentino](https://github.com/cosenal)
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/marcopaz/is-service-up/9df5ebb1fbb09102300518855aaa35c0a84bb2bf/Screenshot.png
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | services:
4 |
5 | # frontend_builder:
6 | # build: frontend
7 | # volumes:
8 | # - './frontend/dist:/frontend/dist'
9 | # command: npm run build
10 |
11 | website:
12 | build: .
13 | ports:
14 | - "8000:8000"
15 | volumes:
16 | - '.:/isserviceup'
17 | depends_on:
18 | # - frontend_builder
19 | - redis
20 | - mongo
21 | command: gunicorn -c "isserviceup/config/gunicorn.py" isserviceup.app:app --reload
22 |
23 | redis:
24 | image: redis
25 | command: redis-server --requirepass devpassword --appendonly yes
26 | volumes:
27 | - 'redis:/data'
28 |
29 | mongo:
30 | image: 'mongo:3'
31 | volumes:
32 | - 'mongo:/data/db'
33 |
34 | celery_beat:
35 | build: .
36 | command: celery -A isserviceup.celeryapp.app beat
37 | volumes:
38 | - './isserviceup:/isserviceup/isserviceup'
39 | depends_on:
40 | - redis
41 |
42 | celery:
43 | build: .
44 | command: celery worker -l info -P gevent -c 50 -A isserviceup.celeryapp.app
45 | volumes:
46 | - './isserviceup:/isserviceup/isserviceup'
47 | - './shared:/home/app/shared'
48 | depends_on:
49 | - redis
50 |
51 | volumes:
52 | redis:
53 | mongo:
54 |
--------------------------------------------------------------------------------
/frontend/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015", "stage-2"],
3 | "plugins": ["transform-runtime"],
4 | "comments": false
5 | }
6 |
--------------------------------------------------------------------------------
/frontend/.dockerignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 |
--------------------------------------------------------------------------------
/frontend/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/frontend/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | config/*.js
3 | *
4 |
--------------------------------------------------------------------------------
/frontend/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: 'babel-eslint',
4 | parserOptions: {
5 | sourceType: 'module'
6 | },
7 | extends: 'airbnb-base',
8 | // required to lint *.vue files
9 | plugins: [
10 | 'html'
11 | ],
12 | // check if imports actually resolve
13 | 'settings': {
14 | 'import/resolver': {
15 | 'webpack': {
16 | 'config': 'build/webpack.base.conf.js'
17 | }
18 | }
19 | },
20 | // add your custom rules here
21 | 'rules': {
22 | // don't require .vue extension when importing
23 | 'import/extensions': ['error', 'always', {
24 | 'js': 'never',
25 | 'vue': 'never'
26 | }],
27 | // allow debugger during development
28 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/frontend/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | npm-debug.log
5 | test/unit/coverage
6 | test/e2e/reports
7 | selenium-debug.log
8 | .idea
9 |
--------------------------------------------------------------------------------
/frontend/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node
2 |
3 | ENV INSTALL_PATH /frontend
4 | RUN mkdir -p $INSTALL_PATH
5 | WORKDIR $INSTALL_PATH
6 |
7 | RUN npm install -g yarn
8 |
9 | COPY package.json package.json
10 | COPY yarn.lock yarn.lock
11 | RUN yarn
12 |
13 | COPY . .
14 | RUN npm run build
15 |
--------------------------------------------------------------------------------
/frontend/README.md:
--------------------------------------------------------------------------------
1 | # isserviceup frontend
2 |
3 | ## Build Setup
4 |
5 | ``` bash
6 | # install dependencies
7 | npm install
8 |
9 | # serve with hot reload at localhost:8080
10 | npm run dev
11 |
12 | # build for production with minification
13 | npm run build
14 | ```
15 |
16 | If you want to deploy it on a custom domain name change the `API_HOST` variable in the [config file](https://github.com/marcopaz/is-service-up/blob/master/frontend/src/config.js).
17 |
18 | Once you have build it for production you need to place the content of the dist folder in the static folder of the backend, see [scripts/build_frontend.sh](https://github.com/marcopaz/is-service-up/blob/master/scripts/build_frontend.sh).
19 |
--------------------------------------------------------------------------------
/frontend/build/build.js:
--------------------------------------------------------------------------------
1 | // https://github.com/shelljs/shelljs
2 | require('./check-versions')()
3 | require('shelljs/global')
4 | env.NODE_ENV = 'production'
5 |
6 | var path = require('path')
7 | var config = require('../config')
8 | var ora = require('ora')
9 | var webpack = require('webpack')
10 | var webpackConfig = require('./webpack.prod.conf')
11 |
12 | console.log(
13 | ' Tip:\n' +
14 | ' Built files are meant to be served over an HTTP server.\n' +
15 | ' Opening index.html over file:// won\'t work.\n'
16 | )
17 |
18 | var spinner = ora('building for production...')
19 | spinner.start()
20 |
21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
22 | rm('-rf', assetsPath)
23 | mkdir('-p', assetsPath)
24 | cp('-R', 'static/*', assetsPath)
25 |
26 | webpack(webpackConfig, function (err, stats) {
27 | spinner.stop()
28 | if (err) throw err
29 | process.stdout.write(stats.toString({
30 | colors: true,
31 | modules: false,
32 | children: false,
33 | chunks: false,
34 | chunkModules: false
35 | }) + '\n')
36 | })
37 |
--------------------------------------------------------------------------------
/frontend/build/check-versions.js:
--------------------------------------------------------------------------------
1 | var semver = require('semver')
2 | var chalk = require('chalk')
3 | var packageConfig = require('../package.json')
4 | var exec = function (cmd) {
5 | return require('child_process')
6 | .execSync(cmd).toString().trim()
7 | }
8 |
9 | var versionRequirements = [
10 | {
11 | name: 'node',
12 | currentVersion: semver.clean(process.version),
13 | versionRequirement: packageConfig.engines.node
14 | },
15 | {
16 | name: 'npm',
17 | currentVersion: exec('npm --version'),
18 | versionRequirement: packageConfig.engines.npm
19 | }
20 | ]
21 |
22 | module.exports = function () {
23 | var warnings = []
24 | for (var i = 0; i < versionRequirements.length; i++) {
25 | var mod = versionRequirements[i]
26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
27 | warnings.push(mod.name + ': ' +
28 | chalk.red(mod.currentVersion) + ' should be ' +
29 | chalk.green(mod.versionRequirement)
30 | )
31 | }
32 | }
33 |
34 | if (warnings.length) {
35 | console.log('')
36 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
37 | console.log()
38 | for (var i = 0; i < warnings.length; i++) {
39 | var warning = warnings[i]
40 | console.log(' ' + warning)
41 | }
42 | console.log()
43 | process.exit(1)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/frontend/build/dev-client.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | require('eventsource-polyfill')
3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4 |
5 | hotClient.subscribe(function (event) {
6 | if (event.action === 'reload') {
7 | window.location.reload()
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/frontend/build/dev-server.js:
--------------------------------------------------------------------------------
1 | require('./check-versions')()
2 | var config = require('../config')
3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = config.dev.env
4 | var path = require('path')
5 | var express = require('express')
6 | var webpack = require('webpack')
7 | var opn = require('opn')
8 | var proxyMiddleware = require('http-proxy-middleware')
9 | var webpackConfig = process.env.NODE_ENV === 'testing'
10 | ? require('./webpack.prod.conf')
11 | : require('./webpack.dev.conf')
12 |
13 | // default port where dev server listens for incoming traffic
14 | var port = process.env.PORT || config.dev.port
15 | // Define HTTP proxies to your custom API backend
16 | // https://github.com/chimurai/http-proxy-middleware
17 | var proxyTable = config.dev.proxyTable
18 |
19 | var app = express()
20 | var compiler = webpack(webpackConfig)
21 |
22 | var devMiddleware = require('webpack-dev-middleware')(compiler, {
23 | publicPath: webpackConfig.output.publicPath,
24 | stats: {
25 | colors: true,
26 | chunks: false
27 | }
28 | })
29 |
30 | var hotMiddleware = require('webpack-hot-middleware')(compiler)
31 | // force page reload when html-webpack-plugin template changes
32 | compiler.plugin('compilation', function (compilation) {
33 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
34 | hotMiddleware.publish({ action: 'reload' })
35 | cb()
36 | })
37 | })
38 |
39 | // proxy api requests
40 | Object.keys(proxyTable).forEach(function (context) {
41 | var options = proxyTable[context]
42 | if (typeof options === 'string') {
43 | options = { target: options }
44 | }
45 | app.use(proxyMiddleware(context, options))
46 | })
47 |
48 | // handle fallback for HTML5 history API
49 | app.use(require('connect-history-api-fallback')())
50 |
51 | // serve webpack bundle output
52 | app.use(devMiddleware)
53 |
54 | // enable hot-reload and state-preserving
55 | // compilation error display
56 | app.use(hotMiddleware)
57 |
58 | // serve pure static assets
59 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
60 | app.use(staticPath, express.static('./static'))
61 |
62 | module.exports = app.listen(port, function (err) {
63 | if (err) {
64 | console.log(err)
65 | return
66 | }
67 | var uri = 'http://localhost:' + port
68 | console.log('Listening at ' + uri + '\n')
69 | opn(uri)
70 | })
71 |
--------------------------------------------------------------------------------
/frontend/build/utils.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
4 |
5 | exports.assetsPath = function (_path) {
6 | var assetsSubDirectory = process.env.NODE_ENV === 'production'
7 | ? config.build.assetsSubDirectory
8 | : config.dev.assetsSubDirectory
9 | return path.posix.join(assetsSubDirectory, _path)
10 | }
11 |
12 | exports.cssLoaders = function (options) {
13 | options = options || {}
14 | // generate loader string to be used with extract text plugin
15 | function generateLoaders (loaders) {
16 | var sourceLoader = loaders.map(function (loader) {
17 | var extraParamChar
18 | if (/\?/.test(loader)) {
19 | loader = loader.replace(/\?/, '-loader?')
20 | extraParamChar = '&'
21 | } else {
22 | loader = loader + '-loader'
23 | extraParamChar = '?'
24 | }
25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
26 | }).join('!')
27 |
28 | // Extract CSS when that option is specified
29 | // (which is the case during production build)
30 | if (options.extract) {
31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
32 | } else {
33 | return ['vue-style-loader', sourceLoader].join('!')
34 | }
35 | }
36 |
37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html
38 | return {
39 | css: generateLoaders(['css']),
40 | postcss: generateLoaders(['css']),
41 | less: generateLoaders(['css', 'less']),
42 | sass: generateLoaders(['css', 'sass?indentedSyntax']),
43 | scss: generateLoaders(['css', 'sass']),
44 | stylus: generateLoaders(['css', 'stylus']),
45 | styl: generateLoaders(['css', 'stylus'])
46 | }
47 | }
48 |
49 | // Generate loaders for standalone style files (outside of .vue)
50 | exports.styleLoaders = function (options) {
51 | var output = []
52 | var loaders = exports.cssLoaders(options)
53 | for (var extension in loaders) {
54 | var loader = loaders[extension]
55 | output.push({
56 | test: new RegExp('\\.' + extension + '$'),
57 | loader: loader
58 | })
59 | }
60 | return output
61 | }
62 |
--------------------------------------------------------------------------------
/frontend/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var utils = require('./utils')
4 | var projectRoot = path.resolve(__dirname, '../')
5 |
6 | var env = process.env.NODE_ENV
7 | // check env & config/index.js to decide weither to enable CSS Sourcemaps for the
8 | // various preprocessor loaders added to vue-loader at the end of this file
9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap)
10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap)
11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd
12 |
13 | module.exports = {
14 | entry: {
15 | app: './src/main.js'
16 | },
17 | output: {
18 | path: config.build.assetsRoot,
19 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
20 | filename: '[name].js'
21 | },
22 | resolve: {
23 | extensions: ['', '.js', '.vue'],
24 | fallback: [path.join(__dirname, '../node_modules')],
25 | alias: {
26 | 'vue$': 'vue/dist/vue',
27 | 'src': path.resolve(__dirname, '../src'),
28 | 'assets': path.resolve(__dirname, '../src/assets'),
29 | 'components': path.resolve(__dirname, '../src/components')
30 | }
31 | },
32 | resolveLoader: {
33 | fallback: [path.join(__dirname, '../node_modules')]
34 | },
35 | module: {
36 | preLoaders: [
37 | {
38 | test: /\.vue$/,
39 | loader: 'eslint',
40 | include: projectRoot,
41 | exclude: /node_modules/
42 | },
43 | {
44 | test: /\.js$/,
45 | loader: 'eslint',
46 | include: projectRoot,
47 | exclude: /node_modules/
48 | }
49 | ],
50 | loaders: [
51 | {
52 | test: /\.vue$/,
53 | loader: 'vue'
54 | },
55 | {
56 | test: /\.js$/,
57 | loader: 'babel',
58 | include: projectRoot,
59 | exclude: /node_modules/
60 | },
61 | {
62 | test: /\.json$/,
63 | loader: 'json'
64 | },
65 | {
66 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
67 | loader: 'url',
68 | query: {
69 | limit: 10000,
70 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
71 | }
72 | },
73 | {
74 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
75 | loader: 'url',
76 | query: {
77 | limit: 10000,
78 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
79 | }
80 | }
81 | ]
82 | },
83 | eslint: {
84 | formatter: require('eslint-friendly-formatter')
85 | },
86 | vue: {
87 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }),
88 | postcss: [
89 | require('autoprefixer')({
90 | browsers: ['last 2 versions']
91 | })
92 | ]
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/frontend/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | var config = require('../config')
2 | var webpack = require('webpack')
3 | var merge = require('webpack-merge')
4 | var utils = require('./utils')
5 | var baseWebpackConfig = require('./webpack.base.conf')
6 | var HtmlWebpackPlugin = require('html-webpack-plugin')
7 |
8 | // add hot-reload related code to entry chunks
9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) {
10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
11 | })
12 |
13 | module.exports = merge(baseWebpackConfig, {
14 | module: {
15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
16 | },
17 | // eval-source-map is faster for development
18 | devtool: '#eval-source-map',
19 | plugins: [
20 | new webpack.DefinePlugin({
21 | 'process.env': config.dev.env
22 | }),
23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
24 | new webpack.optimize.OccurenceOrderPlugin(),
25 | new webpack.HotModuleReplacementPlugin(),
26 | new webpack.NoErrorsPlugin(),
27 | // https://github.com/ampedandwired/html-webpack-plugin
28 | new HtmlWebpackPlugin({
29 | filename: 'index.html',
30 | template: 'index.html',
31 | inject: true
32 | })
33 | ]
34 | })
35 |
--------------------------------------------------------------------------------
/frontend/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var utils = require('./utils')
4 | var webpack = require('webpack')
5 | var merge = require('webpack-merge')
6 | var baseWebpackConfig = require('./webpack.base.conf')
7 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
8 | var HtmlWebpackPlugin = require('html-webpack-plugin')
9 | var env = process.env.NODE_ENV === 'testing'
10 | ? require('../config/test.env')
11 | : config.build.env
12 |
13 | var webpackConfig = merge(baseWebpackConfig, {
14 | module: {
15 | loaders: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true })
16 | },
17 | devtool: config.build.productionSourceMap ? '#source-map' : false,
18 | output: {
19 | path: config.build.assetsRoot,
20 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
21 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
22 | },
23 | vue: {
24 | loaders: utils.cssLoaders({
25 | sourceMap: config.build.productionSourceMap,
26 | extract: true
27 | })
28 | },
29 | plugins: [
30 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
31 | new webpack.DefinePlugin({
32 | 'process.env': env
33 | }),
34 | new webpack.optimize.UglifyJsPlugin({
35 | compress: {
36 | warnings: false
37 | }
38 | }),
39 | new webpack.optimize.OccurenceOrderPlugin(),
40 | // extract css into its own file
41 | new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')),
42 | // generate dist index.html with correct asset hash for caching.
43 | // you can customize output by editing /index.html
44 | // see https://github.com/ampedandwired/html-webpack-plugin
45 | new HtmlWebpackPlugin({
46 | filename: process.env.NODE_ENV === 'testing'
47 | ? 'index.html'
48 | : config.build.index,
49 | template: 'index.html',
50 | inject: true,
51 | minify: {
52 | removeComments: true,
53 | collapseWhitespace: true,
54 | removeAttributeQuotes: true
55 | // more options:
56 | // https://github.com/kangax/html-minifier#options-quick-reference
57 | },
58 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
59 | chunksSortMode: 'dependency'
60 | }),
61 | // split vendor js into its own file
62 | new webpack.optimize.CommonsChunkPlugin({
63 | name: 'vendor',
64 | minChunks: function (module, count) {
65 | // any required modules inside node_modules are extracted to vendor
66 | return (
67 | module.resource &&
68 | /\.js$/.test(module.resource) &&
69 | module.resource.indexOf(
70 | path.join(__dirname, '../node_modules')
71 | ) === 0
72 | )
73 | }
74 | }),
75 | // extract webpack runtime and module manifest to its own file in order to
76 | // prevent vendor hash from being updated whenever app bundle is updated
77 | new webpack.optimize.CommonsChunkPlugin({
78 | name: 'manifest',
79 | chunks: ['vendor']
80 | })
81 | ]
82 | })
83 |
84 | if (config.build.productionGzip) {
85 | var CompressionWebpackPlugin = require('compression-webpack-plugin')
86 |
87 | webpackConfig.plugins.push(
88 | new CompressionWebpackPlugin({
89 | asset: '[path].gz[query]',
90 | algorithm: 'gzip',
91 | test: new RegExp(
92 | '\\.(' +
93 | config.build.productionGzipExtensions.join('|') +
94 | ')$'
95 | ),
96 | threshold: 10240,
97 | minRatio: 0.8
98 | })
99 | )
100 | }
101 |
102 | module.exports = webpackConfig
103 |
--------------------------------------------------------------------------------
/frontend/config/base.env.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | API_HOST: JSON.stringify(process.env.API_HOST),
3 | GITHUB_CLIENT_ID: JSON.stringify(process.env.GITHUB_CLIENT_ID),
4 | };
5 |
--------------------------------------------------------------------------------
/frontend/config/dev.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge')
2 | var baseEnv = require('./base.env')
3 |
4 | module.exports = merge(baseEnv, {
5 | NODE_ENV: '"development"'
6 | });
7 |
--------------------------------------------------------------------------------
/frontend/config/index.js:
--------------------------------------------------------------------------------
1 | // see http://vuejs-templates.github.io/webpack for documentation.
2 | require('dotenv').config({path: '../.env'});
3 | var webpack = require('webpack');
4 | var path = require('path');
5 |
6 |
7 | module.exports = {
8 | build: {
9 | env: require('./prod.env'),
10 | index: path.resolve(__dirname, '../dist/index.html'),
11 | assetsRoot: path.resolve(__dirname, '../dist'),
12 | assetsSubDirectory: '',
13 | assetsPublicPath: '/',
14 | productionSourceMap: true,
15 | // Gzip off by default as many popular static hosts such as
16 | // Surge or Netlify already gzip all static assets for you.
17 | // Before setting to `true`, make sure to:
18 | // npm install --save-dev compression-webpack-plugin
19 | productionGzip: false,
20 | productionGzipExtensions: ['js', 'css']
21 | },
22 | dev: {
23 | env: require('./dev.env'),
24 | port: 8080,
25 | assetsSubDirectory: '',
26 | assetsPublicPath: '/',
27 | proxyTable: {},
28 | // CSS Sourcemaps off by default because relative paths are "buggy"
29 | // with this option, according to the CSS-Loader README
30 | // (https://github.com/webpack/css-loader#sourcemaps)
31 | // In our experience, they generally work as expected,
32 | // just be aware of this issue when enabling this option.
33 | cssSourceMap: false
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/frontend/config/prod.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge');
2 | var baseEnv = require('./base.env');
3 |
4 | module.exports = merge(baseEnv, {
5 | NODE_ENV: '"production"'
6 | });
7 |
--------------------------------------------------------------------------------
/frontend/config/test.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge');
2 | var baseEnv = require('./base.env');
3 |
4 | module.exports = merge(baseEnv, {
5 | NODE_ENV: '"testing"'
6 | });
7 |
--------------------------------------------------------------------------------
/frontend/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
51 | Choose which status change you want to be notified of.
52 |
53 |
54 | You'll be notified for status changes of a service, according
55 | to your preferences above,
56 | if both the old and the new status of
57 | the service are selected below.
58 |
59 |
60 |