Giter Site home page Giter Site logo

ryofu1210 / nest-next-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikan3rd/nest-next-sample

0.0 1.0 0.0 2.35 MB

NestJS + Next.js sample application / Backend and Frontend use only TypeScript!!!

JavaScript 0.33% TypeScript 99.16% Shell 0.40% Dockerfile 0.12%

nest-next-sample's Introduction

This project use only TypeScript!!

Tech stack

  • Backend
    • NestJS
    • Prisma
    • GraphQL
  • Frontend
    • Next.js / React
    • GraphQL Code Generator
    • Apollo Client
    • Semantic UI
    • emotion
  • Other
    • yarn workspace
    • ESLint / Prettier / husky
    • Docker / Docker Compose
    • Vercel
    • GCP (CloudSQL / Cloud Run / Cloud Build)

Getting Started

Docker

You can launch the development environment with one command!

docker-compose up

After successful launch, go to the following URL in your browser!

โš ๏ธ Containers have dependencies, but the next container may start to be started before the preparation is complete. If it fails for that reason, please specify the start-up separately as follows.

docker-compose up mysql

See docker-compose.yaml if you want to know more.

Local

  1. Prepare MySQL and create a database for development. Then create file packages/backend/.env and fill in the environment variables.
DATABASE_URL="mysql://username:password@localhost:3306/nest_next_sample"
  1. Do a database migration.
cd packages/backend
yarn install
yarn migrate:deploy
  1. Run the startup command for backend.
yarn start:dev

After successful launch, go to http://localhost:3300/graphql in your browser!

  1. Create file packages/frontend/.env and fill in the environment variables.
SERVER_APOLLO_URI="http://localhost:3300"
PUBLIC_APOLLO_URI="http://localhost:3300"
  1. Run the startup command for frontend.
cd packages/frontend
yarn dev

After successful launch, go to http://localhost:3000 in your browser!

GraphQL exmaple

mutation {
  saveTask(task: { title: "test", categoryIds: [] }) {
    id
    title
    categories {
      id
      name
      color
    }
  }
}
query {
  task(id: 1) {
    id
    title
    taskContents {
      id
      checked
    }
    categories {
      id
      name
    }
  }
}

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.