GithubHelp home page GithubHelp logo

proyecto26 / myapi Goto Github PK

View Code? Open in Web Editor NEW
149.0 4.0 31.0 1.44 MB

A template to create awesome APIs easily ⚡️

Home Page: https://myapi-template.herokuapp.com/api

License: MIT License

JavaScript 1.36% TypeScript 98.33% EJS 0.29% Procfile 0.03%
apis api api-server nestjs nestjs-backend nestjs-starter-template nestjs-postgres nestjs-logger nestjs-typeorm web-api express-js express-api jwt-authentication jwt-auth jwt-token nodejs-api nest typeorm typescript

myapi's Introduction

Nest Logo

MyApi SQL Template
⚡️ Launch your api instantly watching changes with live-reload
📈 Highly scalable using Repository design pattern to access the database even easier
😎 OpenAPI with Swagger 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 and other techniques to increase the security of your applications
👥 Made for Users. Easily validate permissions for specific routes using 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 to enforce validation rules for all incoming client payloads
⚠️ Logger with Winston using different levels to track exceptions easily
🔄 Migrations using 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! 🎉

Options (Database Type) 💻

SQL Database NoSQL Database

Installation 📚

# install dependencies
$ yarn

Running the app ▶

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Running migrations ▶

# run migration
$ yarn migration

# create migration
$ yarn migration:create

# revert migration
$ yarn migration:revert

Test 🕵️

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

TypeORM 📖

Resources 📚

Credits 👍

Supporting 🍻

I believe in Unicorns 🦄 Support me, if you do too.

Donate Ethereum, ADA, BNB, SHIBA, USDT, DOGE:

Wallet address

Wallet address: 0x3F9fA8021B43ACe578C2352861Cf335449F33427

Please let us know your contributions! 🙏

Happy coding 💯

Made with ❤️

myapi's People

Contributors

jdnichollsc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

myapi's Issues

Cannot build this project

If I run command npm run build, I get following error:

`src/controllers/user.controller.ts:102:5 - error TS2322: Type 'IUser[]' is not assignable to type 'User[]'.
Type 'IUser' is not assignable to type 'User'.

102 return users
~~~~~~~~~~~~
src/repositories/user/user.service.ts:88:38 - error TS2345: Argument of type 'IUser' is not assignable to parameter of type 'User'.
Property 'roleId' is missing in type 'IUser' but required in type 'User'.

88 const newUser = this.preloadUser(user)
~~~~

src/models/user.ts:114:3
114 roleId!: number
~~~~~~
'roleId' is declared here.
src/repositories/user/user.service.ts:129:38 - error TS2345: Argument of type 'IUser' is not assignable to parameter of type 'User'.

129 const newUser = this.preloadUser(user)
~~~~
src/repositories/user/user.service.ts:158:5 - error TS2322: Type '{ roleId: string; documentTypeId: string; id: string; firstName: string; lastName: string; birthdate?: string; address?: string; email: string; password?: string; phoneNumber?: string; termsAndConditions?: boolean; ... 4 more ...; documentType: DocumentType; }' is not assignable to type 'User'.
Types of property 'roleId' are incompatible.
Type 'string' is not assignable to type 'number'.

158 return newUser
~~~~~~~~~~~~~~

Found 4 error(s).`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.