{"id":13576319,"url":"https://github.com/konstantinmuenster/notion-clone","last_synced_at":"2025-05-15T08:10:51.362Z","repository":{"id":38523278,"uuid":"293044019","full_name":"konstantinmuenster/notion-clone","owner":"konstantinmuenster","description":"Edit Notes like in Notion.so. Full-Stack App using React/Express.","archived":false,"fork":false,"pushed_at":"2023-10-15T13:27:47.000Z","size":1587,"stargazers_count":2955,"open_issues_count":9,"forks_count":327,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-04-14T14:59:36.631Z","etag":null,"topics":["contenteditable","expressjs","mongoose","nextjs","notion","notion-editor","reactjs"],"latest_commit_sha":null,"homepage":"https://notion-clone.kmuenster.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konstantinmuenster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-05T09:28:21.000Z","updated_at":"2025-04-13T02:42:04.000Z","dependencies_parsed_at":"2022-07-13T09:20:33.342Z","dependency_job_id":"106b0fa2-df5b-4f20-b902-f6a4fd8fe524","html_url":"https://github.com/konstantinmuenster/notion-clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstantinmuenster%2Fnotion-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstantinmuenster%2Fnotion-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstantinmuenster%2Fnotion-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstantinmuenster%2Fnotion-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konstantinmuenster","download_url":"https://codeload.github.com/konstantinmuenster/notion-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301432,"owners_count":22047904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contenteditable","expressjs","mongoose","nextjs","notion","notion-editor","reactjs"],"created_at":"2024-08-01T15:01:09.132Z","updated_at":"2025-05-15T08:10:51.332Z","avatar_url":"https://github.com/konstantinmuenster.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/kmuenster"],"categories":["JavaScript","HarmonyOS","免费教程资源 \u003ca name=\"freebook\"\u003e\u003c/a\u003e"],"sub_categories":["Windows Manager"],"readme":"# 📓 Notion Clone\n\n#### Create and Edit Notes like in Notion\n\nThis clone tries to replicate some of the great note-taking features Notion has. If you don't know [Notion.so](https://notion.so) yet, I highly recommend to check it out!\n\n📌 Live Demo: [notion-clone.kmuenster.com](https://notion-clone.kmuenster.com/)\n\n📌 Medium Article: [How To Build A Text Editor Like Notion](https://medium.com/swlh/how-to-build-a-text-editor-like-notion-c510aedfdfcc)\n\n---\n\n\u003cimg alt=\"notion clone screenshot\" src=\"./screenshot.gif\" width=\"480\"\u003e\n\n---\n\n## Features\n\n- **Slash Commands** (Type `/` to turn the block into different content types)\n- **HTML Support** (Use regular HTML tags like `\u003ca\u003e` in text blocks)\n- **Image Support** (Upload images by using the `/image` command)\n- **Drag And Drop** (Reorder blocks easily by drag and drop)\n- **Guest Editing** (Anyone can create public pages and share them via link)\n- **User Management** (Create an account to create private pages)\n- **Scheduled Jobs** (Delete inactive pages and accounts automatically)\n\n## Tech Stack\n\nThe frontend is built with Next.js and fully server-side rendered. On the backend, a REST API handles saving user content and user management.\n\n#### Frontend\n\nNext.js · React.js · SCSS/SASS\n\n#### Backend\n\nExpress.js · MongoDB with Mongoose · Nodemailer · JWT (Cookie-based)\n\n## Installation\n\n1. **Clone the project**\n\n   ```sh\n    git clone https://github.com/konstantinmuenster/notion-clone.git\n    cd notion-clone\n   ```\n   \n2. **Add environment variables**\n\n   Backend: Create an `.env` file in the `backend` directory:\n\n   ```\n   FRONTEND_URL=\"http://localhost:3000\"\n   DOMAIN=\"localhost\"\n   JWT_KEY=\"yourSecretForTokenGeneration\"\n   PORT=8080\n   MONGO_URI=\"mongodb+srv://username:password@cluster.gqqwp.gcp.mongodb.net/database?retryWrites=true\u0026w=majority\"\n   MAIL_HOST=\"smtp.sendgrid.net\"\n   MAIL_PORT=465\n   MAIL_USER=\"apiKey\"\n   MAIL_SENDER=\"Your Name \u003cyour@mail.com\u003e\"\n   MAIL_PASSWORD=\"yourSendGridApiKey\"\n   ```\n\n   Frontend: Create an `.env.local` file in the `frontend` directory:\n\n   ```\n   NEXT_PUBLIC_API=\"http://localhost:8080\" // references your Backend API endpoint\n   ```\n\n3. **Install and run backend (http://localhost:8080)**\n\n    ```sh\n    cd backend\n    npm install\n    npm start\n    ```\n\n4. **Install and run frontend (http://localhost:3000)**\n\n    ```sh\n    cd frontend\n    npm install\n    npm run dev\n    ```\n\n## Hosting\n\nYou can host the application on almost any provider that supports Node applications and custom domains. I decided to host the frontend on [vercel.com](https://vercel.com) and the backend on [heroku.com](https://heroku.com). But you can host both, frontend and backend, on the same provider if you like to.\n\n### MongoDB Atlas\n\nYou have to create a new MongoDB cluster upfront. It will store all of your page and block data. You can create one for free on [MongoDB Atlas](https://www.mongodb.com/cloud/atlas).\n\n**Make sure**, you create the following collections:\n* pages\n* users\n\n**Make sure**, you allow network access to everyone (due to Heroku).\n\n### Backend\n\nIf you want to deploy the backend on [heroku.com](https://heroku.com), create a new app in your preferred region on heroku.com.\n\n**Make sure**, you add all production environmental variables for the backend. You can see which variables are needed in the Installation part of this readme.\n\n**Make sure**, you add a custom domain for your backend API. Since the application uses a Cookie-based authentication, we have to run backend and frontend on the same domain. I, for example, run the frontend on `www.notion-clone.kmuenster.com` and the backend on `api.notion-clone.kmuenster.com`.\n\n\u003e **Want to run scheduled jobs?** To delete inactive pages and users, I run scheduled jobs frequently. If you want this feature as well, you have to add more dynos to your application and run the job `$ node jobs/index.js` via Heroku Scheduler.\n\nLastly, you can deploy your app using Heroku Git. \n\n**Make sure**, that when you push the backend to Heroku, you make a Git subtree push since `notion-clone` is a mono-repo containing backend and frontend. So run `git subtree push --prefix backend heroku master` instead of `git push heroku master`. Thus, we only push the backend part.\n\n### Frontend\n\nIf you want to deploy the frontend on [vercel.com](https://vercel.com), you can so easily using the Vercel CLI.\n\nWith the Vercel CLI, we don't have to make a subtree push, instead we can just switch to the frontend folder and run the `vercel` command to deploy:\n\n```sh\ncd frontend\nvercel\n```\n\nThis will lead you through the setup guide for your frontend application. Afterwards the app should be successfully deployed.\n\n**Make sure**, you add the Backend API endpoint as a production environmental variable on Vercel.com.\n\n**Make sure**, you add a custom domain for your frontend (that ideally matches the domain which you have specified in your backend environmental variables 😉)\n\n\n## About\n\n\u003ca href=\"https://www.buymeacoffee.com/kmuenster\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\nKonstantin Münster – [konstantin.digital](https://konstantin.digital)\n\nDistributed under the [MIT](http://showalicense.com/?fullname=Konstantin+M%C3%BCnster\u0026year=2019#license-mit) license.\nSee `LICENSE` for more information.\n\n[https://github.com/konstantinmuenster](https://github.com/konstantinmuenster)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstantinmuenster%2Fnotion-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonstantinmuenster%2Fnotion-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstantinmuenster%2Fnotion-clone/lists"}