Corebase is a graphql-first code template to bootstrap development of web applications. It scaffolds type definitions using Nexus that allows you to create fully-typed applications from back-to-front with Typescript. It comes with a default authentication implementation, and uses modern technologies such as NextJS, Prisma, and TailwindCSS which offers pleasant developer experience. Lastly, ESLint and Prettier defaults are initialized in order for you to be productively coding right off the bat!
Technologies:
- NextJS (React Framework for Production)
- Prisma (Next-generation Node.js and TypeScript ORM)
- TailwindCSS ( Utility-first CSS framework packed)
- Typescript (Typed JavaScript at Any Scale)
- Nexus ( Declarative, Code-First GraphQL Schemas for JavaScript/TypeScript)
- Node.js 12.0 or later
- Postgres 12.0 or later
- Docker
- Npx
Run these commands in ascending order. (Please make sure npx is installed)
cp .env.example .env
cd db && docker-compose up -d && cd ..
npx prisma migrate dev
(re-runcd db && docker-compose up -d && cd ..
before if prisma migration fails)
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run db |
Runs your postgres docker image (db container) |
npm run dev |
Starts local dev server at localhost:3000 |
Codebase | Description |
---|---|
/app | Frontend |
/db | Postgres Docker Image |
/generated | Generated Graphql Schema & Typescript Definitions |
/pages/api/* | NextJS API |
/pages/* | NextJS Page Routes |
/prisma | Prisma |
/server | Graphql Server |
Using Prisma Studio
cd prisma && npx prisma studio
For advanced documentation, please refer to the following
- NextJS -> https://nextjs.org/
- Prisma -> https://www.prisma.io/
- TailwindCSS -> https://tailwindcss.com/
- NexusJS -> https://nexusjs.org/
- https://egghead.io/lessons/postgresql-set-up-and-run-a-postgresql-instance-locally-with-docker-compose?pl=build-a-full-stack-app-with-prisma-2-7c81
- https://dev.to/prisma/complete-introduction-to-fullstack-type-safe-graphql-feat-next-js-nexus-prisma-c5
- https://medium.com/dooboolab/how-to-set-up-a-graphql-server-with-apollo-server-prisma2-and-nexus-schema-f59aa23b5d5d
- https://zach.codes/nexus-prisma-is-the-future-of-backend/
- https://telmo.is/writing/add-prettier-and-eslint-to-your-nextjs-app