https://github.com/slicknode/nextjs-slicknode-starter
https://github.com/slicknode/nextjs-slicknode-starter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/slicknode/nextjs-slicknode-starter
- Owner: slicknode
- Created: 2019-09-11T18:42:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T09:59:16.000Z (over 2 years ago)
- Last Synced: 2025-01-28T12:46:20.705Z (5 months ago)
- Language: JavaScript
- Size: 263 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NextJS Slicknode Starter
This is a basic starter project for a blog powered by a [Slicknode](https://slicknode.com) backend
and NextJS for the frontend.## Installation
You have to have an active [Slicknode account](https://slicknode.com) and the Slicknode CLI needs to be
installed on your computer:npm install -g slicknode@latest
### Backend
To deploy the backend to your Slicknode account, navigate to the `server` folder and run the following
commands:cd ./server
# Pull the dependencies
slicknode pull# Deploy the project to the cloud
slicknode deployAfter a few moments, the GraphQL endpoint will be ready. To get the endpoint, run this in the `server`
directory:slicknode endpoint
This will be needed for the client setup.
### Client
To start the client, navigate to the `client` folder and install the dependencies:
cd ./client
yarn
Open the file `client/config.js` and set your Slicknode endpoint.To start the server in dev mode with hot reload, automatic build etc:
yarn start
To create a production build and start the server in prod mode:yarn build
yarn startFor more customization and options, checkout the [official NextJS documentation](https://github.com/zeit/next.js/)
### Note
This is just an example to illustrate how NextJS can be connected to a Slicknode backend and not meant for
production usage. To make this production ready, you would probably implement a custom mutation with a registration
flow and remove the permissions for anonymous users to be able to create new users etc.