Code Monkey home page Code Monkey logo

Graphlatte logo

graphlatte

Next.js template with GraphQL, Urql, Prisma, Nexus and Tailwind

What is in Graphlatte

  1. GraphQL Helix for handling requests
  2. Nexus with Prisma (nexus-prisma)
  3. GraphQL Codegen
    • TypedDocumentNode
    • Near operation files
  4. Tailwind with a base configuration and Tailwind Prettier Plugin
  5. Docker Compose for local Postgres database
  6. On-save Code generation with VSCode plugin Save and Run
  7. Next.js built-in ESLint integration
  8. Easy global typing with definitions.d.ts file (e.g. typing .env)
  9. Using iron-session for authentication/session handling
  10. Envelop included

Installation

  • There are two main options to create a new project with Graphlatte
  1. Use this template directly on GitHub

  2. Or clone with git

In your terminal

git clone https://github.com/graphlatte/graphlatte.git project-name
cd project-name

Install dependencies, generate code and run

With yarn

yarn
yarn generate:env
yarn dev

Or with npm

npm install
npm run generate:env
npm run dev
  • Graphlatte comes with a base docker-compose file for running local Postgres

Requires installed and running Docker.

The data between Docker restarts are saved in ./docker/postgres folder (that can be changed in the Compose file)
yarn db

# or
npm run db
  • You can also use tool like Concurrently to run the next dev and docker-compose in one command
// package.json
{
  // ...
  "scripts": {
    "dev": "concurrently \"next\" \"docker-compose\""
  }
}

This will install dependencies, generate Prisma schema + example .env file and start the Next development server

  • Prisma schema gets regenerated after every yarn/npm add or install.

Deployment

Hosting

Recommended hosting choice is Vercel, which works well with Graphlatte.

You can also run Graphlatte on your server behind Nginx reverse proxy.

Database

Thanks

Big thanks to huv1k.

If you would like to use Next-Auth, Dependabot and configure GraphQL Codegen differently (e.g. use generated urql hooks), check out his great boilerplate https://github.com/huv1k/nextjs-auth-prisma.

License

The MIT License.

Graphlatte's Projects

graphlatte icon graphlatte

Next.js template with GraphQL, Urql, Prisma, Nexus and Tailwind

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.