Skip to content

Instantly share code, notes, and snippets.

@Taofiqq
Created December 31, 2024 16:38
Show Gist options
  • Save Taofiqq/b49c1d6717505d846c8ffc30976e721c to your computer and use it in GitHub Desktop.
Save Taofiqq/b49c1d6717505d846c8ffc30976e721c to your computer and use it in GitHub Desktop.
Folder structure for a multi-tenant e-commerce API using NestJS with role-based access control and Permit.io integration.
├── src/
│   ├── auth/
│   │   ├── auth.controller.ts
│   │   ├── auth.module.ts
│   │   ├── auth.service.ts
│   │   ├── jwt.strategy.ts
│   │   ├── dto/
│   │   │   ├── login.dto.ts
│   │   │   └── register-tenant.dto.ts
│   │   ├── decorators/
│   │   │   └── require-permission.decorator.ts
│   │   ├── guards/
│   │   │   ├── jwt-auth.guard.ts
│   │   │   └── permit.guard.ts
│   ├── config/
│   │   ├── database.config.ts
│   │   └── jwt.config.ts
│   ├── order/
│   │   ├── entities/
│   │   │   ├── order-item.entity.ts
│   │   │   └── order.entity.ts
│   │   ├── order.controller.ts
│   │   ├── order.dto.ts
│   │   ├── order.module.ts
│   │   └── order.service.ts
│   ├── product/
│   │   ├── entities/
│   │   │   └── product.entity.ts
│   │   ├── product.controller.ts
│   │   ├── product.dto.ts
│   │   ├── product.module.ts
│   │   └── product.service.ts
│   ├── tenants/
│   │   ├── tenant-aware.entity.ts
│   │   ├── tenant.controller.ts
│   │   ├── tenant.decorator.ts
│   │   ├── tenant.dto.ts
│   │   ├── tenant.entity.ts
│   │   ├── tenant.middleware.ts
│   │   ├── tenant.module.ts
│   │   └── tenant.service.ts
│   ├── users/
│   │   ├── dto/
│   │   │   └── create-user.dto.ts
│   │   ├── entities/
│   │   │   └── user.entity.ts
│   │   ├── user.controller.ts
│   │   ├── user.module.ts
│   │   └── user.service.ts
│   ├── permit/
│   │   ├── permit.module.ts
│   │   └── permit.service.ts
│   ├── app.controller.ts
│   ├── app.module.ts
│   ├── app.service.ts
│   ├── main.ts
├── .env
├── .env.example
├── package.json
├── tsconfig.json
├── tsconfig.build.json
├── README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment