Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/proyecto26/myapi

A template to create awesome APIs easily ⚡️
https://github.com/proyecto26/myapi

api api-server apis express-api express-js jwt-auth jwt-authentication jwt-token nest nestjs nestjs-backend nestjs-logger nestjs-postgres nestjs-starter-template nestjs-typeorm nodejs-api typeorm typescript web-api

Last synced: 1 day ago
JSON representation

A template to create awesome APIs easily ⚡️

Awesome Lists containing this project

README

        


Nest Logo

| | MyApi SQL Template |
| - | ------------ |
| ⚡️ | **Launch your api instantly** watching changes with live-reload |
| 📈 | **Highly scalable** using [Repository design pattern](https://docs.nestjs.com/techniques/database#repository-pattern) to access the database even easier |
| 😎 | **OpenAPI** with [Swagger](https://docs.nestjs.com/openapi/introduction) to describe your RESTful APIs |
| ✨ | **KISS principle** make everything as simple as possible, but not simpler |
| 📱 | **Mobile friendly** supporting Cross-origin resource sharing (CORS) with a list of domains for restricted resources |
| 🔑 | **Security** using JWT authentication strategy with [Passport](https://docs.nestjs.com/techniques/authentication) and other techniques to increase the security of your applications |
| 👥 | **Made for Users.** Easily validate permissions for specific routes using [Guards](https://docs.nestjs.com/guards) with a Role-based access control
| ⏱ | Don't repeat yourself, Single responsibility principle. |
| 🔗 | **Validation:** provides pipes available right out-of-the-box with [class-validator](https://github.com/typestack/class-validator) to enforce validation rules for all incoming client payloads |
| ⚠️ | **Logger** with [Winston](https://github.com/winstonjs/winston) using different levels to track exceptions easily |
| 🔄 | **Migrations** using [TypeORM](https://github.com/typeorm/typeorm) to apply incremental updates to the database |

## Demo 🎮

Do you want to see this template in action? Visit https://myapi-template.herokuapp.com/api yay! 🎉
- API for MercadoPago Checkout: https://github.com/proyecto26/mercadopago-api

## Options (Database Type) 💻




SQL Database




NoSQL Database


## Installation 📚

```bash
# install dependencies
$ yarn
```

## Running the app ▶

```bash
# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod
```

## Running migrations ▶

```bash
# run migration
$ yarn migration

# create migration
$ yarn migration:create

# revert migration
$ yarn migration:revert
```

## Test 🕵️

```bash
# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov
```

## TypeORM 📖
* [Relations](https://github.com/typeorm/typeorm/blob/master/docs/relations.md)
* [Find Options](https://github.com/typeorm/typeorm/blob/master/docs/select-query-builder.md)
* [Query Builder](https://github.com/typeorm/typeorm/blob/master/docs/select-query-builder.md)

## Resources 📚

- [Implementing Microservices](https://frontegg.com/blog/implementing-microservices-in-nodejs)
- [A microservice that handles the queue of sending emails](https://pietrzakadrian.com/blog/how-to-create-a-microservice-that-handles-the-queue-of-sending-emails-in-nestjs)
- [Testing with NestJS like a Pro](https://dev.to/jdnichollsc/testing-with-nestjs-like-a-pro-3i2b)

## Credits 👍
* **typescript-starter:** [Nest framework TypeScript starter repository](https://github.com/nestjs/typescript-starter).

## Supporting 🍻
I believe in Unicorns 🦄
Support [me](http://www.paypal.me/jdnichollsc/2), if you do too.

Donate **Ethereum**, **ADA**, **BNB**, **SHIBA**, **USDT/USDC**, **DOGE**, etc:

> Wallet address: jdnichollsc.eth

Please let us know your contributions! 🙏

## Happy coding 💯
Made with ❤️