https://github.com/ivan-kleshnin/nextjs-apollo-example
NextJS + Apollo-Server + Apollo-Client + Auth (draft)
https://github.com/ivan-kleshnin/nextjs-apollo-example
Last synced: 6 months ago
JSON representation
NextJS + Apollo-Server + Apollo-Client + Auth (draft)
- Host: GitHub
- URL: https://github.com/ivan-kleshnin/nextjs-apollo-example
- Owner: ivan-kleshnin
- Created: 2020-02-04T12:39:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T03:20:51.000Z (over 5 years ago)
- Last Synced: 2025-02-01T22:12:54.433Z (8 months ago)
- Language: JavaScript
- Size: 300 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NextJS & Apollo Stack Example
This code is an evolution of [api-routes-apollo-server-and-client-auth](https://github.com/zeit/next.js/tree/canary/examples/api-routes-apollo-server-and-client-auth) original demo.
My goal is to make it much easier and, at the same time, more production-like.### Steps Taken
- [x] 1. Use more realistic folder/file structure.
- [x] 2. Use FS-based DB emulation as RAM-based don't play well with dev servers.
- [x] 3. Demonstrate GitHub (OAuth) authentication.
- [x] 4. Replace Full SSR with [Partial SSR](https://paqmind.com/en/blog/ssr-is-not-the-future).
- [ ] 5. Demonstrate proper error handling/logging (in process).
- [ ] 6. Revisit security & performance aspects.## How To Use
0. Rename `.env.default` to `.env`. Set the appropriate credentials.
1. Fetch repo
```
project-folder $ git init
project-folder $ git remote add origin git@github.com:ivan-kleshnin/nextjs-apollo-example.git
project-folder $ git pull origin master
```2. Install deps
```
project-folder $ yarn install
```3. Run
```
project-folder $ yarn dev
```