Nestjs Mysql Api

screenshot of Nestjs Mysql Api
nestjs

NestJs CRUD for RESTful API使用nestjs+mysql+typeorm+jwt+swagger企业项目中的RBAC权限管理、实现单地方登录。

Overview

This project presents a robust backend solution leveraging NestJS for building a role-based access control (RBAC) system. The well-structured framework utilizes both MySQL and TypeORM to facilitate effective database management. For frontend development, it adopts Vue3, ensuring a dynamic user interface that seamlessly integrates with the backend functionality. Whether you're an experienced developer or a newcomer, this project offers a solid foundation for enhancing your technical skills through practical application.

With features such as multi-point login restrictions, customizable token-based authentication, and comprehensive logging management via Winston, this project offers a mix of security and usability. It exemplifies a modern approach to application development, making it easier to implement critical functionalities like user login and permission controls.

Features

  • Vue3 Frontend Development: The frontend is developed with Vue3, providing a responsive and modern interface for users.
  • Angular Module Structure: It employs an Angular-like modular development approach, which enhances code organization and reusability.
  • MySQL with TypeORM: The project utilizes MySQL for data storage, with TypeORM handling database transactions to simplify operations.
  • Flexible Authentication: Users can log in using a username, phone number, or email, making it accessible for different user preferences.
  • Custom Token-Based Authentication: It incorporates a custom token authentication method alongside decorators and guards for securing APIs.
  • Single Session Login: The system allows only one active login session at a time to enhance security.
  • Winston for Logging Management: The logging is carefully managed through Winston, with logs organized by the hour for easier tracking and debugging.
  • RBAC Implementation: Role-Based Access Control is implemented to manage permissions efficiently, allowing users to have specific roles that define their access levels.
nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.