Skip to content

Commit b555c2d

Browse files
Initial commit
0 parents  commit b555c2d

40 files changed

+6652
-0
lines changed

.codeclimate.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
engines:
2+
eslint:
3+
enabled: true
4+
ratings:
5+
paths:
6+
- server/**
7+
- config/**
8+
- "**.js"
9+
exclude_paths:
10+
- node_modules/**/*
11+
- server/tests/**

.dockerignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21+
.grunt
22+
23+
# node-waf configuration
24+
.lock-wscript
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directories
30+
node_modules
31+
jspm_packages
32+
33+
# Optional npm cache directory
34+
.npm
35+
36+
# Optional REPL history
37+
.node_repl_history

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
NODE_ENV=development
2+
PORT=4040
3+
JWT_SECRET=0a6b944d-d2fb-46fc-a85e-0295c986cd9f
4+
MONGO_HOST=mongodb://localhost/express-mongoose-es6-rest-api-development
5+
MONGO_PORT=27017

.eslintrc

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"rules": {
3+
"indent": [
4+
2,
5+
2,
6+
{
7+
"SwitchCase": 1
8+
}
9+
],
10+
"space-before-function-paren": [
11+
2,
12+
{
13+
"anonymous": "always",
14+
"named": "never"
15+
}
16+
],
17+
"no-use-before-define": [
18+
2,
19+
"nofunc"
20+
],
21+
// TODO: turn on later
22+
"comma-dangle": [
23+
0
24+
],
25+
"import/no-extraneous-dependencies": [
26+
"error",
27+
{
28+
"devDependencies": true
29+
}
30+
],
31+
"no-underscore-dangle": [
32+
0
33+
]
34+
},
35+
"env": {
36+
"node": true,
37+
"mocha": true
38+
},
39+
"parserOptions": {
40+
"ecmaVersion": 6,
41+
"sourceType": "module"
42+
},
43+
"extends": [
44+
"eslint:recommended",
45+
"airbnb-base"
46+
]
47+
}

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Convert text file line endings to lf
2+
* text=auto
3+
*.js text
4+
# Denote all files that are truly binary and should not be modified.
5+
*.mp4 binary
6+
*.jpg binary

.gitignore

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# IDE
12+
.idea
13+
14+
# OS generated files
15+
.DS_Store
16+
.DS_Store?
17+
._*
18+
.Spotlight-V100
19+
ehthumbs.db
20+
Icon?
21+
Thumbs.db
22+
23+
# Babel ES6 compiles files
24+
dist
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
32+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (http://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directory
42+
node_modules
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional REPL history
48+
.node_repl_history
49+
50+
# .env
51+
.env

.istanbul.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
verbose: false
2+
instrumentation:
3+
excludes: ['dist/**', 'coverage/**', 'gulpfile.babel.js']
4+
include-all-sources: true
5+
reporting:
6+
print: summary
7+
reports:
8+
- lcov
9+
dir: ./coverage
10+
watermarks:
11+
statements: [50, 80]
12+
lines: [50, 80]
13+
functions: [50, 80]
14+
branches: [50, 80]
15+
check:
16+
global:
17+
statements: 50
18+
lines: 50
19+
branches: 50
20+
functions: 50
21+
each:
22+
statements: 50
23+
lines: 50
24+
branches: 30
25+
functions: 20

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: node_js
2+
node_js:
3+
- "4.8"
4+
- "6.10"
5+
- "7.6"
6+
services:
7+
- mongodb
8+
cache:
9+
directories:
10+
- node_modules
11+
git:
12+
depth: 3
13+
script:
14+
- yarn test:check-coverage
15+
after_script:
16+
- yarn report-coverage

.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-prefix false

CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Contributing to Project
2+
3+
All contributions are welcome!
4+
5+
For contributing to this project, please:
6+
* fork the repository to your own account
7+
* clone the repository
8+
* make changes
9+
* submit a pull request with a unit test on `develop` branch

Dockerfile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# take default image of node boron i.e node 6.x
2+
FROM node:6.10.1
3+
4+
MAINTAINER Kunal Kapadia <[email protected]>
5+
6+
# create app directory in container
7+
RUN mkdir -p /app
8+
9+
# set /app directory as default working directory
10+
WORKDIR /app
11+
12+
# only copy package.json initially so that `RUN yarn` layer is recreated only
13+
# if there are changes in package.json
14+
ADD package.json yarn.lock /app/
15+
16+
# --pure-lockfile: Don’t generate a yarn.lock lockfile
17+
RUN yarn --pure-lockfile
18+
19+
# copy all file from current dir to /app in container
20+
COPY . /app/
21+
22+
# expose port 4040
23+
EXPOSE 4040
24+
25+
# cmd to start service
26+
CMD [ "yarn", "start" ]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016-2017 Kunal Kapadia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)