Skip to content

Commit e7c1a90

Browse files
committed
Init commit
0 parents  commit e7c1a90

File tree

111 files changed

+21945
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+21945
-0
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
max_line_length = 100
11+
12+
[*.md]
13+
max_line_length = off
14+
trim_trailing_whitespace = false

.env-template

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Settings for github client deployment
2+
GITHUB_USER_NAME='dwd-umd'
3+
GITHUB_REPO_NAME='sbn-portal-site'
4+
# Variables injected into client code by webpack
5+
SITE_LONG_TITLE='My Cool Site'
6+
SITE_SHORT_TITLE='My Site'
7+
# Ports
8+
CLIENT_DEV_PORT=3000
9+
SERVER_DEV_PORT=5000
10+
# Misc
11+
JWT_SECRET=BeSureToChangeThis
12+
SOLR_VERSION=8.2.0
13+
API_BASE_PATH=/
14+
REMOTE_BASE_HREF='/sbn-portal-site/'

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Misc
2+
.redundant
3+
redundant
4+
**/node_modules/**/*
5+
**/.DS_Store
6+
.env
7+
.solr/**
8+
coverage
9+
tempSolr
10+
11+
# compiled output
12+
/dist
13+
/dist-client
14+
/dist-server
15+
/node_modules
16+
17+
# Logs
18+
logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
lerna-debug.log*
24+
25+
# OS
26+
.DS_Store
27+
28+
# Tests
29+
/coverage
30+
/.nyc_output
31+
32+
# IDEs and editors
33+
/.idea
34+
.project
35+
.classpath
36+
.c9/
37+
*.launch
38+
.settings/
39+
*.sublime-workspace
40+
41+
# IDE - VSCode
42+
.vscode/*
43+
!.vscode/settings.json
44+
!.vscode/tasks.json
45+
!.vscode/launch.json
46+
!.vscode/extensions.json

.jest.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
collectCoverage: true,
3+
coverageDirectory: '../coverage',
4+
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'],
5+
moduleDirectories: ['node_modules'],
6+
rootDir: __dirname,
7+
testEnvironment: 'jest-environment-jsdom-fourteen',
8+
testRegex: '.spec.*$',
9+
transform: {
10+
'.*.ts.?$': 'ts-jest'
11+
},
12+
globals: {
13+
'ts-jest': {
14+
tsConfig: 'src/client/tsconfig.test.json'
15+
},
16+
__BASE_HREF__: process.env.BASE_HREF || '/',
17+
__SITE_SHORT_TITLE__: process.env.SITE_SHORT_TITLE || 'Test Short Title',
18+
__SITE_LONG_TITLE__: process.env.SITE_LONG_TITLE || 'Test Long Title'
19+
},
20+
moduleNameMapper: {
21+
'\\.(css|less|scss)$': '<rootDir>/__mocks__/styleMock.js',
22+
'\\.(gif|ttf|eot|svg)$': '<rootDir>/__mocks__/fileMock.js',
23+
24+
// These must correspond to compilerOptions.paths in src/client/tsconfig.json
25+
'^@client(.*)$': '<rootDir>/src/client/$1',
26+
'^@components(.*)$': '<rootDir>/src/client/components/$1',
27+
'^@common(.*)$': '<rootDir>/src/common/$1',
28+
'^@server(.*)$': '<rootDir>/src/server/$1'
29+
},
30+
// Follows: https://www.npmjs.com/package/jest-fetch-mock
31+
automock: false,
32+
setupFiles: ['./src/client/setupJest.ts'],
33+
testURL: 'https://www.something.com/'
34+
};

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package.json
2+
package-lock.json

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"semi": true
6+
}

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:3000",
12+
"webRoot": "${workspaceFolder}"
13+
}
14+
]
15+
}

.vscode/settings.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"typescript.tsdk": "./node_modules/typescript/lib",
3+
4+
"files.associations": {
5+
"*.html": "html"
6+
},
7+
8+
"[html]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
12+
"[typescript]": {
13+
"editor.defaultFormatter": "esbenp.prettier-vscode",
14+
"editor.tabSize": 4
15+
},
16+
17+
"[javascript]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode"
19+
},
20+
21+
"[jsonc]": {
22+
"editor.formatOnSave": false,
23+
"editor.defaultFormatter": "esbenp.prettier-vscode"
24+
},
25+
26+
"[scss]": {
27+
"editor.defaultFormatter": "esbenp.prettier-vscode"
28+
},
29+
30+
"tslint.configFile": "tslint.json",
31+
32+
"tslint.enable": true,
33+
34+
"cSpell.ignoreWords": ["ssot"]
35+
}

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Portal Site Boilerplate
2+
3+
## What's This?
4+
5+
Starter project with the essential infrastructure for a full-stack web app using:
6+
7+
- Typescript
8+
- React
9+
- Hooks
10+
- MaterialUI
11+
- Webpack
12+
- ...
13+
- Express
14+
- Swagger
15+
- ...
16+
17+
## How to Operate
18+
19+
Almost everything you need to operate this codebase is put into an executable bash script. These scripts always begin with '\_'.
20+
21+
## Quick Start
22+
23+
- Make sure you have node/npm installed
24+
25+
- I recommend you use the [nvm](https://github.com/nvm-sh/nvm) tool to install/activate different versions of node/npm on your system
26+
To install nvm, run: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash`
27+
- Note: we'll be using node version 10
28+
- Basic usage of nvm to install and activate node v10:
29+
- `nvm install 10`
30+
- `nvm use 10`
31+
32+
- Clone the codebase to a directory on your machine: `git clone https://github.com/dwd-umd/sbn-portal-site.git .`
33+
- Copy `.env-template` to `.env`
34+
- Install node packages: `npm install`
35+
- Start frontend: `./_client_manager`
36+
- In separate tab, start server: `./_server_manager`
37+
- Visit `http://localhost:3000` in your browser
38+
39+
## Code Organization
40+
41+
...
42+
43+
## TODOs
44+
45+
- Add e2e testing
46+
- Setup Jenkins CI
47+
- Purge unused packages
48+
- SEO / SSR
49+
- Add local-storage-tracked dark/light theme settings
50+
- Add email service to backend

__mocks__/fileMock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'test-file-stub';

0 commit comments

Comments
 (0)