- Bun Javascript runtime
- Express Node.js framework
- Cors Cross-Origin Resource-Sharing enabled
- Helmet Secure HTTP Headers
- Typescript for type checking
- Bun Test for unit testing
- Supertest for e2e testing
- ESLint for code linting
- Prettier for code formatting
- Husky for check your commit
- MongoDB Database
PAPI-STARTER
├── node_modules
├── src
│ ├── assets
│ ├── config
│ ├── console
│ ├── database
│ ├── modules
│ │ └── example
│ │ ├── controllers
│ │ ├── repositories
│ │ ├── rest
│ │ ├── use-cases
│ │ ├── validations
│ │ ├── entity.ts
│ │ ├── factory.ts
│ │ ├── interface.ts
│ │ ├── router.ts
│ │ ├── schema.ts
│ │ └── seed.ts
│ └── test
│ ├── setup.ts
│ └── utils.ts
├── .env.example
├── .env.test.example
├── .cli.ts
└── README.md
Since transactions are built on concepts of logical sessions they require mechanics which are only available in a replica set environment.
Choose one of the options that you prefer
-
Install offline MongoDB database replica set using docker Docker MongoDB RS
-
Use online Database as a Service (DBaaS) Atlas MongoDB
cp .env.example .env
cp .env.test.example .env.test
bun install --frozen-lock
bun run dev
bun cli db:init
bun cli db:seed
Testing all test case
bun test
Testing specific file or folder
# Test specific file
bun test -- src/modules/example/controller/create.spec
# Test specific folder
bun test -- src/modules/example/controller
# Test example module
bun test -- src/modules/example