Instalite

Instagram-style Social Media Platform · React, Express, AWS, DynamoDB, S3, ChromaDB

Overview

Instalite is a full-stack, Instagram-style social platform built by a team of four. It covers the features you'd expect (accounts, image posts, a ranked feed, likes, comments, and real-time chat) and layers on a few that go further: image-based actor matching over a vector database, a retrieval-augmented chatbot, and a federated feed that exchanges posts with other teams over Kafka. The emphasis throughout was on scalability, security, and a modular design where each feature can be developed, tested, and scaled independently.

Writeup.

Architecture

The frontend is a React single-page app; every interaction is routed to an Express.js backend, and both servers run on AWS EC2 inside a VPC that links the cloud components together. Relational data (users, posts, comments, likes, and the social graph) lives in MySQL on RDS, while media files are stored in S3 and some workloads use DynamoDB. Users authenticate with bcrypt-hashed and salted passwords, so raw credentials are never stored; a session ID is then kept in a server cookie, and every protected endpoint requires a valid session, which also blocks unauthorized access by direct URL entry.

An early lesson came from the database schema. The first version crammed user info, followers, friends, friend requests, and posts into a single 20-plus-column table that quickly became unmanageable. We split it into focused tables keyed by user_id and post_id, with separate tables for users, followers, friends, friend requests, posts, likes, and comments. Beyond cleaner organization, the lightweight schema made later graph features possible: the edges of the adsorption graph ported directly into Spark JavaRDDs for ranking.

Feed and Federation

The home feed is ranked with an implementation of the adsorption algorithm, which propagates labels across the social graph to surface the most relevant posts for each user. Posts stream in from two Kafka topics (a shared FederatedPosts topic and a Bluesky topic), so content created by anyone, including other teams, can appear in a user's feed. When a user makes a post with a description and hashtags, a Kafka producer publishes it to the FederatedPosts topic, making it publicly available across the federation. Likes and comments persist through refreshes and new sessions, and the feed uses infinite scrolling to load posts dynamically as the user scrolls.

Image Matching and Chatbot

Instalite matches user-uploaded images against a database of actor photos using ChromaDB, a vector database built for similarity search. An indexer pools the sample actor images from S3, runs them through a TensorFlow model to generate embeddings, and loads those into ChromaDB. When a user uploads a profile picture it goes through the same vectorization step, and the app queries ChromaDB to return the five actors whose embeddings are most similar for the user to choose from.

The same vector store powers a retrieval-augmented chatbot for finding posts, looking up movie facts, and discovering profiles. Rather than relying on the model's own memory, the chatbot retrieves relevant context from ChromaDB and feeds it into a GPT prompt alongside the user's question and system instructions, producing grounded natural-language answers.

Real-time Chat

Chat and friend requests run over websockets (socket.io with AJAX polling) for instant delivery. A chat can only start once both users confirm a friend request, after which a session is created. History is persistent across sessions and browsers, group chats are supported (new members gain access to prior messages), and each group composition is unique so duplicates can't be created. Users can leave at any time, and a session is torn down once its last participant exits.