Dazzlecord is an online chat application and Discord clone developed using React, Next.js, and Socket.io. It utilizes databases such as MongoDB + Prisma ORM and Google Cloud Storage, and is deployed into Docker containers on Cloud Run microservices.
The application enables real-time messaging and file storage, with authentication provided by Next-Auth v5. It is designed with inspiration from Discord's interface.
Live: https://deezcord-zpxm4cwxta-as.a.run.app
Mirror: https://dazzlecord.vercel.app
User Authentication
- Register
- Login
Messages
- Send, edit, delete, chat and images or files
- Preview sending and sent images
- Realtime server's channels messaging
- Realtime direct messaging
User Management
- List friends & pending friend request
- Send, Accept, Decline friend request
- Display user's profile
- Change user's profile (display name, profile photo, description)
Server and Channels
- Server creation, edit, deletion, and invite link
- Channel creation, edit, and deletion
- Change server's name and photo
- Change channels's name
Member Management
- List all members
- Display members profile
- Change member role (owner, admin, moderator, guest)
- Kick member
and more
Follow the instructions below:
-
Clone the repository
git clone https://github.com/hasferrr/Dazzlecord.git
-
Install dependencies
bun i cd socket-io/ bun i -
Configure Google Cloud Storage
-
Create, download, and place Service Account key file in the
/service-accountsdirectory -
Create a cloud storage bucket
-
Make it public accessible
-
Add this custom role to
allUsersprincipal (in your storage bucket):resourcemanager.projects.getstorage.managedFolders.getstorage.objects.get
-
Add this role to service account:
-
Storage Object Creator role
-
storage.buckets.updateandstorage.objects.deletecustome role
-
-
-
Configure MongoDB database
- Create MongoDB Database: https://cloud.mongodb.com
- Get MongoDB URI: https://www.mongodb.com/basics/mongodb-connection-string
-
Add environment variables to
.env(similiar to.env.exampleand all required) -
Start the application
# terminal 1 bun run dev # terminal 2 cd socket-io/ bun run dev
- You need to Configure Google Cloud Storage and Configure MongoDB database
- Set Next.js to port 3000 and Socket.io to port 3001
- Select deploy to Docker, Cloud Run, or deploy it yourself
docker compose up -dYou can manually deploy it using cloud console or using script (select one)
-
Using Cloud Console
- Push the containerized Next.js and Socket.io apps to Artifact Registry
- Deploy it to Cloud Run
-
Using Cloud Build
Documentation: Deploying to Cloud Run using Cloud Build
-
Install and configure Cloud SDK
Alternatively, you can use Cloud Shell
-
Login to your Google Cloud account
-
Enable Cloud Run Admin role to Cloud build
You can always see how to do it here: Deploying to Cloud Run using Cloud Build
-
Configure the deployment in the
cloudbuild.yamlandcloudbuild-socket-bun.yamlfiles -
Execute the script
chmod +x deploy-all.sh ./deploy-all.sh
-
-
Copy the published URLs, add those to
.env -
Redeploy it
Add Cloud Run Invoker Permission to allUsers pricipal for both deployed cloud run services














