Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 2.84 KB

README.md

File metadata and controls

103 lines (78 loc) · 2.84 KB

napd-fastify

Some description of project

Installation

npm install

So copy the .env.example to .env and configure envroiment variables.

Tests

npm run test

Docker

Dev

Build

docker build -t napd-fastify .

Running

docker run -p 3000:3000 -e DEV=1 -v $(pwd):/app -t napd-fastify

Prod

Build

docker build -t napd-fastify .

Running

docker run -p 3000:3000 -t napd-fastify

Concept of Structure

├── package.json
├── package-lock.json
├── src/
│   ├── application/
│   │   ├── dtos/
│   │   │   └── createClientRequestDto.ts
│   │   ├── modules/
│   │   │   └── clientModule.ts
│   │   └── services/
│   │       └── clientService.ts
│   ├── config/
│   │   └── index.ts
│   ├── domain/
│   │   └── client
│   │       └── client.entity.ts
│   ├── infra/
│   │   └── responseApi.ts
│   ├── main.ts
│   ├── server.ts
│   └── web/
│       ├── client.controller.ts
│       └── controller.ts
├── test/
└── tsconfig.json

config Folder

Every base configuration is exported there, is an adapter between environment variables for TS/JS.

Architecture overall

The scaffolding is strictly based in the Hexagonal Architecture

@hgraca demonstration architecture

Dependencies

  • dotenv: Loads environment variables from .env file
  • fastify: Fast and low overhead web framework, for Node.js
  • fastify-plugin: Plugin helper for Fastify
  • fastify-swagger: Generate Swagger files automatically for Fastify.

Dev Dependencies

License

MIT