Skip to content

Latest commit

Β 

History

78 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Chatify – Real-Time Chat Application

Chatify is a modern, real-time chat application designed to deliver a seamless, secure, and responsive messaging experience.

Built with a production-oriented architecture and deployed on Amazon Web Services (AWS), Chatify supports real-time messaging, online/offline presence, image sharing, email notifications, JWT authentication, and third-party security integrations.

This project demonstrates practical experience in full-stack development, cloud deployment, AWS infrastructure, reverse proxy configuration, process management, and production application deployment.


πŸš€ Features

  • πŸ” JWT Authentication & Authorization
  • πŸ’¬ Real-time Messaging using Socket.IO
  • 🟒 Online / Offline Presence Indicator
  • πŸ–ΌοΈ Image Sharing with Preview
  • βœ‰οΈ Email Notifications using Resend API
  • πŸ›‘οΈ Security Integration using ArcJet
  • πŸ”” Keyboard Sound Effects
  • 🎨 Modern Responsive UI with Tailwind CSS + DaisyUI
  • ⚑ State Management using Zustand
  • 🧠 Optimized Rendering with React Hooks
  • ☁️ AWS Cloud Deployment
  • πŸ”„ Process Management using PM2
  • 🌐 Nginx Reverse Proxy
  • πŸ”’ HTTPS / SSL Support

☁️ AWS Deployment Architecture

Chatify is deployed on Amazon Web Services (AWS) using an EC2-based production architecture.

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚       Users         β”‚
                         β”‚   Web / Browser     β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                                  HTTPS
                                    β”‚
                                    β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚       Nginx         β”‚
                         β”‚   Reverse Proxy     β”‚
                         β”‚     SSL / HTTPS     β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                                    β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚      AWS EC2        β”‚
                         β”‚                     β”‚
                         β”‚  Node.js / Express  β”‚
                         β”‚  Socket.IO          β”‚
                         β”‚  PM2               β”‚
                         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚      β”‚
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      └─────────────┐
                   β–Ό                                 β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  MongoDB Atlas  β”‚              β”‚ Third-Party     β”‚
          β”‚    Database     β”‚              β”‚ Services        β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚                 β”‚
                                           β”‚ Resend          β”‚
                                           β”‚ ArcJet          β”‚
                                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

AWS Infrastructure

  • ☁️ Amazon EC2 – Hosts the production Node.js application
  • 🌐 Nginx – Reverse proxy and web server
  • πŸ”„ PM2 – Node.js process management
  • πŸ”’ HTTPS / SSL – Secure client-server communication
  • πŸ›‘οΈ AWS Security Groups – Network-level access control
  • πŸ“¦ Amazon S3 – Cloud storage
  • πŸ—„οΈ MongoDB Atlas – Application database

πŸ› οΈ Tech Stack

Frontend

  • React
  • Vite
  • Tailwind CSS
  • DaisyUI
  • Zustand
  • Lucide Icons
  • Axios
  • Socket.IO Client

Backend

  • Node.js
  • Express.js
  • Socket.IO
  • MongoDB
  • Mongoose
  • JWT Authentication
  • Resend API
  • ArcJet

Cloud & DevOps

  • AWS EC2
  • AWS S3
  • Nginx
  • PM2
  • Linux
  • SSL / HTTPS
  • Git
  • GitHub

πŸ“‚ Project Structure

chatify/
β”œβ”€β”€ backend/
β”‚   └── src/
β”‚       β”œβ”€β”€ controllers/
β”‚       β”œβ”€β”€ emails/
β”‚       β”œβ”€β”€ lib/
β”‚       β”œβ”€β”€ middleware/
β”‚       β”œβ”€β”€ models/
β”‚       └── routes/
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ dist/
β”‚   β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   └── sounds/
β”‚   β”‚
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── sounds/
β”‚   β”‚
β”‚   └── src/
β”‚       β”œβ”€β”€ components/
β”‚       β”œβ”€β”€ hooks/
β”‚       β”œβ”€β”€ lib/
β”‚       β”œβ”€β”€ pages/
β”‚       └── store/
β”‚
└── README.md

