Skip to content

easycontabil/ESC-Question

Repository files navigation

ESC-Question ❓

Easy Contabil questions

GitHub followers GitHub stars

GitHub language count Repository size License

Easy Contabil questions with ESC-Question.

🚀 Running the project

Install dependencies

yarn

Generate the archive .env and change the connection of Redis and MongoDB

cp .env.example .env && cp .env.example .env.testing

To run E2E and Unit tests without logs

yarn test

To run E2E and Unit tests with debug logs

yarn test:debug

To run the application in development mode without debug logs

yarn start:dev

To run the application in development mode with debug logs

yarn start:debug:dev

🏗️ Architecture

Single module architecture

History

The heart of the project is within start/kernel.ts, app/AppModule.ts and providers/ApplicationProvider. start/kernel.ts is where an array of imports is created to be used within NestJS, this array is always called in the imports of the AppModule, and he loads some of the config/*.ts files from the project.

providers/ApplicationProvider load all the providers (services, repositories, models, guards, middlewares, pipes and controllers) from the application, AppModule will call ApplicationProvider as a Singleton and constructor will execute all the boot methods inside it and creating arrays to use inside AppModule providers and controllers. Basically if you need to create a new controller or service, you don't need to pass it into the AppModule, just create the file and let ApplicationProvider take care of the rest.

Project Structure

🛑 Is extremely important to follow this project structure to providers/ApplicationProvider works. 🛑

app
├── Contracts
│   ├── Dtos
│   ├── *Contract.ts
├── Http
│   ├── Filters
│   ├── Guards
│   ├── Interceptors
│   ├── Middlewares
│   ├── *Controller.ts
├── Validators
│   ├── *Validator.ts
├── Decorators
|   ├── Http
|   ├── Validators
│   ├── *.ts
├── Models
│   ├── *.ts
├── Pipes
│   ├── *Pipe.ts
├── Repositories
│   ├── *Repository.ts
├── Services
│   ├── Api
│   ├── Collections
│   ├── Utils
├── AppModule.ts
config
├── *.ts
database
├── *.ts
├── *.sql
providers
├── *.ts
├── ApplicationProvider.ts
start
├── chalk.ts
├── debug.ts
├── env.ts
├── kernel.ts
├── main.ts
test
├── E2E
│   ├── Resource Name
├── Unit
│   ├── Resource Name
├── Utils
│   ├── App.ts
│   ├── Database.ts

👨‍🏫 Tutorials

How to create a CRUD ?

Commands

First, install Yeoman and SecJS Generator using npm.

npm install -g yo
npm install -g generator-secjs@1.1.0

Then generate your CRUD using the generateCrud.sh and your resource name, in this case Foo, 🛑 please put your terminal at the root of the project and run: 🛑

./.github/generateCrud.sh Foo

😎🎉 Foo CRUD has been created, and the files has been moved to the correct folders to work with providers/ApplicationProvider.ts

Now start implementing your methods inside Model, Dto, Validator, Controller and Service!


🧩 Resources

Swagger Collections

Just run the project and enter inside ${your.url}/portal/swagger in your browser to see the Swagger Collections.


📝 License

This project is under MIT license. See the archive LICENSE for more details.


Made with 🖤 by jlenon7 👋

About

⚙️ Easy Contabil Question API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published