sanidhyy/discord-clone
소개
Real-time chat, voice, and community features in a modern, scalable Next.js 14-powered platform.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalDiscord Clone - Real-time chat, voice, and community features in a modern, scalable Next.js 14-powered platform.

:notebook_with_decorative_cover: Table of Contents
:bangbang: Folder Structure
Here is the folder structure of this app.
discord-clone/
|- app/
|-- (auth)/
|-- (invite)/
|-- (main)/
|-- (setup)/
|-- api/
|-- apple-icon.png
|-- error.tsx
|-- favicon.ico
|-- globals.css
|-- icon1.png
|-- icon2.png
|-- layout.tsx
|-- loading.tsx
|-- not-found.tsx
|- components/
|-- chat/
|-- clerk/
|-- modals/
|-- navigation/
|-- providers/
|-- server/
|-- ui/
|-- action-tooltip.tsx
|-- emoji-picker.tsx
|-- file-upload.tsx
|-- media-room.tsx
|-- mobile-toggle.tsx
|-- mode-toggle.tsx
|-- socket-indicator.tsx
|-- user-avatar.tsx
|- config/
|-- index.ts
|- hooks/
|-- use-chat-query.ts
|-- use-chat-scroll.ts
|-- use-chat-socket.ts
|-- use-modal-store.ts
|-- use-origin.ts
|- lib/
|-- conversation.ts
|-- current-profile-pages.ts
|-- current-profile.ts
|-- db.ts
|-- initial-profile.ts
|-- uploadthing.ts
|-- utils.ts
|- pages/
|-- api/
|- prisma/
|-- schema.prisma
|- public/
|- .env.example
|- .env/.env.local
|- .eslintrc.json
|- .gitignore
|- bun.lock
|- components.json
|- environment.d.ts
|- middleware.ts
|- next.config.mjs
|- package.json
|- postcss.config.js
|- tailwind.config.ts
|- tsconfig.json
|- types.ts
:toolbox: Getting Started
- Make sure Git and NodeJS is installed.
- Clone this repository to your local computer.
- Create
.envfile in root directory. - Contents of
.env:
# .env
# disabled next.js telemetry
NEXT_TELEMETRY_DISABLED=1
# clerk auth keys
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
CLERK_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# clerk redirect urls
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
# neon databse url
DATABASE_URL="postgresql://<user>:<password>@<host>:<post>/discord-clone?sslmode=require"
# uploading api key and app id
UPLOADTHING_SECRET=sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
UPLOADTHING_APP_ID=xxxxxxxxxxxxx
# app base url
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# livekit api keys and public url
LIVEKIT_API_KEY=XXXXXXXXXXXXXXXXX
LIVEKIT_API_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
NEXT_PUBLIC_LIVEKIT_URL=wss://discord-clone-xxxxxxxxxx.livekit.cloud
Next.js Telemetry Disabled:
- Visit the Next.js documentation or repository.
- Find the instructions to disable telemetry.
- Set
NEXT_TELEMETRY_DISABLEDto1in your.envfile.
Clerk Authentication Keys:
- Go to the Clerk website and sign in to your account.
- Navigate to the settings or API keys section.
- Generate or locate your Clerk publishable and secret keys.
- Set
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYandCLERK_SECRET_KEYaccordingly in the.envfile.
Clerk Redirect URLs:
- Refer to the Clerk documentation or settings.
- Set the required URLs for sign-in, sign-up, after sign-in, and after sign-up.
- Assign these URLs to
NEXT_PUBLIC_CLERK_SIGN_IN_URL,NEXT_PUBLIC_CLERK_SIGN_UP_URL,NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL, andNEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URLrespectively in the.envfile.
Neon Database URL:
- Access your database provider (e.g., PostgreSQL).
- Retrieve the necessary connection details such as username, password, host, and port.
- Construct the database URL using the obtained information and SSL mode.
- Assign the constructed URL to
DATABASE_URLin the.envfile.
Uploading API Key and App ID:
- Go to the UploadThing website or application.
- Find the section for API keys or account settings.
- Generate or locate your secret key and app ID.
- Set
UPLOADTHING_SECRETandUPLOADTHING_APP_IDin the.envfile accordingly.
App Base URL:
- Determine the base URL of your application.
- Set
NEXT_PUBLIC_BASE_URLto the base URL in the.envfile.
- Livekit API Keys and Public URL:
- Visit the Livekit website or dashboard.
- Navigate to API settings or keys section.
- Generate or locate your API key and secret.
- Set
LIVEKIT_API_KEY,LIVEKIT_API_SECRET, andNEXT_PUBLIC_LIVEKIT_URLin the.envfile according to the obtained information.
Save and Secure:
- Save the changes to the
.env.localfile.
- Save the changes to the
Install Project Dependencies using
npm install --legacy-peer-depsoryarn install --legacy-peer-deps.Now app is fully configured 👍 and you can start using this app using either one of
npm run devoryarn dev.
NOTE: Please make sure to keep your API keys and configuration values secure and do not expose them publicly.
:raising_hand: Need Help?
If you run into issues during installation or setup:
- GitHub Discussions — Open a Q&A discussion for setup and troubleshooting help.
- Email — [email protected]
- Discord —
@sanidhyy
:camera: Screenshots



