This project is developed for the Level Supermind Hackathon to analyze mock social media engagement data using Langflow and DataStax Astra DB
DataLens is a social media analytics tool that provides actionable insights into engagement metrics. It helps users analyze how different types of posts (carousels, reels, images) perform and offers suggestions to improve social media strategies using GPT.
The goal of this project is to:
- Simulate social media engagement data (likes, shares, comments, post types).
- Store the data in DataStax Astra DB.
- Use Langflow to build workflows that analyze the data and generate insights using GPT.
Technology | Purpose |
---|---|
DataStax Astra DB | Database for storing engagement data |
Langflow | Workflow creation and GPT integration |
Groq | To generate insights based on the data |
React | Frontend |
Python | Server |
Follow these steps to set up the project locally:
-
Clone the Repository
git clone https://github.com/shreyawatane/DataLens.git
-
Navigate to the Client Directory
cd client
-
Add a
.env
File to the Root Directory
Create a.env
file in theclient
folder with the following template:VITE_API_BASE_URL="your-proxy-server-url" VITE_API_AUTH_TOKEN="your-auth-token" VITE_FLOW_ID="your-flow-id" VITE_LANGFLOW_ID="your-langflow-id"
Replace placeholder values with your actual credentials.
-
Navigate to the Server Directory
cd ../server
-
Add a
.env
File to the Server Directory
Create a.env
file in theserver
folder with the following template:BASE_API_URL=https://api.langflow.astra.datastax.com APPLICATION_TOKEN=your-api-token LANGFLOW_ID=your-langflow-id FLOW_ID=your-flow-id
Use the provided
BASE_API_URL
as-is. Replace other placeholders with your actual credentials. -
Host the Server
Host your server or run it locally. If running locally, use the generated local URL as the value forVITE_API_BASE_URL
in the client.env
file.
-
Start the Server
Navigate to theserver
directory and start the server. -
Start the Client
Navigate back to theclient
directory and run:npm run dev
-
Open Project in browser
Access the application in your browser using the client URL provided by the development server.
Here are some sample insights that DataLens can generate:
✅ "Carousel posts have 20% higher engagement than static images."
✅ "Reels generate twice as many comments compared to other formats."
These insights can help users optimize their social media strategies.
The architecture of DataLens is divided into two key layers: Frontend Layer and Backend Layer. Here's a detailed breakdown:
The landing page provides an engaging introduction to DataLens with the following components:
- Header with Navigation: Easy navigation to different sections of the website.
- Features Showcase: Highlight key features of DataLens.
- Team Information: Display team members' names and roles.
- Call-to-Action Elements: Encourage users to explore the analytics dashboard.
The core feature of DataLens, providing users with actionable insights into social media performance:
- Performance Overview Cards: Quick summary of key metrics such as likes, shares, and comments.
- Data Visualization Section: Interactive charts and graphs to represent engagement data.
- Analytics Insights Panel: Displays GPT-generated insights based on engagement data.
- Data Grid for Detailed View: A tabular format for users to view post-level details.
- Assitant: Get insights about the data based on user queries.
The backend includes a proxy server to handle client requests and manage real-time data flow:
- Request Handling: Manages incoming requests from the frontend.
- Response Streaming: Streams data back to the frontend removing the headers that makes your browser block them for seamless performance.
- Error Management: Handles errors and ensures system reliability.
The backend processes engagement data to generate meaningful insights:
- Text Splitting and Chunking: Splits large text data into smaller chunks for processing.
- Data Parsing: Parses incoming data to prepare it for analysis.
- Vector Store Implementation: Stores processed data efficiently.
Thank you for taking the time to explore the DataLens Social Media Analytics Platform. We hope this documentation gives you a clear understanding of how the platform works. If you have any questions or need further details, feel free to dive into the individual sections or reach out to the development team—we're here to help!