{"id":23439669,"url":"https://github.com/sanidhyy/messenger-clone","last_synced_at":"2025-04-13T08:09:16.607Z","repository":{"id":211908312,"uuid":"728661938","full_name":"sanidhyy/messenger-clone","owner":"sanidhyy","description":"A Real-Time Messenger Clone using Next.js 14.","archived":false,"fork":false,"pushed_at":"2024-12-20T04:03:41.000Z","size":1100,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T08:08:54.135Z","etag":null,"topics":["api","chat-app","clone","css","html","js","messenger","mongodb","next","nextjs","prisma","react","server-actions","socket-io","tailwindcss"],"latest_commit_sha":null,"homepage":"https://appmessenger.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanidhyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["sanidhyy"],"patreon":"sanidhy","custom":"https://www.buymeacoffee.com/sanidhy"}},"created_at":"2023-12-07T12:26:10.000Z","updated_at":"2025-02-27T09:38:00.000Z","dependencies_parsed_at":"2023-12-11T15:28:49.264Z","dependency_job_id":"e4b253e2-cc8c-40fa-9da5-3bb9e2f778b2","html_url":"https://github.com/sanidhyy/messenger-clone","commit_stats":null,"previous_names":["sanidhyy/messenger-clone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fmessenger-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fmessenger-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fmessenger-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fmessenger-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanidhyy","download_url":"https://codeload.github.com/sanidhyy/messenger-clone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681489,"owners_count":21144700,"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":["api","chat-app","clone","css","html","js","messenger","mongodb","next","nextjs","prisma","react","server-actions","socket-io","tailwindcss"],"created_at":"2024-12-23T15:33:13.185Z","updated_at":"2025-04-13T08:09:16.546Z","avatar_url":"https://github.com/sanidhyy.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sanidhyy","https://patreon.com/sanidhy","https://www.buymeacoffee.com/sanidhy"],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n# Messenger Clone - A Real-Time Messaging App using Next.js 14.\n\n![Messenger Clone - A Real-Time Messaging App using Next.js 14.](/.github/images/img_main.png \"Messenger Clone - A Real-Time Messaging App using Next.js 14.\")\n\n[![Ask Me Anything!](https://flat.badgen.net/static/Ask%20me/anything?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy \"Ask Me Anything!\")\n[![GitHub license](https://flat.badgen.net/github/license/sanidhyy/messenger-clone?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/messenger-clone/blob/main/LICENSE \"GitHub license\")\n[![Maintenance](https://flat.badgen.net/static/Maintained/yes?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/messenger-clone/commits/main \"Maintenance\")\n[![GitHub branches](https://flat.badgen.net/github/branches/sanidhyy/messenger-clone?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/messenger-clone/branches \"GitHub branches\")\n[![Github commits](https://flat.badgen.net/github/commits/sanidhyy/messenger-clone?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/messenger-clone/commits \"Github commits\")\n[![Vercel status](https://img.shields.io/badge/Vercel-000000?style=for-the-badge\u0026logo=vercel\u0026logoColor=white)](https://appmessenger.vercel.app/ \"Vercel status\")\n[![GitHub issues](https://flat.badgen.net/github/issues/sanidhyy/messenger-clone?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/messenger-clone/issues \"GitHub issues\")\n[![GitHub pull requests](https://flat.badgen.net/github/prs/sanidhyy/messenger-clone?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/messenger-clone/pulls \"GitHub pull requests\")\n\n\u003c!-- Table of Contents --\u003e\n\u003cdetails\u003e\n\n\u003csummary\u003e\n\n# :notebook_with_decorative_cover: Table of Contents\n\n\u003c/summary\u003e\n\n- [Folder Structure](#bangbang-folder-structure)\n- [Getting Started](#toolbox-getting-started)\n- [Screenshots](#camera-screenshots)\n- [Tech Stack](#gear-tech-stack)\n- [Stats](#wrench-stats)\n- [Contribute](#raised_hands-contribute)\n- [Acknowledgements](#gem-acknowledgements)\n- [Buy Me a Coffee](#coffee-buy-me-a-coffee)\n- [Follow Me](#rocket-follow-me)\n- [Learn More](#books-learn-more)\n- [Deploy on Vercel](#page_with_curl-deploy-on-vercel)\n- [Give A Star](#star-give-a-star)\n- [Star History](#star2-star-history)\n- [Give A Star](#star-give-a-star)\n\n\u003c/details\u003e\n\n## :bangbang: Folder Structure\n\nHere is the folder structure of this app.\n\n```bash\nmessenger-clone/\n  |- app/\n    |-- (site)/\n        |--- components/\n        |--- page.tsx\n    |-- actions/\n        |--- get-conversation-by-id.ts\n        |--- get-conversation.ts\n        |--- get-current-user.ts\n        |--- get-messages.ts\n        |--- get-session.ts\n        |--- get-users.ts\n    |-- api/\n        |--- auth/[...nextauth]\n        |--- conversations/[conversationId]\n        |--- messages/\n        |--- pusher/\n        |--- register/\n        |--- settings/\n    |-- components/\n        |--- inputs/\n        |--- modals/\n        |--- sidebar/\n        |--- active-status.tsx\n        |--- avatar-group.tsx\n        |--- avatar.tsx\n        |--- button.tsx\n        |--- empty-state.tsx\n        |--- loading-modal.tsx\n    |-- config/\n        |--- authOptions.tsx\n        |--- site.ts\n    |-- context/\n        |--- auth-context.ts\n        |--- toaster-context.ts\n    |-- conversations/\n        |--- [conversationId]/\n            |---- components/\n        |--- components/\n        |--- layout.tsx\n        |--- loading.tsx\n        |--- page.tsx\n    |-- hooks/\n        |--- use-active-channel.tsx\n        |--- use-active-list.tsx\n        |--- use-conversation.tsx\n        |--- use-other-user.tsx\n        |--- use-routes.tsx\n    |-- libs/\n        |--- prismadb.ts\n        |--- pusher.ts\n    |-- types/\n        |--- index.ts\n    |-- users/\n        |--- components/\n        |--- layout.tsx\n        |--- loading.tsx\n        |--- page.tsx\n    |-- favicon.ico\n    |-- globals.css\n    |-- layout.tsx\n  |- prisma/\n    |-- schema.prisma\n  |- public/\n    |-- images/\n        |--- logo.png\n        |--- placeholder.jpg\n  |- .env\n  |- .env.example\n  |- .eslintrc.json\n  |- .gitignore\n  |- middleware.ts\n  |- next.config.js\n  |- package-lock.json\n  |- package.json\n  |- postcss.config.js\n  |- tailwind.config.ts\n  |- tsconfig.json\n```\n\n\u003cbr /\u003e\n\n## :toolbox: Getting Started\n\n1. Make sure **Git** and **NodeJS** is installed.\n2. Clone this repository to your local computer.\n3. Create `.env` file in root directory.\n4. Contents of `.env`:\n\n```bash\n# .env\n\n# mongodb url\nDATABASE_URL=\"mongodb://127.0.0.1/messenger-clone\"\n\n# client url for next auth\nNEXTAUTH_URL=http://localhost:3000\n\n# next auth secret (random strings)\nNEXTAUTH_SECRET=\u003cyour-nextauth-secret\u003e\n\n# github auth credentials\nGITHUB_CLIENT_ID=\u003cyour-github-client-id\u003e\nGITHUB_CLIENT_SECRET=\u003cyour-github-client-secret\u003e\n\n# google auth credentials\nGOOGLE_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com\nGOOGLE_CLIENT_SECRET=\u003cyour-google-client-secret\u003e\n\n# next cloudinary credentials\nNEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=xxxxxxxxx\nNEXT_PUBLIC_CLOUDINARY_CLOUD_PRESET=xxxxxxxxxx\n\n# pusher credentials\nPUSHER_APP_ID=00000000\nPUSHER_APP_SECRET=xxxxxxxxxxxxxxxxxxxxxx\nNEXT_PUBLIC_PUSHER_APP_KEY=xxxxxxxxxxxxxxxxxxxxx\nNEXT_PUBLIC_PUSHER_APP_CLUSTER=xxx\n\n```\n\n5. **MongoDB URL**\n\n   - Install and run MongoDB locally or use a cloud-based MongoDB service.\n   - Replace the placeholder in `DATABASE_URL` with your actual MongoDB connection string.\n\n6. **NextAuth Configuration**\n\n   - Set up NextAuth by following the official documentation: [NextAuth.js Documentation](https://next-auth.js.org/getting-started/introduction)\n   - Set `NEXTAUTH_URL` to the base URL of your application.\n   - Generate a random string for `NEXTAUTH_SECRET`.\n\n7. **GitHub Auth**\n\n   - Create a GitHub OAuth App by following the guide: [Creating an OAuth App](https://docs.github.com/en/developers/apps/creating-an-oauth-app)\n   - Set `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` with the obtained credentials.\n\n8. **Google Auth**\n\n   - Create a project on the Google Cloud Console: [Google Cloud Console](https://console.cloud.google.com/)\n   - Follow the steps to set up OAuth consent screen and credentials: [Create credentials](https://developers.google.com/identity/sign-in/web/sign-in)\n   - Set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` with the obtained credentials.\n\n9. **Cloudinary**\n\n   - Sign up for a Cloudinary account: [Cloudinary Sign-up](https://cloudinary.com/users/register/free)\n   - Retrieve your cloud name from the dashboard.\n   - Set `NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME` and `NEXT_PUBLIC_CLOUDINARY_CLOUD_PRESET` with the obtained credentials.\n\n10. **Pusher**\n\n    - Sign up for a Pusher account: [Pusher Sign-up](https://dashboard.pusher.com/accounts/sign_up)\n    - Create a new app and obtain the app ID, app secret, app key, and cluster.\n    - Set `PUSHER_APP_ID`, `PUSHER_APP_SECRET`, `NEXT_PUBLIC_PUSHER_APP_KEY`, and `NEXT_PUBLIC_PUSHER_APP_CLUSTER` with the obtained credentials.\n\n11. Open terminal in root directory. Run `npm install` or `yarn install`.\n\n12. Now app is fully configured 👍 and you can start using this app using `npm run dev` or `yarn dev`.\n\n### :books: Additional Resources\n\n- **Next.js Documentation:** Explore the power of Next.js for building your web applications.\n\n  - [Next.js Documentation](https://nextjs.org/docs/)\n\n- **NextAuth.js Documentation:** Learn more about authentication in Next.js using NextAuth.js.\n\n  - [NextAuth.js Documentation](https://next-auth.js.org/)\n\n- **Tailwind CSS Documentation:** Dive into the documentation for Tailwind CSS, a utility-first CSS framework used in the project.\n\n  - [Tailwind CSS Documentation](https://tailwindcss.com/docs)\n\n- **Pusher Documentation:** Explore Pusher for adding real-time functionality to your applications.\n\n  - [Pusher Documentation](https://pusher.com/docs)\n\n- **React Icons Documentation:** Find and customize high-quality SVG icons for your React applications.\n\n  - [React Icons Documentation](https://react-icons.github.io/react-icons/)\n\n- **React Select Documentation:** Get to know more about React Select, a flexible and customizable select component.\n\n  - [React Select Documentation](https://react-select.com/home)\n\n- **React Hook Form Documentation:** Learn about React Hook Form for efficient form management in React.\n\n  - [React Hook Form Documentation](https://react-hook-form.com/get-started)\n\n- **Next Cloudinary Documentation:** Understand how to integrate Cloudinary for image and video management.\n\n  - [Next Cloudinary Documentation](https://cloudinary.com/documentation)\n\n- **Prisma Documentation:** Explore Prisma for database access in TypeScript and JavaScript.\n\n  - [Prisma Documentation](https://www.prisma.io/docs/)\n\n- **Axios Documentation:** Find information on how to use Axios for making HTTP requests.\n\n  - [Axios Documentation](https://axios-http.com/docs/intro)\n\n- **Zustand Documentation:** Learn about Zustand, a small and fast state management library.\n\n  - [Zustand Documentation](https://zustand.surge.sh/)\n\n- **React Hot Toast Documentation:** Understand how to use React Hot Toast for toast notifications in React applications.\n\n  - [React Hot Toast Documentation](https://react-hot-toast.com/)\n\n- **Headless UI Documentation:** Explore Headless UI, a set of completely unstyled UI components.\n  - [Headless UI Documentation](https://headlessui.dev/)\n\n**NOTE:** Please make sure to keep your API keys and configuration values secure and do not expose them publicly.\n\n## :camera: Screenshots:\n\n![Modern UI/UX](/.github/images/img1.png \"Modern UI/UX\")\n\n![Realtime Messaging](/.github/images/img2.png \"Realtime Messaging\")\n\n![Create Group Chats](/.github/images/img3.png \"Create Group Chats\")\n\n![Edit your Profile](/.github/images/img4.png \"Edit your Profile\")\n\n## :gear: Tech Stack\n\n[![React JS](https://skillicons.dev/icons?i=react \"React JS\")](https://react.dev/ \"React JS\") [![Next JS](https://skillicons.dev/icons?i=next \"Next JS\")](https://nextjs.org/ \"Next JS\") [![Typescript](https://skillicons.dev/icons?i=ts \"Typescript\")](https://www.typescriptlang.org/ \"Typescript\") [![Tailwind CSS](https://skillicons.dev/icons?i=tailwind \"Tailwind CSS\")](https://tailwindcss.com/ \"Tailwind CSS\") [![Vercel](https://skillicons.dev/icons?i=vercel \"Vercel\")](https://vercel.app/ \"Vercel\") [![Prisma](https://skillicons.dev/icons?i=prisma \"Prisma\")](https://prisma.io/ \"Prisma\")\n\n## :wrench: Stats\n\n[![Stats for Messenger Clone](/.github/images/stats.svg \"Stats for Messenger Clone\")](https://pagespeed-insights-svg.glitch.me/?url=https://appmessenger.vercel.app/ \"Stats for Messenger Clone\")\n\n## :raised_hands: Contribute\n\nYou 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.\n\n## :gem: Acknowledgements\n\nUseful resources and dependencies that are used in Messenger Clone.\n\n- Thanks to CodeWithAntonio: https://codewithantonio.com/\n- [@headlessui/react](https://www.npmjs.com/package/@headlessui/react) - Version: ^1.7.17\n- [@next-auth/prisma-adapter](https://www.npmjs.com/package/@next-auth/prisma-adapter) - Version: ^1.0.7\n- [@prisma/client](https://www.npmjs.com/package/@prisma/client) - Version: ^5.7.0\n- [@tailwindcss/forms](https://www.npmjs.com/package/@tailwindcss/forms) - Version: ^0.5.7\n- [axios](https://www.npmjs.com/package/axios) - Version: ^1.6.2\n- [bcrypt](https://www.npmjs.com/package/bcrypt) - Version: ^5.1.1\n- [clsx](https://www.npmjs.com/package/clsx) - Version: ^2.0.0\n- [date-fns](https://www.npmjs.com/package/date-fns) - Version: ^2.30.0\n- [lodash](https://www.npmjs.com/package/lodash) - Version: ^4.17.21\n- [next](https://www.npmjs.com/package/next) - Version: 14.0.3\n- [next-auth](https://www.npmjs.com/package/next-auth) - Version: ^4.24.5\n- [next-cloudinary](https://www.npmjs.com/package/next-cloudinary) - Version: ^5.11.0\n- [pusher](https://www.npmjs.com/package/pusher) - Version: ^5.2.0\n- [pusher-js](https://www.npmjs.com/package/pusher-js) - Version: ^8.4.0-rc2\n- [react](https://www.npmjs.com/package/react) - Version: ^18\n- [react-dom](https://www.npmjs.com/package/react-dom) - Version: ^18\n- [react-hook-form](https://www.npmjs.com/package/react-hook-form) - Version: ^7.48.2\n- [react-hot-toast](https://www.npmjs.com/package/react-hot-toast) - Version: ^2.4.1\n- [react-icons](https://www.npmjs.com/package/react-icons) - Version: ^4.12.0\n- [react-select](https://www.npmjs.com/package/react-select) - Version: ^5.8.0\n- [react-spinners](https://www.npmjs.com/package/react-spinners) - Version: ^0.13.8\n- [zustand](https://www.npmjs.com/package/zustand) - Version: ^4.4.7\n- [@types/bcrypt](https://www.npmjs.com/package/@types/bcrypt) - Version: ^5.0.2\n- [@types/lodash](https://www.npmjs.com/package/@types/lodash) - Version: ^4.14.202\n- [@types/node](https://www.npmjs.com/package/@types/node) - Version: ^20\n- [@types/react](https://www.npmjs.com/package/@types/react) - Version: ^18\n- [@types/react-dom](https://www.npmjs.com/package/@types/react-dom) - Version: ^18\n- [autoprefixer](https://www.npmjs.com/package/autoprefixer) - Version: ^10.0.1\n- [eslint](https://www.npmjs.com/package/eslint) - Version: ^8\n- [eslint-config-next](https://www.npmjs.com/package/eslint-config-next) - Version: 14.0.3\n- [postcss](https://www.npmjs.com/package/postcss) - Version: ^8\n- [prisma](https://www.npmjs.com/package/prisma) - Version: ^5.7.0\n- [tailwindcss](https://www.npmjs.com/package/tailwindcss) - Version: ^3.3.0\n- [typescript](https://www.npmjs.com/package/typescript) - Version: ^5\n\n## :coffee: Buy Me a Coffee\n\n[\u003cimg src=\"https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black\" width=\"200\" /\u003e](https://www.buymeacoffee.com/sanidhy \"Buy me a Coffee\")\n\n## :rocket: Follow Me\n\n[![GitHub followers](https://img.shields.io/github/followers/sanidhyy?style=social\u0026label=Follow\u0026maxAge=2592000)](https://github.com/sanidhyy \"Follow Me\")\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Ftwitter.com%2FTechnicalShubam)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2Fsanidhyy%2Fmedical-chat-app \"Tweet\")\n[![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge\u0026logo=youtube\u0026logoColor=white)](https://www.youtube.com/channel/UCNAz_hUVBG2ZUN8TVm0bmYw \"Subscribe my Channel\")\n\n## :books: Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!\n\n## :page_with_curl: Deploy on Vercel\n\nThe easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template\u0026filter=next.js\u0026utm_source=create-next-app\u0026utm_campaign=create-next-app-readme) from the creators of Next.js.\n\nCheck out [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.\n\n## :star: Give A Star\n\nYou can also give this repository a star to show more people and they can use this repository.\n\n## :star2: Star History\n\n\u003ca href=\"https://star-history.com/#sanidhyy/messenger-clone\u0026Timeline\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=sanidhyy/messenger-clone\u0026type=Timeline\u0026theme=dark\" /\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=sanidhyy/messenger-clone\u0026type=Timeline\" /\u003e\n    \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=sanidhyy/messenger-clone\u0026type=Timeline\" /\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n\n\u003cbr /\u003e\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanidhyy%2Fmessenger-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanidhyy%2Fmessenger-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanidhyy%2Fmessenger-clone/lists"}