Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP express-mongo-ts, see readme for status #53

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8331c5f
WIP express-mongo-ts, see readme for status
StefanWallin Jul 12, 2022
1a06925
WIP
StefanWallin Aug 16, 2022
63ce200
chore: ignore .DS_Store
Aug 16, 2022
d9708b0
chore(deps): update dependency @vitejs/plugin-react to v1.3.2 (#15)
renovate[bot] Sep 13, 2022
e089f7c
chore(deps): update dependency @vitest/ui to v0.23.2 (#16)
renovate[bot] Sep 13, 2022
0803548
chore(deps): update dependency @types/react-dom to v17.0.17 (#32)
renovate[bot] Sep 13, 2022
784f5a7
chore(deps): update dependency eslint to v8.23.1 (#35)
renovate[bot] Sep 13, 2022
c742409
chore(deps): update dependency @testing-library/react-hooks to v8 (#36)
renovate[bot] Sep 13, 2022
cb8fe0d
chore(deps): bump semver-regex from 3.1.3 to 3.1.4 (#48)
dependabot[bot] Sep 13, 2022
6b4f40e
chore(deps-dev): bump semantic-release from 19.0.2 to 19.0.3 (#50)
dependabot[bot] Sep 13, 2022
e5cf35f
chore(deps-dev): bump vite from 2.9.1 to 2.9.13 in /templates/react (…
dependabot[bot] Sep 13, 2022
17e6492
chore(deps-dev): bump vite in /templates/vite-vanilla (#55)
dependabot[bot] Sep 13, 2022
39014e0
chore(deps): update dependency semver-regex to 3.1.4 [security] (#49)
renovate[bot] Sep 13, 2022
552a034
chore(deps): update dependency semantic-release to 19.0.3 [security] …
renovate[bot] Sep 13, 2022
fc29006
chore(deps-dev): bump vite from 2.9.1 to 2.9.13 in /templates/react-t…
dependabot[bot] Sep 13, 2022
6f26da9
chore(deps): update dependency got to 11.8.5 [security] (#58)
renovate[bot] Sep 13, 2022
c21e08b
chore(deps): update dependency @types/react to v17.0.49 (#44)
renovate[bot] Sep 13, 2022
2239d3e
chore: update gitignore
Sep 13, 2022
ea1cd6a
chore: enable renovate automerge (#59)
Sep 13, 2022
d11e508
chore: manually update dependencies (#60)
Sep 13, 2022
c1705de
chore(deps): pin dependencies (#61)
renovate[bot] Sep 13, 2022
7e1af05
chore(deps): update dependency @testing-library/jest-dom to v5.16.5 (…
renovate[bot] Sep 13, 2022
2e92d3a
WIP express-mongo-ts, see readme for status
StefanWallin Jul 12, 2022
0699529
WIP
StefanWallin Aug 16, 2022
154d4e3
chore: ignore .DS_Store
Aug 16, 2022
85accd1
Merge branch 'feat/express-mongo-ts' of https://github.com/Iteam1337/…
Sep 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5167,23 +5167,28 @@ var TEMPLATES = [
{
color: yellow,
name: "react",
display: "React JavaScript"
display: "React JavaScript Frontend"
},
{
color: blue,
name: "react-ts",
display: "React TypeScript"
display: "React TypeScript Frontend"
},
{
color: red,
name: "vite-vanilla",
display: "JavaScript"
display: "Vite JavaScript Frontend"
},
{
color: green,
name: "koa-ts",
display: "Koa Typescript"
}
{
color: green,
name: "express-mongo-ts",
display: "Express Mongo Typescript Backend"
}
]
}
];
Expand Down
2 changes: 2 additions & 0 deletions templates/express-mongo-ts/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
2 changes: 2 additions & 0 deletions templates/express-mongo-ts/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.config.ts
*.config.js
37 changes: 37 additions & 0 deletions templates/express-mongo-ts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "eslint-plugin-node"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:node/recommended"
],
"parserOptions": {
"ecmaVersion": 2020,
"project": "tsconfig.json"
},
"env": {
"node": true
},
"settings": {
"node": {
"tryExtensions": [".js", ".ts"]
}
},
"rules": {
"node/no-unsupported-features/es-syntax": [
"error",
{ "ignores": ["modules"] }
]
},
"overrides": [
{
"files": "test/**/*.test.*",
"rules": {
"node/no-unpublished-import": 0
}
}
]
}
49 changes: 49 additions & 0 deletions templates/express-mongo-ts/.github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run tests on PR

on:
pull_request:
branches:
- main

jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]

- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Download dependencies
uses: bahmutov/npm-install@v1

- name: Run linting
run: npm run lint

test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]

- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Download dependencies
uses: bahmutov/npm-install@v1

- name: Run tests
run: npm test
25 changes: 25 additions & 0 deletions templates/express-mongo-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.eslintcache
build

node_modules
dist
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions templates/express-mongo-ts/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.14
7 changes: 7 additions & 0 deletions templates/express-mongo-ts/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"trailingComma": "es5",
"semi": false
}
8 changes: 8 additions & 0 deletions templates/express-mongo-ts/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss"
],
"unwantedRecommendations": []
}
10 changes: 10 additions & 0 deletions templates/express-mongo-ts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:16.14-slim AS builder

WORKDIR /app
ADD package*.json .
RUN npm ci
ADD . .
RUN npm run build

FROM nginx:alpine AS runner
COPY --from=builder /app/dist /usr/share/nginx/html
43 changes: 43 additions & 0 deletions templates/express-mongo-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# :guitar: Iteam Express Mongo TS Template :fire:

## Setup

This template uses [@iteam/eslint-config-react](https://github.com/Iteam1337/eslint-config-react), so we need to configure it by installing its peer dependencies.

From the project root, run the following command:

```sh
npx install-peerdeps --dev @iteam/eslint-config-react
```

Then, install the rest of the dependencies:

```sh
npm install
```

### Soft setup

- Edit src/public/robots.txt
- Edit src/public/.well-known/security.txt

## Recommended VSCode extensions

- ESLint
- Prettier

## Configuration

This template comes with a basic setup of Github Actions to lint and test code on PR:s made against `main`.

## TODO:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current status


- [ ] Install mongoose/mongdb
- [ ] Setup logging infra
- [ ] Setup security headers?
- [ ] Setup example API endpoint
- [ ] Setup common test infra around mongodb to get data isolation for each test
- [ ] Setup Docker build
- [ ] Setup Github Actions CI/CD
- [ ] Setup Kubernetes deployment
- [ ] Update Readme
Empty file.
5 changes: 5 additions & 0 deletions templates/express-mongo-ts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
}
Loading