Nest-Pegasus is an all-in-one full-stack backend framework that incorporates content management, user authentication, role-based access control, search, and file handling capabilities.
Here's an overview of the project's directory structure:
.
βββ assets # Static files for populating data
β βββ ...
βββ cli.js # Command line tool entry
βββ config # Configuration files for each module
β βββ ...
βββ creator.ts
βββ database # Database migration, seeding, etc.
β βββ ...
βββ main.ts
βββ modules
β βββ content # Content module
β β βββ ...
β βββ core # Dynamic configuration system, global validation pipes, interceptors, and filters
β β βββ ...
β βββ database # Database module
β β βββ ...
β βββ elastic # ElasticSearch full-text search
β β βββ ...
β βββ media # File upload/download and cloud storage
β β βββ ...
β βββ queue # BullMQ asynchronous message queue
β β βββ ...
β βββ rbac # Dynamic permission module based on CASL
β β βββ ...
β βββ redis
β β βββ ...
β βββ restful # Configurable RESTful routing
β β βββ ...
β βββ sender # WebSocket message broadcasting
β β βββ ...
β βββ user # User module
β βββ ...
βββ routes # Open API document version configuration
βββ index.ts
βββ v1.ts
Nest-Pegasus provides a comprehensive backend solution that covers content management, user authentication, role-based access control, search, and file handling capabilities. Here are the key features and functionality of the project:
- Powerful content management system, supporting creation, update, and deletion of various content types, including articles, media files, and more.
- Comprehensive user authentication and authorization, using JWT tokens and role-based access control (RBAC) to manage user access to resources.
- Elasticsearch integration for fast and efficient full-text search capabilities.
- File handling and storage, supporting both local and cloud-based storage solutions.
- Asynchronous message queue processing with BullMQ for handling background tasks and improving application performance.
- Redis integration for caching and session management.
- Extensive API support with OpenAPI documentation and versioning
- Implementation of third-party login using OAuth2.
- Multilingual support.
- API rate limiting and security measures.
- Containerization and deployment.
- GraphQL integration.
- ...
Nest-Pegasus is built on top of a robust technology stack and relies on various libraries and tools to deliver its features. Here is a list of the main technologies and dependencies used in the project:
- Nest.js: A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- TypeScript: A strongly-typed superset of JavaScript that enables better developer experience and improved code maintainability.
- TypeORM: A powerful Object Relational Mapping (ORM) library for TypeScript and JavaScript that supports multiple databases and advanced querying capabilities.
- MySQL: A popular open-source relational database management system used for storing and managing application data.
- Elasticsearch: A distributed, RESTful search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured.
- Fastify: A high-performance web framework for Node.js that provides faster HTTP responses and lower overhead compared to other frameworks.
- BullMQ: A powerful and easy-to-use message queue library for Node.js built on top of Redis.
- Redis: An in-memory data structure store, used as a database, cache, and message broker.
In addition to these core technologies, Nest-Pegasus also utilizes various other libraries and tools to support its functionality. The full list of dependencies can be found in the package.json
file of the project.
To get started with Nest-Pegasus, follow these steps:
- Clone and Install dependencies
git clone https://github.com/ksdaylight/Nest-Pegasus.git
cd nest-pegasus
pnpm install
- Configure environment variables: Create a
.env
file in the root directory of the project and configure the necessary environment variables. You can use the provided.env.example
file as a reference. - Run database migrations: First, run the following command to generate the migration files:
pnpm dbmg
Next, run the following command to perform the database migrations and seed data:
pnpm dbmr -s
You can use pnpm cli -h
to see the help for available commands. This command will perform the migrations and then seed the database with initial data.
After completing the installation and configuration steps, you can now run and deploy Nest-Pegasus
pnpm start
To help you better understand the various processes and functionalities within Nest-Pegasus, we've provided a series of flowcharts and result demonstrations. These visual aids will help you comprehend the inner workings of the framework.