GithubHelp home page GithubHelp logo

mohammedmohsin203 / notion-clone-7 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 640 KB

**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.

Home Page: https://notion-two-plum.vercel.app/

JavaScript 91.42% CSS 1.25% TypeScript 7.33%
blocknote clerk convex javascript nextjs14 react-emoji-picker shadcn-ui typescript zod zustand

notion-clone-7's Introduction

Mohsin License Top Language Contributors Release PRs deployment Known Vulnerabilities

๐ŸŒ Live Demo

Explore the live demonstration of the project: nextjs14-notion

๐Ÿ“ Description

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.

Folder Structure
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

๐Ÿ“– Table of Contents

Table of Contents

โœจ Technologies Used

Notion is built using the following technologies:
  • TypeScript: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
  • Next.js: Next.js is a React framework for building server-side rendered and statically generated web applications.
  • Tailwind CSS: Tailwind CSS is a utility-first CSS framework for rapidly building custom user interfaces.
  • Convex: Convex is a TypeScript-first ORM for Node.js and the browser.
  • Clerk: Clerk is a developer-first identity and user management service.
  • ESLint: ESLint is a static code analysis tool for identifying problematic patterns found in JavaScript code.
  • Prettier: Prettier is an opinionated code formatter.
  • Shadcn-UI: Shadcn UI is a React UI library that helps developers rapidly build modern web applications.
  • Zustand: Zustand is a small, fast and scalable bearbones state-management solution.
  • BlockNote: BlockNote is a Notion-like editor for React.
  • Zod: Zod is a TypeScript-first schema declaration and validation library.
  • Vercel: Vercel is a cloud platform for frontend developers, providing the frameworks, workflows, and infrastructure to build a faster, more personalized Web.

Technologies Used

๐Ÿงฐ Get Started

To get this project up and running in your development environment, follow these step-by-step instructions.

๐Ÿ“‹ Prerequisites

In order to install and run this project locally, you would need to have the following installed on your local machine.

โš™๏ธ Installation and Run Locally

Step 0:

Note โ€ผ๏ธ 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 โ€ผ๏ธ 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 โ€ผ๏ธ 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.

๐Ÿ“œ Scripts

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

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>

๐Ÿš€ Deployment

Deploy to production (manual)

You can create an optimized production build with the following command:

npm run build

Deploy on Vercel (recommended)

The easiest way to deploy this Next.js app is to use the Vercel Platform.

Deploy with Vercel

Deploy on Netlify

You can also deploy this Next.js app with Netlify.

Deploy with Netlify

Check out Next.js deployment documentation for more details.

๐Ÿ’ก Features

  • Real-time database ๐Ÿ”—
  • Notion-style editor ๐Ÿ“
  • Light and Dark mode ๐ŸŒ“
  • Infinite children documents ๐ŸŒฒ
  • Trash can & soft delete ๐Ÿ—‘๏ธ
  • Authentication ๐Ÿ”
  • File upload
  • File deletion
  • File replacement
  • Icons for each document (changes in real-time) ๐ŸŒ 
  • Expandable sidebar โžก๏ธ๐Ÿ”€โฌ…๏ธ
  • Full mobile responsiveness ๐Ÿ“ฑ
  • Publish your note to the web ๐ŸŒ
  • Fully collapsable sidebar โ†•๏ธ
  • Landing page ๐Ÿ›ฌ
  • Cover image of each document ๐Ÿ–ผ๏ธ
  • Recover deleted files ๐Ÿ”„๐Ÿ“„

๐Ÿ”ง Contributing

contributors

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:

  1. Fork the repo
  2. Create a new branch (git checkout -b improve-feature)
  3. Make the appropriate changes in the files
  4. Commit your changes (git commit -am 'Improve feature')
  5. Push to the branch (git push origin improve-feature)
  6. Create a Pull Request ๐ŸŽ‰

๐Ÿ“ฉ Bug / Feature Request

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.

๐Ÿ’Ž Acknowledgements

I'd like to express my gratitude to the following people who helped me with this project and made it possible:

๐Ÿ“š References

CodeWithAntonio. (2023). Fullstack Notion Clone: Next.js 13, React, Convex, Tailwind. E-Learning.

๐Ÿ“ž Contact Us

Telegram LinkedIn Instagram

๐Ÿ“‹ License

Notion is open source software licensed as MIT and is free to use โ€” See LICENSE for more details.

notion-clone-7's People

Contributors

mohammedmohsin203 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.