forked from artemnih/mean-mono-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 74bc8ee
Showing
70 changed files
with
15,163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git | ||
node_modules | ||
packages/*/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": ["warn"], | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"@typescript-eslint/no-var-requires": "warn", | ||
"@typescript-eslint/no-this-alias": "warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Build and Test | ||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.9.0 | ||
- id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
lint: | ||
needs: install | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.9.0 | ||
- id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: npm run lint | ||
|
||
build-web: | ||
needs: install | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.9.0 | ||
- id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: npm run build:common | ||
- run: npm run build:ui | ||
|
||
build-server: | ||
needs: install | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.9.0 | ||
- id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: npm run build:common | ||
- run: npm run build:api | ||
|
||
test: | ||
needs: install | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.9.0 | ||
- id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: npm run build:common | ||
- run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# 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 | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# Miscellaneous | ||
packages/ui/.angular | ||
|
||
# Workspaces | ||
packages/*/node_modules | ||
packages/*/dist | ||
|
||
.angular | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
npm run lint | ||
npm run prettier:fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package.json | ||
yarn.lock | ||
package-lock.json | ||
dist | ||
.angular | ||
.husky | ||
*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"singleQuote": true, | ||
"semi": true, | ||
"bracketSpacing": true, | ||
"trailingComma": "es5", | ||
"printWidth": 140 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM node:20-alpine as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm i --w=packages/common | ||
RUN npm i --w=packages/api | ||
|
||
RUN npm run build:common | ||
RUN npm run build:api | ||
|
||
FROM node:20-alpine | ||
|
||
WORKDIR /usr/src/app | ||
COPY --from=builder /app/packages/api/dist . | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/packages/common/dist ./node_modules/@example/common | ||
EXPOSE 8080 | ||
|
||
CMD [ "node", "." ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM node:20 AS build | ||
|
||
# Set the source folder | ||
ARG SOURCE_FOLDER="./" | ||
|
||
# Create app directory | ||
WORKDIR /var/www/ | ||
|
||
# Bundle app source | ||
COPY ${SOURCE_FOLDER} . | ||
|
||
RUN npm i --w=packages/common | ||
RUN npm i --w=packages/ui | ||
|
||
RUN npm run build:common | ||
RUN npm run build:ui | ||
|
||
FROM nginx:1.17-alpine | ||
COPY VERSION /VERSION | ||
COPY --from=build /var/www/packages/ui/dist/workflow /var/www/ | ||
|
||
COPY default.conf /etc/nginx/conf.d/ | ||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
RUN chmod +x /usr/local/bin/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# MEAN Stack Monorepo Quick Starter | ||
|
||
Full stack monorepo based on `NPM Workspaces`. | ||
|
||
- Language: `Typescript` | ||
- Frontend: `Angular 17` with routing and `SASS` | ||
- Backend: `Express` | ||
- Database: `MongoDB` | ||
- ODM: `Mongoose` | ||
|
||
## Features | ||
|
||
- `NPM Workspaces` monorepo | ||
- `api` and `ui` packages are independent and both import common types from `common` package | ||
- `OIDC` authentication | ||
- Inlcuded Github Actions checks on pull requests | ||
- Inlcuded Dockerfile for both `api` and `ui` packages | ||
|
||
## Prerequisites | ||
|
||
Ensure you have the following installed on your machine: | ||
|
||
- `Node.js`: 20 | ||
- `@angular/cli`: 17 | ||
|
||
## Getting Started | ||
|
||
Install dependencies: | ||
|
||
```bash | ||
npm i | ||
``` | ||
|
||
Run project in development mode | ||
|
||
If auth is not yet configured, run the following command to start the project without auth: | ||
|
||
```bash | ||
npm run noauth # no auth mode | ||
``` | ||
|
||
if Auth url is provided in `api` .env and in `ui` app.config.json | ||
|
||
```bash | ||
npm start # with auth mode | ||
``` | ||
|
||
## Building | ||
|
||
Build the project: | ||
|
||
```bash | ||
npm run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
server { | ||
listen 80; | ||
root /var/www/browser; | ||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nginx -g 'daemon off;' |
Oops, something went wrong.