https://github.com/hungds99/next-ts-template
https://github.com/hungds99/next-ts-template
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hungds99/next-ts-template
- Owner: hungds99
- Created: 2022-06-16T14:49:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-16T14:49:57.000Z (about 4 years ago)
- Last Synced: 2025-02-26T19:48:01.772Z (over 1 year ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a [NextJS](https://nextjs.org/) typescript project with Prisma ORM and Apollo GraphQL.
## Getting Started
Install all your dependencies using,
```bash
yarn
# or
npm i
```
- Add your database url in environment variable `DATABASE_URL`. (replace .env.example to .env)
- Migrate your tables from `prisma.schema` to database using,
```
prisma migrate dev
```
Once done, run your development server using,
```bash
npm run dev
# or
yarn dev
```
(Optional) Start your prisma studio using,
```
npx prisma studio
```
## Servers
- NextJS - https://localhost:3000
- Apollo Playgroud - https://localhost:3000/api/graphql
- Prisma Studio - https://localhost:5000
## Usage
`nexus` - to generate schema for typescript
- In `nexus` we have to define the types manually
Using `codegen` to generate types for our application based on `schema.graphql` as input