Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanms1/turbo-pothos-prisma-nextjs-template
Turborepo + Pothos + Prisma + Next
https://github.com/ivanms1/turbo-pothos-prisma-nextjs-template
apollo graphql nextjs photos prisma react
Last synced: 2 months ago
JSON representation
Turborepo + Pothos + Prisma + Next
- Host: GitHub
- URL: https://github.com/ivanms1/turbo-pothos-prisma-nextjs-template
- Owner: ivanms1
- Created: 2022-06-12T15:49:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T05:53:42.000Z (9 months ago)
- Last Synced: 2024-05-01T06:36:20.770Z (9 months ago)
- Topics: apollo, graphql, nextjs, photos, prisma, react
- Language: TypeScript
- Homepage:
- Size: 2.45 MB
- Stars: 23
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Turborepo + Pothos + Prisma + Next Template
## Technology stack
- Backend: [Node.js](https://nodejs.org/en/), [Pothos GraphQL](https://pothos-graphql.dev/), [Prisma](https://www.prisma.io/) and [Apollo Server](https://www.apollographql.com/docs/apollo-server/#:~:text=Apollo%20Server%20is%20an%20open,use%20data%20from%20any%20source.)
- Frontend: [React.js](https://reactjs.org/), [Next.js](https://nextjs.org/) and [Apollo Client](https://www.apollographql.com/docs/react/)## Monorepo Setup
- `apps/api`: [Node.js](https://nodejs.org/en/) app, provides all the apis and connects to the database.
- `apps/web`: Main app powered by [Next.js](https://nextjs.org)
- `apps/admin`: [Next.js](https://nextjs.org) app for admin purposes
- `packages/ui`: Internal component library used by both `web` and `admin` applications
- `packages/apollo-hooks`: Libary of apollo-graphql hooks generated by [GraphQL Code Generator](https://www.graphql-code-generator.com/) for `web` and `admin` app to consume## Requirements
- ### General
- **Yarn**
This repository uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package manager.
- **Enviroment Variables**
Inside the `apps/web` and `apps/admin` directories
```
NEXT_PUBLIC_SERVER_URL="http://localhost:8080/graphql"
```## Running the app
- To install project deps, run
```
yarn install
```- Initialize the database or sync the database schema
```
yarn db:push
```- Generate the pr the prismas client and types
```
yarn db:generate
```- Seed the database
```
yarn db:seed
```- Run app
- Start the server
```
yarn dev:api
```- Start server + web
```
yarn dev:web
```- Start server + admin
```
yarn dev:admin
```- Start server + admin + web
```
yarn dev
```## Generating GraphQL Hooks
- To generate the graphql hooks, run
```
yarn generate:hooks
```This command will detect all the graphql files inside the `apps/web` and `apps/admin` directories and generate the hooks for them.