Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ GOOGLE_CALLBACK_URL=
# https://www.passportjs.org/packages/passport-jwt/
JWT_SECRET=
ACCESS_TOKEN=
ACCESS_TOKEN_VALIDITY=
ACCESS_TOKEN_VALIDITY=600000 # 10 minutes in milliseconds
REFRESH_TOKEN=
REFRESH_TOKEN_VALIDITY=
REFRESH_TOKEN_VALIDITY=604800000 # 1 day in milliseconds

# Domains config
# URL to which user should be redirected after logging in and CORS urls
Expand Down
44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ A simple booking system built with NestJS & Prisma ORM. This project was created

The project uses a PostgreSQL database running in Docker. Athentication has been implemented using the Google Auth0 with the JWT tokens. Each module features multiple unit and e2e tests.

## Run the project
## Requirements

This project requires [Node.js 20+](https://nodejs.org/en), [pnpm 9+](https://pnpm.io/) and [docker](https://www.docker.com/) to run.

## How to run the project

1. Clone the repository and install all dependencies using pnpm
2. Copy the `.env.example` to the `.env` file and update the variables
2. Copy the values from the `.env.example` to the `.env` file and update the variables
3. Start the database using the `docker:db` script
4. Push the prisma schema to the database `npx prisma db push`
5. Start the development server `pnpm run start:dev`
Expand Down
File renamed without changes.
55 changes: 55 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import importPlugin from "eslint-plugin-import";
import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
import unusedImportsPlugin from "eslint-plugin-unused-imports";
import eslintTs from "typescript-eslint";

/** @type {import("eslint").Linter.Config} */
export default [
...eslintTs.configs.recommended,
{
name: "General config",
plugins: {
"unused-imports": unusedImportsPlugin,
"simple-import-sort": simpleImportSortPlugin,
"import": importPlugin
},
rules: {
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_"
}
],
"import/newline-after-import": "error",
"import/no-mutable-exports": "error",
"simple-import-sort/imports": [
"error",
{
groups: [
// Node.js builtins prefixed with `node:`.
["^node:"],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^@?\\w"],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
["^"],
// Relative imports.
// Anything that starts with a dot.
["^\\."],
// Side effect imports.
["^\\u0000"]
]
}
]
}
},
{
ignores: ["dist"]
}
];
65 changes: 33 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"author": "Michał Strumpf",
"private": true,
"scripts": {
"build": "nest build",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/src/main",
"build": "nest build",
"ts:check": "tsc --noEmit",
"lint:check": "eslint \"{src,prisma,test}/**/*.ts\"",
"lint:fix": "eslint \"{src,prisma,test}/**/*.ts\" --fix",
Expand All @@ -27,58 +26,56 @@
"test:e2e:watch": "jest --config ./test/jest-e2e.json --watch"
},
"dependencies": {
"@nestjs/common": "^10.4.4",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.4",
"@nestjs/common": "^10.4.15",
"@nestjs/config": "^3.3.0",
"@nestjs/core": "^10.4.15",
"@nestjs/jwt": "^10.2.0",
"@nestjs/mapped-types": "^2.0.5",
"@nestjs/mapped-types": "^2.0.6",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.4.4",
"@nestjs/swagger": "^7.4.2",
"@prisma/client": "5.21.0",
"@nestjs/platform-express": "^10.4.15",
"@nestjs/swagger": "^8.1.0",
"@prisma/client": "6.1.0",
"bcrypt": "^5.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"compression": "^1.7.4",
"compression": "^1.7.5",
"cookie-parser": "^1.4.7",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.2.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@faker-js/faker": "^9.0.3",
"@nestjs/cli": "^10.4.5",
"@nestjs/schematics": "^10.1.4",
"@nestjs/testing": "^10.4.4",
"@faker-js/faker": "^9.3.0",
"@nestjs/cli": "^10.4.9",
"@nestjs/schematics": "^10.2.3",
"@nestjs/testing": "^10.4.15",
"@types/bcrypt": "^5.0.2",
"@types/compression": "^1.7.5",
"@types/cookie-parser": "^1.4.7",
"@types/cookie-parser": "^1.4.8",
"@types/express": "^5.0.0",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.5",
"@types/passport": "^1.0.16",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.2",
"@types/passport": "^1.0.17",
"@types/passport-google-oauth20": "^2.0.16",
"@types/passport-jwt": "^4.0.1",
"@types/supertest": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"@types/supertest": "^6.0.2",
"eslint": "^9.17.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "3.2.0",
"jest": "^29.5.0",
"prettier": "^3.3.3",
"prisma": "^5.21.0",
"eslint-plugin-unused-imports": "4.1.4",
"jest": "^29.7.0",
"prettier": "^3.4.2",
"prisma": "^6.1.0",
"source-map-support": "^0.5.21",
"supertest": "^7.0.0",
"ts-jest": "^29.2.5",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.6.3"
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"
Expand All @@ -102,5 +99,9 @@
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"engines": {
"node": ">=20",
"pnpm": ">=9"
}
}
Loading
Loading