- 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
- Husky for check your commit
- MongoDB Database
PAPI-STARTER
├── node_modules
├── src
│ ├── assets
│ ├── config
│ ├── console
│ ├── database
│ ├── modules
│ │ ├── master
│ │ │ └── examples
│ │ │ ├── controllers
│ │ │ ├── repositories
│ │ │ ├── rules
│ │ │ ├── use-cases
│ │ │ ├── entity.ts
│ │ │ ├── factory.ts
│ │ │ ├── interface.ts
│ │ │ ├── router.ts
│ │ │ └── schema.ts
│ └── test
│ ├── setup.ts
│ └── utils.ts
├── .env.example
├── .env.test.example
├── .cli.ts
└── README.mdSince 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
We are using Bun as a drop-in replacement for Node.js
Linux / MacOS
curl -fsSL https://bun.sh/install | bashWindows
powershell -c "irm bun.sh/install.ps1 | iex"cp .env.example .env
cp .env.test.example .env.test
bun install --frozen-lock
bun run devbun cli db:initbun cli db:defaultTesting all test case
bun testTesting coverage
bun test:coverageTesting report
bun test:reportTesting specific file or directory
# Test specific directory
bun test src/modules/master/examples/controllers
# Test specific file
bun test src/modules/master/examples/controllers/create.spec
# Test specific test case
bun test src/modules/master/examples/controllers/create.spec -t "test case"