Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
George Adams committed Nov 28, 2018
0 parents commit a62b978
Show file tree
Hide file tree
Showing 94 changed files with 9,959 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
node_modules_linux/
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI/
28 changes: 28 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
env:
node: true
mocha: true

parserOptions:
ecmaVersion: 2017

rules:
quotes: [2, double]
no-trailing-spaces: 2
comma-spacing: [2, { before: false, after: true }]
eqeqeq: [2, always]
linebreak-style: [2, unix]
semi: [2, always]
max-len: [2, 80]
no-multi-spaces: 2
no-useless-escape: 2
array-bracket-spacing: [2, never]
brace-style: 2
capitalized-comments: [2, always, { ignoreConsecutiveComments: true }]
eol-last: [2, always]
func-call-spacing: [2, never]
semi-spacing: 2
strict: 2
no-var: 2
no-console: "off"

extends: eslint:recommended
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Checklist

- [ ] Test cases pass
- [ ] UI change has been manually checked
- [ ] Relevant documentation has been updated
- [ ] Change has been considered for a tweet/blog
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.DS_Store
err.txt

# Logs
logs
*.log
npm-debug.log*
nvm_logs.js
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: node_js
node_js: "8"
sudo: false
install:
- npm install
script:
- npm run lint
- docker run -d postgres
- npm test
services:
- docker
deploy:
- provider: bluemixcloudfoundry
edge: true
username: apikey
password: $PLATFORM_API_KEY
organization: Module-Curation
space: MC-UK
manifest: manifest-staging.yml
region: eu-gb
on:
branch: master
- provider: bluemixcloudfoundry
edge: true
username: apikey
password: $PLATFORM_API_KEY
organization: Module-Curation
space: MC-UK
manifest: manifest.yml
region: eu-gb
on:
branch: release
10 changes: 10 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Authors

- IBM Corp.
- Bethany Griggs (https://github.com/BethGriggs)
- George Adams (https://github.com/gdams)
- Gibson Fahnestock (https://github.com/gibfahn)
- Musa Hamwala (https://github.com/mhamwala)
- Oleksandr Kushchak (https://github.com/al-k21)
- Paul Ivinson (https://github.com/Paul-Ivinson)
- Thomas Leah (https://github.com/Tomleah)
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Contributing to Module Insights
We welcome contributions, but request that you follow these guidelines.

- [Raising bug reports and feature requests](#raising-bug-reports-and-feature-requests)
- [Testing Changes](#testing-changes)
- [Pull requests](#pull-requests)
- [Coding standards](#coding-standards)
- [IBM Contributor License Agreement](#ibm-contributor-license-agreement)

## Raising bug reports and feature requests

Please raise any bug reports and feature requests on the project's GitHub [issue tracker](https://github.com/CloudNativeJS/module-insights/issues).
Be sure to search the list of open and closed issues to see if your problem or request has already been raised.

A good bug report is one that makes it easy for us to understand what you were trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue.

## Testing Changes
1. Set the postgres database URL:

```bash
export DB_URL=postgres://<url>
```

2. Build the Docker run image for your application:
```bash
docker build -t module-insights:<version> -f Dockerfile-run .
```

3. You have now built a Docker image for your application called module-insights. Use the following to run the application inside the Docker container:
```bash
docker run -i -p 3000:3000 -t module-insights:<version>
```

## Pull requests
To create a pull request do the following:
1. Fork [Module Insights](https://github.com/CloudNativeJS/module-insights).
2. Raise a pull request.
3. Have a minimum of 1 other contributor review your changes.

In order for us to accept pull requests from a new contributor, the contributor must indicate that they accept and agree to be bound by the terms of the IBM Contributor License Agreement below. Please do this by adding your name to the [AUTHORS file](https://github.com/CloudNativeJS/module-insights/blob/master/AUTHORS.md)
in your first pull request.

If you want to raise a pull-request for a bug fix or a new feature, we recommend that you raise a [GitHub issue](https://github.com/CloudNativeJS/module-insights/issues) to discuss it first.

### Coding standards

Please ensure you follow the coding standards used through-out the existing code base. All source code files should include the Apache v2.0 license header.

### IBM Contributor License Agreement
Version 1.0.1 - January 25th, 2017

In order for You (as defined below) to make intellectual property Contributions (as defined below) now or in the future to IBM GitHub repositories, You must agree to this Contributor License Agreement ("CLA"). Please read this CLA carefully before accepting its terms. By accepting the CLA, You are agreeing to be bound by its terms. If You submit a Pull Request against an IBM repository on GitHub You must include in the Pull Request a statement of Your acceptance of this CLA.
As used in this CLA: (i) "You" (or "Your") shall mean the entity that is making this Agreement with IBM; (ii)"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is submitted by You to IBM for inclusion in, or documentation of, any of the IBM GitHub repositories; (iii) "Submit" (or "Submitted") means any form of communication sent to IBM (e.g. the content You post in a GitHub Issue or submit as part of a GitHub Pull Request).

This agreement applies to all Contributions You Submit.

- You will only Submit Contributions where You have authored 100% of the content.

- You will only Submit Contributions to which You have the necessary rights. This means that if You are employed You have received the necessary permissions from Your employer to make the Contributions.

- Whatever content You Contribute will be provided under the Apache v2.0 license. You can read a copy of the Apache v2.0 License at http://www.apache.org/licenses/LICENSE-2.0. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.

- You understand and agree that the Project and Your contributions are public, and that a record of the contribution (including all personal information You submit with it, including Your sign-off) is maintained indefinitely and may be redistributed consistent with the license(s) involved.

- You understand that the decision to include Your Contribution is entirely that of the Project and this agreement does not guarantee that the Contribution will be included in the Project.

- You are not expected to provide support for Your Contribution. However you may provide support for free, for a fee or not at all. You provide Your Contribution on an "AS IS" BASIS as stated in the License.

You will promptly notify the Project if You become aware of any facts or circumstances that would make these commitments inaccurate in any way. To do so, please an issue on the project's GitHub [issue tracker](https://github.com/CloudNativeJS/module-insights/issues).
If You think the Project could make use of content which You did not author, please talk to a committer on the Project. If they like Your idea, they will know the process to get it included.
39 changes: 39 additions & 0 deletions Dockerfile-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Install the app dependencies in a full Node docker image
FROM node:8

WORKDIR "/app"

# Install OS updates
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get clean \
&& echo 'Finished installing dependencies'

# Copy package.json and package-lock.json
COPY package*.json ./

# Install app dependencies
RUN npm install --production

# Copy the dependencies into a Slim Node docker image
FROM node:8-slim

WORKDIR "/app"

# Install OS updates
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get clean \
&& echo 'Finished installing dependencies'

# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app

ENV NODE_ENV production
ENV PORT 3000
ENV DB_URL $DB_URL
USER node

EXPOSE 3000
CMD ["npm", "start"]
Loading

0 comments on commit a62b978

Please sign in to comment.