Skip to content

Commit

Permalink
feat: Sanity setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ameeshagireesh committed Oct 19, 2022
1 parent d8c1c51 commit d349dd9
Show file tree
Hide file tree
Showing 32 changed files with 16,545 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chota-vyapar/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions chota-vyapar/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
34 changes: 34 additions & 0 deletions chota-vyapar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
3 changes: 3 additions & 0 deletions chota-vyapar/chota-vyapar/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@sanity/eslint-config-studio"
}
12 changes: 12 additions & 0 deletions chota-vyapar/chota-vyapar/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Logs
/logs
*.log

# Coverage directory used by tools like istanbul
/coverage

# Dependency directories
node_modules

# Compiled sanity studio
/dist
9 changes: 9 additions & 0 deletions chota-vyapar/chota-vyapar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Sanity Clean Content Studio

Congratulations, you have now installed the Sanity Content Studio, an open source real-time content editing environment connected to the Sanity backend.

Now you can do the following things:

- [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
- [Join the community Slack](https://slack.sanity.io/?utm_source=readme)
- [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
8 changes: 8 additions & 0 deletions chota-vyapar/chota-vyapar/config/.checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"#": "Used by Sanity to keep track of configuration file checksums, do not delete or modify!",
"@sanity/default-layout": "bb034f391ba508a6ca8cd971967cbedeb131c4d19b17b28a0895f32db5d568ea",
"@sanity/default-login": "e2ed4e51e97331c0699ba7cf9f67cbf76f1c6a5f806d6eabf8259b2bcb5f1002",
"@sanity/form-builder": "b38478227ba5e22c91981da4b53436df22e48ff25238a55a973ed620be5068aa",
"@sanity/data-aspects": "d199e2c199b3e26cd28b68dc84d7fc01c9186bf5089580f2e2446994d36b3cb6",
"@sanity/vision": "da5b6ed712703ecd04bf4df560570c668aa95252c6bc1c41d6df1bda9b8b8f60"
}
3 changes: 3 additions & 0 deletions chota-vyapar/chota-vyapar/config/@sanity/data-aspects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"listOptions": {}
}
6 changes: 6 additions & 0 deletions chota-vyapar/chota-vyapar/config/@sanity/default-layout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"toolSwitcher": {
"order": [],
"hidden": []
}
}
8 changes: 8 additions & 0 deletions chota-vyapar/chota-vyapar/config/@sanity/default-login.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"providers": {
"mode": "append",
"redirectOnSingle": false,
"entries": []
},
"loginMethod": "dual"
}
5 changes: 5 additions & 0 deletions chota-vyapar/chota-vyapar/config/@sanity/form-builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"images": {
"directUploads": true
}
}
3 changes: 3 additions & 0 deletions chota-vyapar/chota-vyapar/config/@sanity/vision.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"defaultApiVersion": "2021-10-21"
}
31 changes: 31 additions & 0 deletions chota-vyapar/chota-vyapar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "chota-vyapar",
"private": true,
"version": "1.0.0",
"description": "",
"main": "package.json",
"author": "Ameesha Gireesh <[email protected]>",
"license": "UNLICENSED",
"scripts": {
"start": "sanity start",
"build": "sanity build"
},
"keywords": [
"sanity"
],
"dependencies": {
"@sanity/base": "^2.34.0",
"@sanity/core": "^2.34.0",
"@sanity/default-layout": "^2.34.0",
"@sanity/default-login": "^2.34.0",
"@sanity/desk-tool": "^2.34.1",
"@sanity/eslint-config-studio": "^2.0.0",
"@sanity/vision": "^2.34.0",
"eslint": "^8.6.0",
"prop-types": "^15.7",
"react": "^17.0",
"react-dom": "^17.0",
"styled-components": "^5.2.0"
},
"devDependencies": {}
}
1 change: 1 addition & 0 deletions chota-vyapar/chota-vyapar/plugins/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
User-specific packages can be placed here
29 changes: 29 additions & 0 deletions chota-vyapar/chota-vyapar/sanity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"project": {
"name": "chota-vyapar"
},
"api": {
"projectId": "9w2u5b25",
"dataset": "production"
},
"plugins": [
"@sanity/base",
"@sanity/default-layout",
"@sanity/default-login",
"@sanity/desk-tool"
],
"env": {
"development": {
"plugins": [
"@sanity/vision"
]
}
},
"parts": [
{
"name": "part:@sanity/base/schema",
"path": "./schemas/schema"
}
]
}
60 changes: 60 additions & 0 deletions chota-vyapar/chota-vyapar/schemas/banner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
export default {
name: 'banner',
title: 'Banner',
type: 'document',
fields: [
{
name: 'image',
title: 'Image',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'buttonText',
title: 'ButtonText',
type: 'string',
},
{
name: 'product',
title: 'Product',
type: 'string',
},
{
name: 'desc',
title: 'Desc',
type: 'string',
},
{
name: 'smallText',
title: 'SmallText',
type: 'string',
},
{
name: 'midText',
title: 'MidText',
type: 'string',
},
{
name: 'largeText1',
title: 'LargeText1',
type: 'string',
},
{
name: 'largeText2',
title: 'LargeText2',
type: 'string',
},
{
name: 'discount',
title: 'Discount',
type: 'string',
},
{
name: 'saleTime',
title: 'SaleTime',
type: 'string',
},
],
};
40 changes: 40 additions & 0 deletions chota-vyapar/chota-vyapar/schemas/product.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export default {
name: 'product',
title: 'Product',
type: 'document',
fields: [
{
name: 'image',
title: 'Image',
type: 'array',
of: [{type: 'image'}],
options: {
hotspot: true,
}
},
{
name: 'name',
title: 'Name',
type: 'string',
},
{
name: 'slug',
title: 'Slug',
type: 'slug',
options: {
source: 'name',
maxLength: 90,
}
},
{
name: 'price',
title: 'Price',
type: 'number',
},
{
name: 'details',
title: 'Details',
type: 'string',
}
]
}
9 changes: 9 additions & 0 deletions chota-vyapar/chota-vyapar/schemas/schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import createSchema from 'part:@sanity/base/schema-creator'
import schemaTypes from 'all:part:@sanity/base/schema-type'

import product from './product';
import banner from './banner';
export default createSchema({
name: 'default',
types: schemaTypes.concat([product, banner]),
})
1 change: 1 addition & 0 deletions chota-vyapar/chota-vyapar/static/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Files placed here will be served by the Sanity server under the `/static`-prefix
Binary file added chota-vyapar/chota-vyapar/static/favicon.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions chota-vyapar/chota-vyapar/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
// Note: This config is only used to help editors like VS Code understand/resolve
// parts, the actual transpilation is done by babel. Any compiler configuration in
// here will be ignored.
"include": ["./node_modules/@sanity/base/types/**/*.ts", "./**/*.ts", "./**/*.tsx"]
}
Loading

0 comments on commit d349dd9

Please sign in to comment.