:gear: Tech Stack
:wrench: Stats
:raised_hands: Contribute
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.
:gem: Acknowledgements
Useful resources and dependencies that are used in Discord Clone.
- Thanks to CodeWithAntonio: https://codewithantonio.com/
- @clerk/nextjs: ^4.31.5
- @clerk/themes: ^1.7.10
- @emoji-mart/data: ^1.2.1
- @emoji-mart/react: ^1.1.1
- @hookform/resolvers: ^3.10.0
- @livekit/components-react: 2.9.25
- @livekit/components-styles: 1.0.11
- @prisma/client: ^5.11.0
- @radix-ui/react-avatar: ^1.1.11
- @radix-ui/react-dialog: ^1.3.1
- @radix-ui/react-dropdown-menu: ^2.1.16
- @radix-ui/react-label: ^2.1.8
- @radix-ui/react-popover: ^1.1.15
- @radix-ui/react-scroll-area: ^1.2.10
- @radix-ui/react-select: ^2.2.6
- @radix-ui/react-separator: ^1.1.8
- @radix-ui/react-slot: ^1.2.4
- @radix-ui/react-tooltip: ^1.2.8
- @tanstack/react-query: ^4.43.0
- @types/node: ^25.2.3
- @types/react: ^19.2.14
- @types/react-dom: ^19.2.3
- @types/uuid: ^11.0.0
- @uploadthing/react: ^7.3.3
- autoprefixer: ^10.4.24
- axios: ^1.13.5
- class-variance-authority: ^0.7.1
- clsx: ^2.1.1
- cmdk: ^1.1.1
- date-fns: ^4.1.0
- emoji-mart: ^5.6.0
- eslint: ^8
- eslint-config-next: 16.0.10
- livekit-server-sdk: ^2.1.2
- lucide-react: ^0.574.0
- next: 15.5.24
- next-themes: ^0.3.0
- postcss: ^8
- prisma: ^5.11.0
- query-string: ^10.0.0
- react: ^19.2.4
- react-dom: ^19.2.4
- react-hook-form: ^7.71.1
- socket.io: ^4.8.3
- socket.io-client: ^4.8.3
- tailwind-merge: ^2.6.1
- tailwindcss: ^3.3.0
- tailwindcss-animate: ^1.0.7
- typescript: ^5.9.3
- uploadthing: ^7.7.4
- uuid: ^13.0.0
- zod: ^4.3.6
- zustand: ^5.1.0
:coffee: Buy Me a Coffee
:rocket: Follow Me
:books: Learn More
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!
:page_with_curl: Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out Next.js deployment documentation for more details.
:page_with_curl: Deploy on Railway
Deploying your Next.js app on Railway.app is simple and straightforward.
Sign up or Log in:
- Head over to Railway.app and either sign up for a new account or log in to your existing one.
Connect Repository:
- Connect your project repository (e.g., GitHub, GitLab, Bitbucket) to Railway.
Configure Environment Variables:
- Set up your environment variables in Railway's dashboard or using their CLI. Ensure you include all required variables as per your project's configuration.
Set Up Build Command:
- Configure your build command to ensure Railway can build and deploy your Next.js app correctly. Typically, this command will be
yarn buildornpm run build.
- Configure your build command to ensure Railway can build and deploy your Next.js app correctly. Typically, this command will be
Deploy:
- Trigger the deployment process either from Railway's dashboard or through their CLI.
Monitor Deployment:
- Once deployed, monitor the deployment process and check for any errors or warnings in Railway's dashboard.
Custom Domain (Optional):
- If you have a custom domain, you can set it up with Railway to point to your deployed Next.js app.
For more detailed instructions or troubleshooting, refer to Railway documentation.
:star: Give A Star
You can also give this repository a star to show more people and they can use this repository.
:star2: Star History
관련 프로젝트 살펴보기
불러오는 중…