SecureComm is a modern, end-to-end encrypted messaging platform. It features real-time 1:1 and group chats, secure file sharing, role-based group management, and user presence tracking.
Built with Next.js 14, NestJS, Socket.IO, and MongoDB.
- End-to-End Encryption: AES-256-GCM for messages and files, protected by RSA-4096 key pairs.
- Real-Time Messaging: Instant delivery via Socket.IO with delivery/read receipts.
- Secure File Sharing: Files encrypted client-side (AES-256-GCM) then stored in Cloudinary.
- Group Chats: Fully featured role-based access control (Creator, Admin, Member).
- User Authentication: Secure onboarding and identity management via Clerk.
Follow these steps to set up the project locally.
Make sure you have the following installed on your machine:
- Node.js (v18+)
- MongoDB (Local or Atlas)
- A Clerk account for authentication keys
- A Cloudinary account for encrypted file storage (free tier available)
git clone https://github.com/Paper-rex/SecureComm.git
cd SecureComm- Create a free Cloudinary account.
- From the Cloudinary Dashboard, note your Cloud Name, API Key, and API Secret.
- These will be added to your
.envfile below.
Open a terminal and navigate to the backend folder:
cd backend
npm installEnvironment Variables:
Create a .env file in the backend/ directory using the template below. Do not use your real production keys.
# Server
PORT=3001
NODE_ENV=development
# MongoDB
MONGODB_URI=mongodb://localhost:27017/securecomm # Replace with your Atlas URI if remote
# Clerk
CLERK_SECRET_KEY=sk_test_... # From Clerk Dashboard
CLERK_PUBLISHABLE_KEY=pk_test_... # From Clerk Dashboard
CLERK_WEBHOOK_SECRET=whsec_... # Optional: For Webhooks
# Cloudinary Storage
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Email (SMTP for Invites)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password
# Frontend URL (CORS)
FRONTEND_URL=http://localhost:3000
# Rate Limiting
THROTTLE_TTL=60000
THROTTLE_LIMIT=100Start the backend development server:
npm run start:devOpen a new terminal and navigate to the frontend folder:
cd frontend
npm installEnvironment Variables:
Create a .env.local file in the frontend/ directory:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... # From Clerk Dashboard
CLERK_SECRET_KEY=sk_test_... # From Clerk Dashboard
# Clerk Routes
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# Backend API
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_WS_URL=http://localhost:3001Start the frontend development server:
npm run devOnce both servers are running:
- Open http://localhost:3000 in your browser.
- Sign up or log in using Clerk.
- Start inviting users and chatting securely!
/frontend- Next.js 14 App Router, ShadCN UI, TailwindCSS, Socket.io-client/backend- NestJS API, Socket.io Gateway, Mongoose Models, E2E Key Management/docs- Architecture blueprints, database schemas, and API design.
MIT