Skip to content

Commit e38a971

Browse files
committed
Initial commit
0 parents  commit e38a971

14 files changed

+796
-0
lines changed

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# Note we depend on NODE_ENV being set to dictate which of the env variables below get loaded at runtime.
3+
# See README for more details.
4+
5+
# Get this from https://mlab.com/home after you've logged in and created a database
6+
MONGODB_URI=mongodb://<mlab_user>:<mlab_password>@<mlab_connection_url>
7+
8+
# This is standard running mongodb locally
9+
MONGODB_URI_LOCAL=mongodb://localhost:27017/<database>
10+
11+
# Put lots of randomness in these
12+
SESSION_SECRET=ashdfjhasdlkjfhalksdjhflak
13+
14+
# Facebook keys - register your app and get yours here: https://developers.facebook.com/
15+
FACEBOOK_ID=754220301289665
16+
FACEBOOK_SECRET=41860e58c256a3d7ad8267d3c1939a4a

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# /node_modules/* in the project root is ignored by default
2+
# build artefacts
3+
build/*
4+
coverage/*
5+
# data definition files
6+
**/*.d.ts
7+
# 3rd party libs
8+
/src/public/
9+
# custom definition files
10+
/src/types/

.eslintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"plugin:@typescript-eslint/recommended"
5+
],
6+
"parserOptions": {
7+
"ecmaVersion": 2018,
8+
"sourceType": "module"
9+
},
10+
"rules": {
11+
"semi": [
12+
"error",
13+
"always"
14+
],
15+
"@typescript-eslint/explicit-function-return-type": "off",
16+
"@typescript-eslint/no-explicit-any": 1,
17+
"@typescript-eslint/no-inferrable-types": [
18+
"warn",
19+
{
20+
"ignoreParameters": true
21+
}
22+
],
23+
"@typescript-eslint/no-unused-vars": "warn"
24+
}
25+
}

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
lib-cov
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
*.swp
10+
11+
pids
12+
logs
13+
results
14+
tmp
15+
16+
# Build
17+
/build
18+
19+
# Coverage reports
20+
coverage
21+
22+
# API keys and secrets
23+
.env
24+
25+
# Dependency directory
26+
node_modules
27+
bower_components
28+
29+
# Editors
30+
.idea
31+
*.iml
32+
33+
# OS metadata
34+
.DS_Store
35+
Thumbs.db
36+
37+
# Ignore built ts files
38+
dist/**/*
39+
40+
# ignore yarn.lock
41+
yarn.lock

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- "8"
5+
- "9"
6+
- "10"
7+
services:
8+
- mongodb
9+
cache:
10+
directories:
11+
- node_modules
12+
script:
13+
- npm run build
14+
- npm run test

README.md

Lines changed: 560 additions & 0 deletions
Large diffs are not rendered by default.

jest.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
globals: {
3+
"ts-jest": {
4+
tsConfig: "tsconfig.json"
5+
}
6+
},
7+
moduleFileExtensions: [
8+
"ts",
9+
"js"
10+
],
11+
transform: {
12+
"^.+\\.(ts|tsx)$": "ts-jest"
13+
},
14+
testMatch: [
15+
"**/test/**/*.test.(ts|js)",
16+
"**/*.test.(ts|js)"
17+
],
18+
testEnvironment: "node"
19+
};

package.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"name": "typescript-node",
3+
"version": "0.1.0",
4+
"description": "A starting point for Node.js express apps with TypeScript",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/bartolomej/typescript-node"
8+
},
9+
"author": "Bartolomej Kozorog",
10+
"scripts": {
11+
"start": "npm run build && npm run serve",
12+
"build": "npm run build-ts && npm run lint && npm run copy-static-assets",
13+
"serve": "node build/server.js",
14+
"test": "jest --forceExit --coverage --verbose",
15+
"build-ts": "tsc",
16+
"lint": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix",
17+
"copy-static-assets": "ts-node scripts/copyStaticAssets.ts",
18+
"debug": "npm run build && npm run watch-debug",
19+
"serve-debug": "nodemon --inspect build/server.js"
20+
},
21+
"dependencies": {
22+
"async": "^3.1.0",
23+
"dotenv": "^8.1.0",
24+
"lodash": "^4.17.15",
25+
"winston": "^3.2.1"
26+
},
27+
"devDependencies": {
28+
"@types/async": "^3.0.2",
29+
"@types/bcrypt-nodejs": "^0.0.30",
30+
"@types/bluebird": "^3.5.27",
31+
"@types/body-parser": "^1.17.1",
32+
"@types/chai": "^4.2.3",
33+
"@types/compression": "^1.0.1",
34+
"@types/concurrently": "^4.1.0",
35+
"@types/connect-mongo": "^0.0.43",
36+
"@types/dotenv": "^6.1.1",
37+
"@types/errorhandler": "^0.0.32",
38+
"@types/eslint": "^6.1.1",
39+
"@types/express": "^4.17.1",
40+
"@types/express-flash": "0.0.1",
41+
"@types/express-session": "^1.15.14",
42+
"@types/jest": "^24.0.18",
43+
"@types/jquery": "^3.3.31",
44+
"@types/lodash": "^4.14.141",
45+
"@types/lusca": "^1.6.1",
46+
"@types/mongoose": "^5.5.18",
47+
"@types/node": "^12.7.8",
48+
"@types/node-sass": "^4.11.0",
49+
"@types/nodemailer": "^6.2.1",
50+
"@types/passport": "^1.0.1",
51+
"@types/passport-facebook": "^2.1.9",
52+
"@types/passport-local": "^1.0.33",
53+
"@types/pug": "^2.0.4",
54+
"@types/request": "^2.48.3",
55+
"@types/request-promise": "^4.1.44",
56+
"@types/shelljs": "^0.8.5",
57+
"@types/supertest": "^2.0.8",
58+
"@types/winston": "^2.4.4",
59+
"@typescript-eslint/eslint-plugin": "^2.3.1",
60+
"@typescript-eslint/parser": "^2.3.1",
61+
"concurrently": "^4.1.2",
62+
"eslint": "^6.4.0",
63+
"jest": "^24.9.0",
64+
"node-sass": "^4.12.0",
65+
"nodemon": "^1.19.2",
66+
"shelljs": "^0.8.3",
67+
"supertest": "^4.0.2",
68+
"ts-jest": "^24.1.0",
69+
"ts-node": "^8.4.1",
70+
"typescript": "^3.6.3"
71+
}
72+
}

scripts/copyStaticAssets.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import * as shell from "shelljs";
2+
3+
// copy static assets to build folder if needed
4+
shell.cp("-R", "src/assets", "build/assets");

src/app.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import example from './example';
2+
3+
console.log(example());

0 commit comments

Comments
 (0)