|
1 | | -# Rockets |
| 1 | +# Rockets Server |
2 | 2 |
|
3 | 3 |  |
4 | 4 |
|
|
17 | 17 | Rapid Enterprise Development Toolkit |
18 | 18 | ``` |
19 | 19 |
|
20 | | -A collection of NestJS modules |
21 | | -that were created for the rapid development of enterpise level APIs. |
22 | | - |
23 | | -All reasonable efforts have been made to provide loosely coupled interfaces, |
24 | | -overridable services, and sane default implementations. |
25 | | - |
26 | | -## Contributing |
27 | | - |
28 | | -This project is currently in alpha testing, however, feedback is highly |
29 | | -appreciated and encouraged! |
30 | | - |
31 | | -Pull requests will be gratefully accepted in the very near future, |
32 | | -once we have finalized our Contributor License Agreement. |
33 | | - |
34 | | -## Modules |
35 | | - |
36 | | -| Module | Summary | |
37 | | -| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | |
38 | | -| [nestjs-access-control](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-access-control 'nestjs-access-control') | Advanced access control guard for NestJS with optional per-request filtering. | |
39 | | -| [nestjs-auth-github](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-auth-github 'nestjs-auth-github') | Authenticate requests using GitHub oAuth2 sign-on. | |
40 | | -| [nestjs-auth-jwt](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-auth-jwt 'nestjs-auth-jwt') | Authenticate requests using JWT tokens passed via the request (headers, cookies, body, query, etc). | |
41 | | -| [nestjs-auth-local](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-auth-local 'nestjs-auth-local') | Authenticate requests using username/email and password against a local or remote data source. | |
42 | | -| [nestjs-auth-refresh](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-auth-refresh 'nestjs-auth-refresh') | Authenticate requests using JWT refresh tokens passed via the request (headers, cookies, body, query, etc). | |
43 | | -| [nestjs-authentication](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-authentication 'nestjs-authentication') | Authenticate requests using one or more strategies (local, jwt, etc). | |
44 | | -| [nestjs-common](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-common 'nestjs-common') | The common module is a dependency of all Rockets modules. | |
45 | | -| [nestjs-crud](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-crud 'nestjs-crud') | Extremely powerful CRUD module that is an extension/wrapper of the popular @nestjsx/crud module. | |
46 | | -| [nestjs-email](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-email 'nestjs-email') | Email deliver module that supports most popular transports, as well as template based email bodies using handlebars syntax. | |
47 | | -| [nestjs-event](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-event 'nestjs-event') | Advanced class based event dispatch/listener module. | |
48 | | -| [nestjs-jwt](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-jwt 'nestjs-jwt') | A flexible JWT utilities module for signing and validating tokens. | |
49 | | -| [nestjs-logger](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-logger 'nestjs-logger') | Drop-in replacement for the core NestJS logger that provides additonal support for pushing log data to external log providers. | |
50 | | -| [nestjs-password](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-password 'nestjs-password') | A flexible Password utilities module that provides services for password strength, creation and storage. | |
51 | | -| [nestjs-swagger-ui](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-swagger-ui 'nestjs-swagger-ui') | Expose your OpenApi spec on your API using the powerful Swagger UI interface. | |
52 | | -| [nestjs-typeorm-ext](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-typeorm-ext 'nestjs-typeorm-ext') | Extension of the NestJS TypeOrm module that allows your dynamic modules to accept drop-in replacements of custom entities and repositories. | |
53 | | -| [nestjs-user](https://github.com/conceptadev/rockets/tree/main/packages/nestjs-user 'nestjs-user') | A module for managing a basic User entity, including controller with full CRUD, DTOs, sample data factory and seeder. | |
| 20 | +## Overview |
| 21 | + |
| 22 | +**Rockets Server** is a comprehensive authentication and user management |
| 23 | +solution for NestJS applications. It provides JWT authentication, user |
| 24 | +management, OTP verification, email notifications, and API documentation |
| 25 | +out of the box. |
| 26 | + |
| 27 | +## 🚀 Quick Start |
| 28 | + |
| 29 | +### Installation |
| 30 | + |
| 31 | +```bash |
| 32 | +npm install @concepta/rockets-server @concepta/nestjs-typeorm-ext typeorm |
| 33 | +``` |
| 34 | + |
| 35 | +### Basic Setup |
| 36 | + |
| 37 | +```typescript |
| 38 | +// app.module.ts |
| 39 | +import { Module } from '@nestjs/common'; |
| 40 | +import { RocketsServerModule } from '@concepta/rockets-server'; |
| 41 | +import { TypeOrmExtModule } from '@concepta/nestjs-typeorm-ext'; |
| 42 | +import { UserEntity } from './entities/user.entity'; |
| 43 | +import { UserOtpEntity } from './entities/user-otp.entity'; |
| 44 | +import { FederatedEntity } from './entities/federated.entity'; |
| 45 | + |
| 46 | +@Module({ |
| 47 | + imports: [ |
| 48 | + TypeOrmExtModule.forRoot({ |
| 49 | + type: 'sqlite', |
| 50 | + database: ':memory:', |
| 51 | + synchronize: true, |
| 52 | + autoLoadEntities: true, |
| 53 | + }), |
| 54 | + TypeOrmExtModule.forFeature({ |
| 55 | + user: { entity: UserEntity }, |
| 56 | + }), |
| 57 | + TypeOrmExtModule.forFeature({ |
| 58 | + userOtp: { entity: UserOtpEntity }, |
| 59 | + }), |
| 60 | + TypeOrmExtModule.forFeature({ |
| 61 | + federated: { entity: FederatedEntity }, |
| 62 | + }), |
| 63 | + RocketsServerModule.forRoot({ |
| 64 | + jwt: { |
| 65 | + settings: { |
| 66 | + access: { secret: 'your-secret-key' }, |
| 67 | + refresh: { secret: 'your-refresh-secret' }, |
| 68 | + }, |
| 69 | + }, |
| 70 | + services: { |
| 71 | + mailerService: { |
| 72 | + sendMail: (options) => { |
| 73 | + console.log('Email sent:', options.to); |
| 74 | + return Promise.resolve(); |
| 75 | + }, |
| 76 | + }, |
| 77 | + }, |
| 78 | + }), |
| 79 | + ], |
| 80 | +}) |
| 81 | +export class AppModule {} |
| 82 | +``` |
| 83 | + |
| 84 | +That's it! You now have: |
| 85 | + |
| 86 | +- Authentication endpoints (`/auth/login`, `/auth/signup`, etc.) |
| 87 | +- User management (`/user`) |
| 88 | +- OTP verification (`/otp`) |
| 89 | +- API documentation (`/api`) |
| 90 | + |
| 91 | +## 📖 Documentation |
| 92 | + |
| 93 | +For detailed setup, configuration, and API reference, see: |
| 94 | + |
| 95 | +**[📚 Complete Documentation](./packages/rockets-server/README.md)** |
| 96 | + |
| 97 | +## 🔧 Dependencies |
| 98 | + |
| 99 | +Rockets Server is built on top of the |
| 100 | +[nestjs-modules](https://github.com/btwld/nestjs-modules) collection. Visit the |
| 101 | +repository to explore individual modules for authentication, user management, email, |
| 102 | +and more. |
| 103 | + |
| 104 | +## 🤝 Contributing |
| 105 | + |
| 106 | +This project is currently in alpha testing, however, feedback is highly appreciated |
| 107 | +and encouraged! |
| 108 | + |
| 109 | +Pull requests will be gratefully accepted in the very near future, once we have |
| 110 | +finalized our Contributor License Agreement. |
| 111 | + |
| 112 | +## 📄 License |
| 113 | + |
| 114 | +This project is licensed under the MIT License - see the |
| 115 | +[LICENSE.txt](LICENSE.txt) file for details. |
0 commit comments