Skip to content

Scalable realtime chat application built using SockeIO and Redis.

Notifications You must be signed in to change notification settings

ankkitsharma/chat-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatIO

This project is a scalable realtime chat application built using SockeIO, Redis, TypeScript, Express, Nextjs, and Prisma. It leverages socket.io for real-time communication and prisma for database interactions and Redis for horizontal scaling.

Hosted on

https://chat-io-cl.vercel.app/

Built With

  • Socket.IO: Socket.IO is a library that enables real-time, bidirectional, and event-based communication between the browser and the server.
  • Redis: Used Redis as adapter for socket.io to enable horizontal scaling.
  • Prisma: Prisma is a modern database access toolkit that enables developers to easily access databases using type-safe queries.
  • TypeScript: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
  • Express: Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
  • Next.js: Next.js is a React framework that enables functionality such as server-side rendering and generating static websites for React based web applications.
  • NeonDB: NeonDB is a cloud-based database service that provides a fully managed, scalable, and secure database solution for modern applications.
  • Zod: Zod is a TypeScript-first schema declaration and validation library.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/ankkitsharma/chat-io.git
    cd chat-io
  2. Install dependencies:

    cd server
    npm install
     cd client
     npm install
  3. Set up environment variables:

    • Create a .env file in the root directory.
    • Use the env.example file to set up the environment variables.
  4. Run the development server:

    For server:

    npm run build
    npm start

    For client:

    npm run dev

API Endpoints

  • POST /auth/login: Log in a user.
  • GET /chat-group: Fetch all chat groups.
  • GET /chat-group/:id: Fetch a specific chat group by ID.
  • POST /chat-group: Create a new chat group.
  • PUT /chat-group/:id: Update a chat group.
  • DELETE /chat-group/:id: Delete a chat group.
  • GET /chat-group-users?group_id=:id: Fetch users of a specific chat group.
  • POST /chat-group-users: Add a user to a chat group.
  • /chats/:groupId: Fetch chat messages for a specific group.

Roadmap

  • Add profile page for user
  • Add images for users in chat
  • Add support for emojis and file sharing

About

Scalable realtime chat application built using SockeIO and Redis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published