Giter Site home page Giter Site logo

ismaestro / nestjs-example-app Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 7.0 429 KB

NestJS example app + Prisma + GraphQL

Home Page: https://nestjs-example-app.herokuapp.com/

License: MIT License

JavaScript 1.52% Dockerfile 1.87% TypeScript 96.06% Shell 0.56%
nestjs nestjs-graphql nestjs-backend nestjs-boilerplate nestjs-starter-template nestjs-postgres nestjs-best-practices prisma graphql

nestjs-example-app's Introduction

NestJS Example App

Example app with NestJS 7 + Prisma 2 + Postgres + Graphql

๐Ÿ‘๐Ÿ‘๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐Ÿ‘๐Ÿ‘

Base project made with much โค๏ธ. Contains CRUD, advanced patterns, graphql and much more!

Demo example

ANGULAR DEMO HERE

Setup

Install dependencies first

npm i

Create a file with this content and call it .env

ENVIRONMENT=localhost

# POSTGRES
POSTGRES_HOST=localhost
POSTGRES_PORT=5433
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=postgres
POSTGRES_SCHEMA=public

# Prisma database connection
DATABASE_URL=postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}?schema=${POSTGRES_SCHEMA}&sslmode=prefer

# Nest
PORT=3000

# Security
JWT_ACCESS_SECRET=u4ayyabkATNYWAbReNxdYF6fUcCXv4jGWn97kbcF6hnKedVf28aVZ9BEVVN6KxaUnwhWBnqzhNs7WBCDqXzSThY8fLrbGb7gxaejRBLCGDAJzU58549Tkr9a9avscJbQ33wNxa3EJhb2BwyGAkQLdNwc4Dp5BUJYhy8ewJKQGaJ35GtKA8JUDVqPbLC4HyAqNSVvH6jEXuAXCqYmU8xkdQMNmX5XBXM45b57VC78U74Dn3YB4swpy7jeSvM6fWwj
JWT_REFRESH_SECRET=W7HZVApFVRZX8LKnDr7t8S5KGSnwhszDTckq6NRTwwKp4xZKeNQQrykRTUzXRFAdudyz9rsXv5Dk43NT2cYGHKpHHXyE8dNg6nZM9v4tnz76Kz7XgnnmEm34z6cGwhQ6wGUwaHhMteKPafztZxKBbtChWdH2QKfDpR2yGfnWfTr3feACyejUKjv4a2XdPdLgaABykrcVDPh8RVkRqHNds3ACsQg5mfFdFZg9twkZUVaj2FJMGSsDNyESjpj2vhYp
JWT_EXPIRES_IN=1d
JWT_REFRESH_IN=7d

Create the postgres database

npm run docker:db

Generate the prisma schema

npm run prisma:generate

Run migrations to create necessary tables in the DB

npm run migrate:dev

Create first user and heroes

npm run seed

Start the application

npm start

What's included

  • App deployed into Fy.io.
  • CRUD: create, update and remove heroes with this project!
  • Authentication with JWT tokens
  • More logical directory structure
  • Examples of NestJS services, guards and resolvers
  • Env file included with al the environment variables that are mandatory already prepared
  • Prisma 2. Usage of prisma migrate and prisma studio.
  • Postgres to store the users and heroes of the application
  • Graphql server
  • Postman collection ready to import

Bugs and feature requests

Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Creators

Ismael Ramos

Thanks

Thanks to all contributors and their support.

If you have an idea or you want to do something, tell me or just do it! I'm always happy to hear your feedback!

Copyright and license

Code and documentation copyright 2021 the authors. Code released under the MIT License.

Enjoy ๐Ÿค˜

nestjs-example-app's People

Contributors

ismaelramosmeta avatar ismaestro avatar

Stargazers

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

Watchers

 avatar  avatar

nestjs-example-app's Issues

please provide API contract

Love your work!

There is an issue the APIs are not working, so please provide the APIs and their contract with expected request/response.

Thanks!

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.