A progressive Node.js framework for building efficient and scalable server-side applications.
## Status
This project is still in development and not ready for production, it's not even ready to install yet. Calling for contributors to help this project.
## Description
Nest Auto CRUD is a library that provides a set of modules, decorator, service, and many more to reduce the boilerplate code.
**I will make the API backward compatible, so you don't need to worry about upgrading the version**
## Roadmap
### Basic Thing
- Custom body mapping
- Custom validation
### Advanced Support
- Generic support for Prisma ORM [#5273](https://github.com/prisma/prisma/issues/5273)
## Installation
```bash
$ npm install @aditama-labs/nest-autocrud
```
## Example
### Environment Variable
```typescript
// Yes, either Prisma or TypeORM just need this single line of ENV
// PostgreSQL Example
DATABASE_URL =
'postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public';
// MySQL Example
DATABASE_URL = 'mysql://johndoe:randompassword@localhost:3306/mydb';
```
### Prisma ORM
```typescript
// Your Module
@Module({
imports: [
// This module will automatically map your model to the controller
PrismaModule.forRoot({
delegate: (prisma: PrismaClient) => prisma.user,
}),
],
controllers: [AppController],
providers: [],
})
export class AppModule {}
// Your Controller
@Controller('examples')
export class AppController extends SkeletonCRUDController {
// Yes, no need to write anything here
}
```
### TypeORM
```typescript
// Your Entity
@Entity('account')
export class UserEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ type: String })
username: string;
@Column({ type: String })
name: string;
}
// Your Module
@Module({
// This module will automatically map your model to the controller
imports: [
TypeORMModule.forRoot