Explore the live demonstration of the project: nextjs14-notion
Notion is a Notion-like application built with Next.js 14, React, Convex, Tailwind, Clerk, and EdgeStore. It is a real-time database and Notion-style editor that allows you to create, edit, and delete documents. It also allows you to publish your note to the web.
nextjs14-notion/
āāā app/
ā āāā (main)/
ā ā āāā (routes)/
ā ā ā āāā documents/
ā ā ā āāā page.tsx
ā ā ā āāā [documentId]/
ā ā ā āāā page.tsx
ā ā āāā _components/
ā ā ā āāā banner.tsx
ā ā ā āāā document-list.tsx
ā ā ā āāā item.tsx
ā ā ā āāā menu.tsx
ā ā ā āāā navbar.tsx
ā ā ā āāā navigation.tsx
ā ā ā āāā publish.tsx
ā ā ā āāā title.tsx
ā ā ā āāā trash-box.tsx
ā ā ā āāā user-item.tsx
ā ā āāā layout.tsx
ā āāā (marketing)/
ā ā āāā _components/
ā ā ā āāā footer.tsx
ā ā ā āāā heading.tsx
ā ā ā āāā heroes.tsx
ā ā ā āāā logo.tsx
ā ā ā āāā navbar.tsx
ā ā āāā layout.tsx
ā ā āāā page.tsx
ā āāā (public)/
ā ā āāā (routes)/
ā ā ā āāā preview/
ā ā ā āāā [documentId]/
ā ā ā āāā page.tsx
ā ā āāā layout.tsx
ā āāā api/
ā ā āāā edgestore/
ā ā āāā [...edgestore]/
ā ā āāā route.ts
ā āāā favicon.ico
ā āāā globals.css
ā āāā error.tsx
ā āāā not-found.tsx
ā āāā layout.tsx
āāā components/
ā āāā modals/
ā ā āāā confirm-modal.tsx
ā ā āāā cover-image-modal.tsx
ā ā āāā settings-modal.tsx
ā āāā providers/
ā ā āāā convex-provider.tsx
ā ā āāā modal-provider.tsx
ā ā āāā theme-provider.tsx
ā āāā shared/
ā ā āāā cover.tsx
ā ā āāā editor.tsx
ā ā āāā icon-picker.tsx
ā ā āāā mode-toggle.tsx
ā ā āāā search-command.tsx
ā ā āāā single-image-dropzone.tsx
ā ā āāā spinner.tsx
ā ā āāā toolbox.tsx
ā āāā ui/ (generated by shadcn-ui)
ā āāā alert-dialog.tsx
ā āāā avatar.tsx
ā āāā button.tsx
ā āāā command.tsx
ā āāā dialog.tsx
ā āāā dropdown-menu.tsx
ā āāā input.tsx
ā āāā label.tsx
ā āāā popover.tsx
ā āāā skeleton.tsx
āāā convex/
ā āāā generated/ (generated by convex)
ā āāā auth.config.js
ā āāā documents.ts
ā āāā schema.ts
ā āāā tsconfig.json
āāā hooks/
ā āāā use-cover-image.ts
ā āāā use-origin.ts
ā āāā use-scroll-top.ts
ā āāā use-search.ts
ā āāā use-settings.ts
āāā lib/
ā āāā edgestore.ts
ā āāā utils.ts
āāā public/
ā āāā next.svg
ā āāā vercel.svg
ā āāā assets/
ā āāā icons/[[...]].png
ā āāā images/[[...]].{svg,png}
āāā .eslintrc.json
āāā .gitignore
āāā README.md
āāā components.json
āāā next.config.js
āāā package.json
āāā postcss.config.js
āāā tailwind.config.ts
āāā tsconfig.ts
To get this project up and running in your development environment, follow these step-by-step instructions.
In order to install and run this project locally, you would need to have the following installed on your local machine.
Step 0:
Note :bangbang: the application uses Convex for ORM, therefore, you need to create Convex account here and sets the CONVEX_DEPLOY_KEY
and NEXT_PUBLIC_CONVEX_URL
environment variables in .env
file.
Note :bangbang: the application uses Clerk for Authentication and User Management, therefore, you need to create Clerk account here and sets the CLERK_PUBLISHABLE_KEY
and CLERK_SECRET_KEY
environment variables in .env
file.
Note :bangbang: the application uses EdgeStore for file uploads, therefore, you need to create EdgeStore account here and sets the EDGE_STORE_ACCESS_KEY
and EDGE_STORE_SECRET_KEY
environment variables in .env
file.
Also, you need to create a JWT template in Clerk and define the JWKS Endpoint as a provider inside convex/auth.config.js
file.
Step 1:
Download or clone this repo by using the link below:
git clone https://github.com/mohammedmohsin203/Notion-Clone-7
Step 2:
Execute the following command in the root directory of the downloaded repo in order to install dependencies:
npm install
Step 3:
Execute the following command in order to run the development server locally:
npm run dev
Step 4:
Open http://localhost:3000 with your browser to see the result.
All scripts are defined in the package.json
file. Here is a list of all scripts:
Script | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:3000 |
npm run build |
Build your production site to ./dist/ |
npm run start |
Start your production site locally |
npm run lint |
Run ESLint |
Environment variables[^6] can be used for configuration. They must be set before running the app.
Environment variables are variables that are set in the operating system or shell, typically used to configure programs.
Notion uses Convex, and Clerk as external services. You need to create an accounts on Convex and Clerk and get the required credentials to run the app.
Create a .env
file in the root directory of the project and add the following environment variables:
CONVEX_DEPLOY_KEY=<CONVEX_DEPLOY_URL>
NEXT_PUBLIC_CONVEX_URL=<NEXT_PUBLIC_CONVEX_URL>
CLERK_PUBLISHABLE_KEY=<CLERK_PUBLISHABLE_KEY>
CLERK_SECRET_KEY=<CLERK_SECRET_KEY>
EDGE_STORE_ACCESS_KEY=<EDGE_STORE_ACCESS_KEY>
EDGE_STORE_SECRET_KEY=<EDGE_STORE_SECRET_KEY>
You can create an optimized production build with the following command:
npm run build
The easiest way to deploy this Next.js app is to use the Vercel Platform.
You can also deploy this Next.js app with Netlify.
Check out Next.js deployment documentation for more details.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
To fix a bug or enhance an existing module, follow these steps:
git checkout -b improve-feature
)git commit -am 'Improve feature'
)git push origin improve-feature
)If you find a bug (failure of a module to execute its intended function), kindly open an issue here by including the issue with a title and clear description.
If you'd like to request a new function, feel free to do so by opening an issue here. Please include sample queries and their corresponding results.
I'd like to express my gratitude to the following people who helped me with this project and made it possible:
CodeWithAntonio. (2023). Fullstack Notion Clone: Next.js 13, React, Convex, Tailwind. E-Learning.
Notion is open source software licensed as MIT and is free to use ā See LICENSE for more details.