mv-api-typescript is a backend REST API project that serves as the rewrite for the mv-frontend application. It utilizes various essential dependencies such as Prisma, NestJS, Axios, and Passport for authentication. Other notable dependencies include bcrypt for password hashing, class-transformer and class-validator for data validation, and Swagger for API documentation. The project also includes testing frameworks like Jest and Supertest, as well as linting tools like ESLint and Prettier.
├── .env.example
├── .eslintrc.js
├── .gitignore
├── .prettierrc
├── README.md
├── nest-cli.json
├── package-lock.json
├── package.json
├── prisma
│ ├── dbml
│ │ └── schema.dbml
│ ├── migrations
│ │ ├── 20220601233524_init_db
│ │ │ └── migration.sql
│ │ └── migration_lock.toml
│ └── schema.prisma
├── src
│ ├── app.controller.spec.ts
│ ├── app.controller.ts
│ ├── app.module.ts
│ ├── app.service.ts
│ ├── auth
│ │ ├── auth.controller.spec.ts
│ │ ├── auth.controller.ts
│ │ ├── auth.module.ts
│ │ ├── auth.service.spec.ts
│ │ ├── auth.service.ts
│ │ ├── dto
│ │ │ ├── jwt.dto.ts
│ │ │ └── login.dto.ts
│ │ └── password
│ │ ├── jwt.strategy.ts
│ │ ├── password.service.spec.ts
│ │ └── password.service.ts
│ ├── common
│ │ ├── CONSTANTS.ts
│ │ ├── config
│ │ │ ├── config.interface.ts
│ │ │ └── config.ts
│ │ ├── decorators
│ │ │ ├── public.decorator.ts
│ │ │ ├── role.decorator.ts
│ │ │ └── status.decorator.ts
│ │ ├── dtos
│ │ │ └── create-user.dto.ts
│ │ ├── guards
│ │ │ ├── jwt.guard.spec.ts
│ │ │ ├── jwt.guard.ts
│ │ │ ├── role.guard.spec.ts
│ │ │ ├── role.guard.ts
│ │ │ ├── status.guard.spec.ts
│ │ │ └── status.guard.ts
│ │ ├── middleware
│ │ │ └── logging.middleware.ts
│ │ ├── models
│ │ │ ├── req.model.ts
│ │ │ ├── token.model.ts
│ │ │ └── user.model.ts
│ │ └── types
│ │ └── user.model.ts
│ ├── healthcheck
│ │ ├── db.healthcheck.ts
│ │ └── status.healthcheck.ts
│ ├── main.ts
│ └── users
│ ├── dto
│ │ └── update-user.dto.ts
│ ├── users.controller.spec.ts
│ ├── users.controller.ts
│ ├── users.module.ts
│ ├── users.service.spec.ts
│ └── users.service.ts
├── test
│ ├── app.e2e-spec.ts
│ └── jest-e2e.json
├── tsconfig.build.json
└── tsconfig.json
- prisma: Database ORM and migration tool.
- src: Main source code directory.
- src/auth: Authentication related components.
- src/common: Common functionalities and utilities.
- src/healthcheck: Endpoint for health checks.
- src/users: User related components.
- src/users/dto: Data transfer objects for user operations.
- test: Directory for tests.
- prisma/migrations: Database migration scripts.
- prisma/dbml: Database schema definition using DBML language.
- nestjs/jwt: JWT authentication for NestJS.
- nestjs/passport: Authentication middleware for NestJS.
- nestjs/platform-express: Express integration for NestJS.
- prisma/client: Prisma client for database access and management.
- class-validator: Validation library for TypeScript and JavaScript.
- nestjs-prisma: Prisma integration for NestJS.
- nestjs/swagger: Swagger module for NestJS to generate API documentation.
- nestjs/testing: Testing utilities for NestJS.
- Choose a username for the PostgreSQL database.
- Ensure that the username follows the naming conventions and security best practices.
- Use a secure password for the user account.
- Avoid using common or easily guessable usernames.
- Generate a strong and secure password for the PostgreSQL user account.
- Use a combination of uppercase and lowercase letters, numbers, and special characters.
- Ensure that the password is not easily guessable or common.
- Consider using a password manager to generate and store the password securely.
- Decide on a name for the PostgreSQL database.
- Choose a name that reflects the purpose or content of the database.
- Ensure that the database name follows the naming conventions and guidelines.
- Avoid using reserved keywords or special characters in the database name.
- If running locally, set the value to the hostname or IP address of the PostgreSQL database server.
- If running in a Docker container, set the value to the hostname or container name of the PostgreSQL database container.
- Specify the port number on which the PostgreSQL database server is running.
- The default port for PostgreSQL is 5432.
- If using a non-default port, provide the appropriate port number.
- Generate a secure secret key for signing access tokens.
- Use a random string of characters with sufficient length.
- Store the secret key securely and avoid sharing it publicly.
- Generate a secure secret key for signing refresh tokens.
- Use a random string of characters with sufficient length.
- Store the secret key securely and avoid sharing it publicly.
1.Clone the mv-api-typescript repository:
git clone https://github.com/Braggedtooth/mv-api-typescript
2.Install the dependencies with one of the package managers listed below:
pnpm install
bun install
npm install
yarn install
3.Start the development mode:
pnpm dev
bun dev
npm run dev
yarn dev
[Application name](Your App URL)