Skip to content

Commit

Permalink
feat: setup repo starter 🦄
Browse files Browse the repository at this point in the history
  • Loading branch information
BolajiAyodeji committed Jan 29, 2021
0 parents commit 535ece1
Show file tree
Hide file tree
Showing 53 changed files with 48,540 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SANITY_STUDIO_API_PROJECT_ID = "wvv7gbzb"
SANITY_STUDIO_API_DATASET = "production"

NEXT_PUBLIC_SANITY_PROJECT_ID = "wvv7gbzb"
NEXT_PUBLIC_SANITY_DATASET = "production"
7 changes: 7 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# For Studio Locally
SANITY_STUDIO_API_PROJECT_ID = "your_project_id"
SANITY_STUDIO_API_DATASET = "production"

# For Next Locally
NEXT_PUBLIC_SANITY_PROJECT_ID = "your_project_id"
NEXT_PUBLIC_SANITY_DATASET = "production"
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.vscode
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
Empty file added .sanity-template/README.md
Empty file.
43 changes: 43 additions & 0 deletions .sanity-template/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": 1.00,
"title": "Sanity Commerce Layer Starter",
"description": "Sanity Ecommerce starter built with Next.js, Commerce Layer, and deployed to Netlify.",
"previewMedia": {
"type": "image",
"src": ".sanity-template/screenshot.png",
"alt": "Homepage UI"
},
"technologies": [
{
"id": "nextjs",
"name": "Next.js",
"url": "https://nextjs.org"
},
{
"id": "commercelayer",
"name": "Commerce Layer",
"url": "https://commercelayer.io"
},
{
"id": "netlify",
"name": "Netlify",
"url": "https://netlify.com"
}
],
"deployment": {
"provider": "netlify",
"studio": {
"basePath": "/studio"
},
"envVars": {
"projectId": ["NEXT_PUBLIC_SANITY_PROJECT_ID"],
"dataset": ["NEXT_PUBLIC_SANITY_DATASET"]
},
"corsOrigins": [
{
"origin": "http://localhost:3000",
"allowCredentials": true
}
]
}
}
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Sanity Commerce Layer Starter

An ecommerce starter that features the sanity studio built with Next.js, Commerce Layer, and deployed to Netlify.

## Installation guide

- Rename `.env.test` to `.env` and add the project ID from [manage.sanity.io](https://manage.sanity.io).

- Intall the neccessary packages and start the development server:

```bash
npm install && npm start
```

This will run the frontend at `localhost:3000` and the Sanity Studio at `localhost:3000/studio`.
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"studio"
],
"version": "0.0.0"
}
2 changes: 2 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
11 changes: 11 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const STUDIO_REWRITE = {
source: '/studio/:path*',
destination:
process.env.NODE_ENV === 'development'
? 'http://localhost:3333/studio/:path*'
: '/studio/index.html',
}

module.exports = {
rewrites: () => [STUDIO_REWRITE],
}
Loading

0 comments on commit 535ece1

Please sign in to comment.