How nols05/sentinel works
Main Components
• Backend Service (Python)
– Contains the social media integration and sentiment analysis logic.
– Key modules include:
▫ api.py: likely routes incoming requests to specific functions.
▫ bluesky.py and reddit.py: handle fetching and processing data from respective social media platforms.
▫ sentiment_analysis folder: performs sentiment computations and model management (e.g., saveModel.py).
▫ utils modules: provide helper functions such as sorting and generating search text.
– Sample data is provided for testing or demonstration (the sample_data folder).
• Frontend Application (Next.js)
– Built using Next.js and React (evidenced by the extensive structure under frontend-next).
– Contains distinct modules:
▫ Auth (login, signup): for user authentication.
▫ Dashboard: displays various views such as data summaries, individual query results, and social media-specific sections (Reddit, possibly Bluesky mentions).
▫ Marketing: for landing pages or public-facing pages.
▫ API Endpoints: handles calls to authentication and triggers backend actions (for result fetching and status checking).
▫ Lib and hooks: abstract configuration, authentication session management, Prisma database integration (schema.prisma indicates use of Prisma as the ORM, likely tied to a SQL database).
• Database (Implicit)
– Indicated by the presence of a prisma schema in the frontend folder.
– Likely used for storing user credentials, sentiment analysis logs, or caching fetched results.
Relationships and Data Flow
• The Frontend communicates with the Backend through defined API endpoints.
• The user interacts with the Frontend through various pages (e.g., login, dashboards) and submits keywords.
• The Frontend invokes backend services (possibly over RESTful API calls) to:
▫ Trigger social media queries.
▫ Run sentiment analysis via the Python backend.
• The Backend fetches data from external social platforms (using the content in reddit.py and bluesky.py) and processes this data.
• The sentiment analysis module computes positive/negative scores and passes summaries back to the Frontend.
• The Database (managed via Prisma) is used to store persistent data such as user sessions, query histories, or analysis results.
Key Architectural Patterns and Technologies
• Separation of Concerns:
– Clear division between Frontend (presentation layer) and Backend (data processing and API integration).
• Microservices/Modular Architecture style:
– The backend is broken into modules (API routing, platform-specific integrations, sentiment analysis, utilities).
• API-Driven Communication:
– Frontend API endpoints act as a bridge between user actions and backend processing.
• Use of modern web frameworks:
– Frontend: Next.js, React, Tailwind CSS for the UI.
– Backend: Python with a modular design for handling different social media inputs.