Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Jun 2, 2020
0 parents commit 8f018c7
Show file tree
Hide file tree
Showing 61 changed files with 14,619 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"no-console": [
"off"
],
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never"
}
],
"brace-style": [
"error",
"stroustrup"
],
"keyword-spacing": [
"error",
{
"after": true
}
],
"no-unused-vars": [
"off"
],
"no-undef": [
"off"
],
"space-before-blocks": [
"error"
]
}
}
37 changes: 37 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Declare files that will always have LF line endings on checkout.

*.html text eol=lf
*.scss text eol=lf
*.sass text eol=lf
*.css text eol=lf
*.js text eol=lf
*.json text eol=lf
*.svg text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.md text eol=lf

.babelrc text eol=lf
.gitignore text eol=lf
.gitattributes text eol=lf

LICENSE text eol=lf

# Denote all files that are truly binary and should not be modified.

*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.bmp binary
*.ai binary
*.psd binary
*.pdf binary

*.otf binary
*.eot binary
*.ttf binary
*.woff binary
*.woff2 binary
*.zip binary
*.rar binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:latest

RUN mkdir -p /usr/src/app/react-src
WORKDIR /usr/src/app

RUN npm install -g nodemon

COPY package.json /usr/src/app/
RUN npm install

COPY react-src/package.json /usr/src/app/react-src
RUN npm install

COPY . /usr/src/app

EXPOSE 3000 4200
3 changes: 3 additions & 0 deletions config/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
db: process.env.DB || 'mongodb://localhost/track-suite'
};
13 changes: 13 additions & 0 deletions models/test_record.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const mongoose = require('mongoose');

const TestRecordSchema = new mongoose.Schema({
// project: {
// type: String,
// required: [true, 'project is required.'],
// },
record: {
type: mongoose.Schema.Types.Mixed,
},
});

const TestRecord = module.exports = mongoose.model('test_record', TestRecordSchema);
59 changes: 59 additions & 0 deletions models/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const mongoose = require('mongoose');
const unique = require('mongoose-unique-validator');
const validate = require('mongoose-validator');

const nameValidator = [
validate({
validator: 'isLength',
arguments: [0, 40],
message: 'Name must not exceed {ARGS[1]} characters.'
})
];

const emailValidator = [
validate({
validator: 'isLength',
arguments: [0, 40],
message: 'Email must not exceed {ARGS[1]} characters.'
}),
validate({
validator: 'isEmail',
message: 'Email must be valid.'
})
];

const ageValidator = [
// TODO: Make some validations here...
];

const genderValidator = [
// TODO: Make some validations here...
];

// Define the database model
const UserSchema = new mongoose.Schema({
name: {
type: String,
required: [true, 'Name is required.'],
validate: nameValidator
},
email: {
type: String,
required: [true, 'Email is required.'],
unique: true,
validate: emailValidator
},
age: {
type: Number,
validate: ageValidator
},
gender: {
type: String,
validate: genderValidator
}
});

// Use the unique validator plugin
UserSchema.plugin(unique, { message: 'That {PATH} is already taken.' });

const User = module.exports = mongoose.model('user', UserSchema);
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "track-suite",
"version": "0.1.0",
"main": "server.js",
"scripts": {
"start": "node server",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"license": "MIT",
"dependencies": {
"body-parser": "1.19.0",
"cors": "2.8.5",
"express": "4.17.1",
"express-rate-limit": "5.1.3",
"mongoose": "5.9.13"
}
}
23 changes: 23 additions & 0 deletions public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"main.css": "static/css/main.9d265314.css",
"main.css.map": "static/css/main.9d265314.css.map",
"main.js": "static/js/main.4174b5c6.js",
"main.js.map": "static/js/main.4174b5c6.js.map",
"static/media/brand-icons.eot": "static/media/brand-icons.13db00b7.eot",
"static/media/brand-icons.svg": "static/media/brand-icons.a1a749e8.svg",
"static/media/brand-icons.ttf": "static/media/brand-icons.c5ebe0b3.ttf",
"static/media/brand-icons.woff": "static/media/brand-icons.a046592b.woff",
"static/media/brand-icons.woff2": "static/media/brand-icons.e8c322de.woff2",
"static/media/flags.png": "static/media/flags.9c74e172.png",
"static/media/icons.eot": "static/media/icons.8e3c7f55.eot",
"static/media/icons.svg": "static/media/icons.962a1bf3.svg",
"static/media/icons.ttf": "static/media/icons.b87b9ba5.ttf",
"static/media/icons.woff": "static/media/icons.faff9214.woff",
"static/media/icons.woff2": "static/media/icons.0ab54153.woff2",
"static/media/outline-icons.eot": "static/media/outline-icons.701ae6ab.eot",
"static/media/outline-icons.svg": "static/media/outline-icons.82f60bd0.svg",
"static/media/outline-icons.ttf": "static/media/outline-icons.ad97afd3.ttf",
"static/media/outline-icons.woff": "static/media/outline-icons.ef60a4f6.woff",
"static/media/outline-icons.woff2": "static/media/outline-icons.cd6c777f.woff2",
"static/media/tracksuite.jpg": "static/media/tracksuite.85684627.jpg"
}
Binary file added public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>TRACK SUITE</title><link href="/static/css/main.9d265314.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.4174b5c6.js"></script></body></html>
1 change: 1 addition & 0 deletions public/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

363 changes: 363 additions & 0 deletions public/static/css/main.9d265314.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/static/css/main.9d265314.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/static/js/main.4174b5c6.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/static/js/main.4174b5c6.js.map

Large diffs are not rendered by default.

Binary file added public/static/media/brand-icons.13db00b7.eot
Binary file not shown.
Binary file added public/static/media/brand-icons.a046592b.woff
Binary file not shown.
1,008 changes: 1,008 additions & 0 deletions public/static/media/brand-icons.a1a749e8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/media/brand-icons.c5ebe0b3.ttf
Binary file not shown.
Binary file added public/static/media/brand-icons.e8c322de.woff2
Binary file not shown.
Binary file added public/static/media/flags.9c74e172.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/media/icons.0ab54153.woff2
Binary file not shown.
Binary file added public/static/media/icons.8e3c7f55.eot
Binary file not shown.
Loading

0 comments on commit 8f018c7

Please sign in to comment.