Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hafffe/nextjs-sanity-template
Starter Sanity + Next.js
https://github.com/hafffe/nextjs-sanity-template
jamstack nextjs sanity-io typescript
Last synced: 3 months ago
JSON representation
Starter Sanity + Next.js
- Host: GitHub
- URL: https://github.com/hafffe/nextjs-sanity-template
- Owner: hafffe
- Created: 2020-05-14T22:58:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T20:04:32.000Z (8 months ago)
- Last Synced: 2024-04-15T09:23:36.705Z (8 months ago)
- Topics: jamstack, nextjs, sanity-io, typescript
- Language: TypeScript
- Homepage: https://nextjs-sanity-template.now.sh
- Size: 5.62 MB
- Stars: 97
- Watchers: 2
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-nextjs-boilerplates - hafffe/nextjs-sanity-template
- awesome-nextjs-boilerplates - hafffe/nextjs-sanity-template
README
# NEXT.JS - SANITY TEMPLATE
> Template for blog / marketing site built next.js & sanity.io
This starter template built upon [Next.js](https://nextjs.org/) 13 with the new app directory & router.
[Sanity](https://sanity.io/) is used for content handling,
and [Tailwind](https://tailwindcss.com/) is used for styling.### Setup Vercel
Import the project in vercel
Setup following environment variables (as plain text variables)`NEXT_PUBLIC_SANITY_PROJECT_ID` with value for your prefered dataset
`NEXT_PUBLIC_SANITY_DATASET` with your sanity project id### Setup for local development
Create `.env` file in root path with the environment variables
```
# For Next Locally
NEXT_PUBLIC_SANITY_PROJECT_ID = "abcd1245"
NEXT_PUBLIC_SANITY_DATASET = "production"
```### Development
To Start development server:
```
npm run dev
```This will run frontend at localhost:3000
and you will find sanity studio at localhost:3000/studioAdd http://localhost:3000 in sanity settings -> api - CORS Origins
### Things to know
* Frontend startpage is fetched with slug `frontpage`
* Posts list is fetched with the slug `posts`### Tech Stack
- [Next.js](https://nextjs.org/)
- [Sanity](https://sanity.io/)
- [next-sanity](https://github.com/sanity-io/next-sanity)
- [Tailwind](https://tailwindcss.com/)