Skip to content

Commit c6b9c88

Browse files
committed
feat(nestjs, swagger): Switch to nestjs, and add swagger for api documentation
1 parent ec07aac commit c6b9c88

File tree

97 files changed

+9928
-4367
lines changed

Some content is hidden

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

97 files changed

+9928
-4367
lines changed

.dockerignore

-4
This file was deleted.

.eslintrc.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: __dirname,
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: [
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js'],
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/explicit-module-boundary-types': 'off',
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
semi: ['error', 'never'],
25+
'prettier/prettier': ['error', { semi: false }],
26+
},
27+
}

.gitignore

+59-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,60 @@
1-
node_modules
1+
# compiled output
2+
/dist
3+
/node_modules
4+
/build
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
pnpm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# OS
16+
.DS_Store
17+
18+
# Tests
19+
/coverage
20+
/.nyc_output
21+
22+
# IDEs and editors
23+
/.idea
24+
.project
25+
.classpath
26+
.c9/
27+
*.launch
28+
.settings/
29+
*.sublime-workspace
30+
31+
# IDE - VSCode
32+
.vscode/*
33+
!.vscode/settings.json
34+
!.vscode/tasks.json
35+
!.vscode/launch.json
36+
!.vscode/extensions.json
37+
38+
# dotenv environment variable files
239
.env
3-
.data
4-
dist
40+
.env.development.local
41+
.env.test.local
42+
.env.production.local
43+
.env.local
44+
45+
# temp directory
46+
.temp
47+
.tmp
48+
49+
# Runtime data
50+
pids
51+
*.pid
52+
*.seed
53+
*.pid.lock
54+
55+
# Diagnostic reports (https://nodejs.org/api/report.html)
56+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
57+
58+
# Database
59+
60+
.data/

.prettierrc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"tabWidth": 2,
3-
"useTabs": false,
2+
"singleQuote": true,
43
"trailingComma": "all",
5-
"semi": false,
6-
"singleQuote": true
4+
"tabWidth": 2,
5+
"semi": false
76
}

.swcrc

-40
This file was deleted.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ COPY . .
1010

1111
RUN npm run build
1212

13-
CMD ["npm", "start"]
13+
CMD ["npm", "run", "start:prod"]

README.md

+55-31
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,73 @@
1-
# E-Commerce (README deprecated)
1+
<p align="center">
2+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
3+
</p>
24

3-
E-Commerce project. School work. (Under development)
5+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6+
[circleci-url]: https://circleci.com/gh/nestjs/nest
47

5-
## Config
8+
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9+
<p align="center">
10+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13+
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14+
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
15+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
16+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
17+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
18+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
19+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
20+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
21+
</p>
22+
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
23+
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
624

7-
Create your `.env` following `.env.example` and don't forget
8-
to modify the `const HOST` in `src/public/js/config.mjs`
25+
## Description
926

10-
## Development
27+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
1128

12-
Modify the `HOST=` in `.env` to your location and the `NODE_ENV=` to
13-
`development` and modify the `const HOST` in `src/public/js/config.mjs` as well.
29+
## Installation
1430

1531
```bash
16-
npm ci
17-
npm run build
32+
$ npm install
1833
```
1934

20-
## Up
35+
## Running the app
2136

2237
```bash
23-
docker-compose up
38+
# development
39+
$ npm run start
40+
41+
# watch mode
42+
$ npm run start:dev
43+
44+
# production mode
45+
$ npm run start:prod
46+
```
47+
48+
## Test
49+
50+
```bash
51+
# unit tests
52+
$ npm run test
53+
54+
# e2e tests
55+
$ npm run test:e2e
56+
57+
# test coverage
58+
$ npm run test:cov
2459
```
2560

26-
## Dependencies
61+
## Support
2762

28-
- `bcrypt`
29-
- `cookie-parser`
30-
- `cors`
31-
- `dotenv`
32-
- `compression`
33-
- `express`
34-
- `jsonwebtoken`
35-
- `node-cron`
36-
- `nodemailer`
37-
- `sequelize`
38-
- `sqlite3`
39-
- `xss`
40-
- `zod`
63+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
4164

42-
## Database
65+
## Stay in touch
4366

44-
Currently the project uses SQLite `sqlite3` and `sequelize` as ORM.
45-
The database location is at `.data/database.db`
67+
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
68+
- Website - [https://nestjs.com](https://nestjs.com/)
69+
- Twitter - [@nestframework](https://twitter.com/nestframework)
4670

47-
## Preview
71+
## License
4872

49-
https://developstore.up.railway.app
73+
Nest is [MIT licensed](LICENSE).

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ services:
1111
- "${PORT}:${PORT}"
1212
env_file:
1313
- .env
14-
command: ["npm", "start"]
14+
command: ["npm", "run", "start:prod"]

eslint.config.js

-17
This file was deleted.

nest-cli.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"deleteOutDir": true
7+
}
8+
}

0 commit comments

Comments
 (0)