- Make sure Git and NodeJS are installed
- Yarn is faster than Npm. So use Yarn.
- Create
.env.development
file in root folder. - Contents of
.env.development
NEXT_PUBLIC_SANITY_PROJECT_ID=XXXXXXXXXX
NEXT_PUBLIC_SANITY_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXX
NEXT_PUBLIC_GOOGLE_API_TOKEN=XXXXXXXXXXXXXXXXXXXX
NEXT_PUBLIC_BASE_URL=http://localhost:3000
-
Clone this repository to your local computer.
-
Open terminal in root directory. Run
npm install
oryarn install
. -
Now, cd
tiktik-backend
. Runnpm install
oryarn install
again. -
Now all required packages are installed, let's setup sanity.
-
Create an account in Sanity.
-
In terminal, type
sanity init
to initialize our sanity project. -
Once sanity project is initialized, Type
sanity start
to start sanity studio on localhost. URL will be shown in terminal. -
After going to localhost, login in with your account. Now, your account is connected with this project.
-
To get
NEXT_PUBLIC_SANITY_PROJECT_ID
andNEXT_PUBLIC_SANITY_TOKEN
, go to Sanity. -
Under API Tab, go to tokens section and create a token. You can name it whatever you want. Just Don't fotget to copy your project token. You will not be able to copy later.
-
Now, Sanity backend is setup. Let's setup Google OAuth.
-
Go, to Google Cloud Developers Console and create a project.
-
Once you created the project, make sure to select it from Header section.
-
Go to APIs & Services > Credentials and create OAuth Client ID. Follow on-screen instructions.
-
Add Both front end and sanity backend to Authorized URLs as shown below:
-
Copy
NEXT_PUBLIC_GOOGLE_API_TOKEN
and paste it in.env
file. -
Now Google OAuth is setup successfully 🔥
NOTE: Make sure you don't share these keys publicaly.
- Clone this repository to your local computer.
- Open terminal in root directory.
- Type and Run
npm install
oryarn install
. - Once packages are installed, you can start this app using
npm start
oryarn start
- Now app is fully configured and you can start using this app 👍
You might encounter some bugs while using this app. You are more than welcome to contribute. Just submit changes via pull request and I will review them before merging. Make sure you follow community guidelines.
You can also give this repository a star to show more people and they can use this repository.
This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.