βš™οΈ Environment Variables

Create a .env file inside the backend directory:

PORT=3000
MONGO_URI=your_mongodb_connection_string
NODE_ENV=production
JWT_SECRET=your_jwt_secret
RESEND_API_KEY=your_resend_api_key
EMAIL_FROM="your_email@resend.dev"
EMAIL_FROM_NAME="Your Name"
CLIENT_URL=https://your-domain.com
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
ARCJET_KEY=your_arcjet_key
ARCJET_ENV=production

Warning

Security: Never commit .env files, API keys, database credentials, JWT secrets, or other sensitive information to GitHub.


▢️ Getting Started

  1. Clone the repository:

    git clone https://github.com/inba-web/chatify.git
    cd chatify
  2. Install frontend dependencies:

    cd frontend
    npm install
  3. Install backend dependencies:

    cd ../backend
    npm install
  4. Configure environment variables: Create a .env file inside the backend directory and configure the required environment variables.

  5. Start the backend:

    npm run dev
  6. Start the frontend:

    cd ../frontend
    npm run dev

Open the application at: http://localhost:5173


☁️ Production Deployment

Chatify is deployed on AWS EC2 and runs as a production Node.js application.

Production Request Flow

GitHub
   β”‚
   β–Ό
AWS EC2
   β”‚
   β”œβ”€β”€ Node.js
   β”œβ”€β”€ Express.js
   └── Socket.IO
          β”‚
          β–Ό
         PM2
          β”‚
          β–Ό
        Nginx
          β”‚
          β–Ό
      HTTPS / SSL
          β”‚
          β–Ό
        Users

Production Components

Component Purpose
AWS EC2 Application hosting
Node.js Backend runtime
Express.js REST API
Socket.IO Real-time communication
PM2 Process management
Nginx Reverse proxy
HTTPS / SSL Secure communication
MongoDB Atlas Database
Amazon S3 Object/file storage
Resend Transactional emails
ArcJet Security and request protection

πŸ” Security

Chatify implements multiple layers of application and infrastructure security:

  • JWT-based authentication
  • Secure authentication cookies
  • HTTPS communication
  • AWS EC2 Security Groups
  • Nginx reverse proxy
  • ArcJet security integration
  • Environment-based secret management
  • MongoDB authentication
  • Restricted server access
  • Production environment configuration

Important

Sensitive credentials are never stored in the repository.


🧠 Key Learnings

Through this project, I gained practical experience in:

  • Building real-time applications with Socket.IO
  • Implementing JWT authentication
  • Managing online/offline presence
  • Working with MongoDB and Mongoose
  • Sending transactional emails with Resend
  • Integrating third-party security services
  • Deploying Node.js applications on AWS EC2
  • Configuring Nginx as a reverse proxy
  • Managing production processes with PM2
  • Configuring HTTPS / SSL
  • Working with AWS Security Groups
  • Using Amazon S3 for cloud storage
  • Connecting cloud applications with MongoDB Atlas
  • Managing production environment variables
  • Debugging production networking and authentication issues
  • Structuring a full-stack application for production

πŸ“ˆ Future Enhancements

  • πŸ’¬ Message reactions
  • βœ“ Read receipts
  • πŸ‘₯ Group chats
  • πŸŽ™οΈ Voice messages
  • πŸ”” Push notifications
  • πŸ‘€ Advanced profile customization
  • πŸ“± Progressive Web App support
  • πŸ“Š Application monitoring
  • πŸš€ Automated CI/CD deployment

πŸ™Œ Acknowledgements

Built with consistency, persistence, and a strong focus on learning modern full-stack development and cloud technologies.

Chatify represents a practical implementation of a production-oriented real-time communication platform, combining modern web technologies with AWS cloud infrastructure.


πŸ“œ License

This project is open-source and available under the MIT License.


πŸ”— Links

About

A modern real-time chat application built with the MERN stack, Socket.IO, and AWS. Features secure JWT authentication, instant messaging, online presence, media sharing, email notifications, and a scalable, production-ready architecture focused on performance, security, and user experience.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages