Skip to content

Commit 439bd43

Browse files
committed
.
0 parents  commit 439bd43

Some content is hidden

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

43 files changed

+895
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MONGODB_URL=mongodb://admin:password@localhost:27017/node?authSource=admin

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.js diff=js
3+
*.ts diff=ts

.github/workflows/build.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
12+
- name: Node Setup
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: latest
16+
check-latest: true
17+
18+
- name: Node Build
19+
run: |
20+
npm run restore
21+
npm run build
22+
23+
- name: Artifact Upload
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: app
27+
path: dist

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.bat
2+
.vscode
3+
coverage
4+
dist
5+
node_modules
6+
package-lock.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bracketSpacing": true,
3+
"endOfLine": "lf",
4+
"printWidth": 125,
5+
"semi": true,
6+
"singleQuote": false,
7+
"tabWidth": 4,
8+
"trailingComma": "none"
9+
}

docker-compose.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# docker compose up --detach --build --force-recreate --remove-orphans
2+
3+
name: node
4+
services:
5+
application:
6+
image: application
7+
container_name: application
8+
depends_on:
9+
- mongo
10+
- mongo-admin
11+
build:
12+
context: .
13+
dockerfile: dockerfile
14+
ports:
15+
- "4000:3000"
16+
environment:
17+
- MONGODB_URL=mongodb://admin:password@mongo:27017/node?authSource=admin
18+
mongo:
19+
image: mongo
20+
container_name: mongo
21+
ports:
22+
- "27017:27017"
23+
volumes:
24+
- ~/volumes/mongo:/data/db
25+
environment:
26+
MONGO_INITDB_ROOT_USERNAME: admin
27+
MONGO_INITDB_ROOT_PASSWORD: password
28+
mongo-admin:
29+
image: mongo-express
30+
container_name: mongo-admin
31+
depends_on:
32+
- mongo
33+
ports:
34+
- "27018:8081"
35+
environment:
36+
ME_CONFIG_MONGODB_URL: mongodb://admin:password@mongo:27017
37+
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
38+
ME_CONFIG_MONGODB_ADMINPASSWORD: password
39+
ME_CONFIG_BASICAUTH: false

dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:slim
2+
WORKDIR /app
3+
COPY package.json tsconfig.json ./
4+
RUN npm install
5+
COPY ./src ./src
6+
RUN npm run build
7+
EXPOSE 3000
8+
ENV NODE_ENV=production
9+
CMD ["node", "dist/src/main.js"]

eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import eslint from "@eslint/js";
2+
import eslintTypescript from "typescript-eslint";
3+
import eslintPrettier from "eslint-config-prettier";
4+
import globals from "globals";
5+
6+
export default eslintTypescript.config(
7+
{
8+
ignores: ["*.mjs", "node_modules", "dist"]
9+
},
10+
eslint.configs.recommended,
11+
...eslintTypescript.configs.strict,
12+
...eslintTypescript.configs.stylistic,
13+
eslintPrettier,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.node,
18+
...globals.jest
19+
},
20+
parserOptions: {
21+
projectService: true,
22+
tsconfigRootDir: import.meta.dirname
23+
}
24+
}
25+
},
26+
{
27+
rules: {
28+
"@typescript-eslint/no-extraneous-class": "off"
29+
}
30+
}
31+
);

0 commit comments

Comments
 (0)