Skip to content

Commit dcf1d37

Browse files
committed
init: first commit
0 parents  commit dcf1d37

File tree

155 files changed

+21370
-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.

155 files changed

+21370
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://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+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.env

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
DB_URL={DB_URL}
2+
3+
JWT_SALT={JWT_SALT}
4+
JWT_MAX_AGE={JWT_MAX_AGE}
5+
6+
NODE_ENV={NODE_ENV}
7+
NODE_PORT={NODE_PORT}
8+
9+
PAGE_LIMIT={PAGE_LIMIT}
10+
11+
OTP_MIN_MINUTE={OTP_MIN_MINUTE}
12+
13+
AWS_S3_BUCKET={AWS_S3_BUCKET}
14+
AWS_ACCESS_KEY={AWS_ACCESS_KEY}
15+
AWS_SECRET_KEY={AWS_SECRET_KEY}
16+
AWS_REGION={AWS_REGION}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nx/javascript"],
32+
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
40+
}
41+
]
42+
}

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
/out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"dbaeumer.vscode-eslint"
7+
]
8+
}

.vscode/launch.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
"name": "Attach to NestJS Application",
9+
"type": "node",
10+
"request": "attach",
11+
"port": 9229, // Adjust if necessary
12+
"restart": true,
13+
"stopOnEntry": false,
14+
"protocol": "inspector"
15+
}
16+
]
17+
}

.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll": "explicit",
6+
"source.organizeImports": "explicit"
7+
}
8+
}

.vscode/tasks.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "nx",
7+
"type": "shell",
8+
"args": ["build"],
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
12+
}
13+
},
14+
{
15+
"label": "serve",
16+
"command": "nx",
17+
"type": "shell",
18+
"args": ["serve", "inventory-system"],
19+
"group": {
20+
"kind": "test",
21+
"isDefault": true
22+
}
23+
}
24+
]
25+
}

README.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# InventorySystem
2+
3+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4+
5+
**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**
6+
7+
8+
## Start the app
9+
10+
To start the development server run `nx serve inventory-system`. Open your browser and navigate to http://localhost:4200/. Happy coding!
11+
12+
13+
## Generate code
14+
15+
If you happen to use Nx plugins, you can leverage code generators that might come with it.
16+
17+
Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list <plugin-name>` to see what generators are available.
18+
19+
Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators).
20+
21+
## Running tasks
22+
23+
To execute tasks with Nx use the following syntax:
24+
25+
```
26+
nx <target> <project> <...options>
27+
```
28+
29+
You can also run multiple targets:
30+
31+
```
32+
nx run-many -t <target1> <target2>
33+
```
34+
35+
..or add `-p` to filter specific projects
36+
37+
```
38+
nx run-many -t <target1> <target2> -p <proj1> <proj2>
39+
```
40+
41+
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks).
42+
43+
## Want better Editor Integration?
44+
45+
Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
46+
47+
## Ready to deploy?
48+
49+
Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed.
50+
51+
## Set up CI!
52+
53+
Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
54+
55+
- [Set up remote caching](https://nx.dev/core-features/share-your-cache)
56+
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
57+
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
58+
59+
## Connect with us!
60+
61+
- [Join the community](https://nx.dev/community)
62+
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
63+
- [Follow us on Twitter](https://twitter.com/nxdevtools)
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'inventory-system-e2e',
4+
preset: '../../jest.preset.js',
5+
globalSetup: '<rootDir>/src/support/global-setup.ts',
6+
globalTeardown: '<rootDir>/src/support/global-teardown.ts',
7+
setupFiles: ['<rootDir>/src/support/test-setup.ts'],
8+
testEnvironment: 'node',
9+
transform: {
10+
'^.+\\.[tj]s$': [
11+
'ts-jest',
12+
{
13+
tsconfig: '<rootDir>/tsconfig.spec.json',
14+
},
15+
],
16+
},
17+
moduleFileExtensions: ['ts', 'js', 'html'],
18+
coverageDirectory: '../../coverage/inventory-system-e2e',
19+
};
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "inventory-system-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"implicitDependencies": ["inventory-system"],
5+
"projectType": "application",
6+
"targets": {
7+
"e2e": {
8+
"executor": "@nx/jest:jest",
9+
"outputs": ["{workspaceRoot}/coverage/{e2eProjectRoot}"],
10+
"options": {
11+
"jestConfig": "apps/inventory-system-e2e/jest.config.ts",
12+
"passWithNoTests": true
13+
}
14+
},
15+
"lint": {
16+
"executor": "@nx/eslint:lint",
17+
"outputs": ["{options.outputFile}"]
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import axios from 'axios';
2+
3+
describe('GET /api', () => {
4+
it('should return a message', async () => {
5+
const res = await axios.get(`/api`);
6+
7+
expect(res.status).toBe(200);
8+
expect(res.data).toEqual({ message: 'Hello API' });
9+
});
10+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
var __TEARDOWN_MESSAGE__: string;
3+
4+
module.exports = async function () {
5+
// Start services that that the app needs to run (e.g. database, docker-compose, etc.).
6+
console.log('\nSetting up...\n');
7+
8+
// Hint: Use `globalThis` to pass variables to global teardown.
9+
globalThis.__TEARDOWN_MESSAGE__ = '\nTearing down...\n';
10+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable */
2+
3+
module.exports = async function () {
4+
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
5+
// Hint: `globalThis` is shared between setup and teardown.
6+
console.log(globalThis.__TEARDOWN_MESSAGE__);
7+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
3+
import axios from 'axios';
4+
5+
module.exports = async function () {
6+
// Configure axios for tests to use.
7+
const host = process.env.HOST ?? 'localhost';
8+
const port = process.env.PORT ?? '3000';
9+
axios.defaults.baseURL = `http://${host}:${port}`;
10+
};
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"files": [],
4+
"include": [],
5+
"references": [
6+
{
7+
"path": "./tsconfig.spec.json"
8+
}
9+
],
10+
"compilerOptions": {
11+
"esModuleInterop": true
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"include": ["jest.config.ts", "src/**/*.ts"]
9+
}

0 commit comments

Comments
 (0)