|
1 | 1 | ## Getting Started |
2 | 2 |
|
3 | | -First, install dependencies: |
| 3 | +### Steps to run the project |
| 4 | + |
| 5 | +- Install dependencies: |
4 | 6 |
|
5 | 7 | ```bash |
6 | 8 | npm install |
7 | 9 | # or |
8 | 10 | yarn |
9 | 11 | ``` |
10 | 12 |
|
11 | | -Then run the development server: |
12 | | - |
13 | | -```bash |
14 | | -npm run dev |
15 | | -# or |
16 | | -yarn dev |
17 | | -``` |
| 13 | +- **`!!! Make sure to have installed Sanity globally`** |
| 14 | +Check sanity docs for more info: https://www.sanity.io/docs/getting-started-with-sanity-cli |
18 | 15 |
|
19 | | -### Settings |
20 | 16 |
|
21 | | -Create a file `.env.local` and put inside: |
| 17 | +- Create a file `.env.local` and put inside: |
22 | 18 |
|
23 | | -1. NEXT_PUBLIC_SANITY_URL="https://f2g1h82s.api.sanity.io/v2021-10-21/data/query/production", where **f2g1h82s** is your sanity project ID |
24 | | -2. NEXT_PUBLIC_SANITY_LATEST_PROJECTS="?query=...", your query to get latest projects |
25 | | -3. NEXT_PUBLIC_SANITY_ALL_PROJECTS="?query=...", your query to get all projects |
26 | | -4. NEXT_PUBLIC_SANITY_TOKEN="", sanity token created in sanity studio under API section |
| 19 | +1. NEXT_PUBLIC_SANITY_URL="" |
| 20 | +2. NEXT_PUBLIC_SANITY_LATEST_PROJECTS="" |
| 21 | +3. NEXT_PUBLIC_SANITY_ALL_PROJECTS="" |
| 22 | +4. NEXT_PUBLIC_SANITY_PROJECTS="" |
| 23 | +5. NEXT_PUBLIC_SANITY_PROJECT_BY_CATEGORY="" |
| 24 | +6. NEXT_PUBLIC_SANITY_TOKEN="" |
27 | 25 |
|
28 | | -Run Sanity (localhost:3333) |
| 26 | +!!! Please, take into account that you need to create a token in Sanity Studio, and put it in NEXT_PUBLIC_SANITY_TOKEN. |
29 | 27 |
|
30 | | -#### **`!!! Make sure to have installed Sanity globally`** |
| 28 | +Also, the points from 2 to 5 are queries to get data from Sanity. It's up to you to create them. Otherwise, you can use your own queries. |
31 | 29 |
|
32 | | -Then: |
| 30 | +- Finally, run the development server: |
33 | 31 |
|
34 | 32 | ```bash |
35 | | -cd sanity && sanity start |
36 | | -``` |
37 | | - |
38 | | -It runs local server at localhost:3333 |
| 33 | +npm run dev |
| 34 | +# or |
| 35 | +yarn dev |
| 36 | +``` |
0 commit comments