FeedRecap is a cutting-edge AI-powered newsletter platform that curates top tweets from Twitter, delivering them directly to your inbox. Whether you're following trending categories like politics, tech, finance, or entertainment, or customizing your feed with specific Twitter profiles, FeedRecap ensures you stay informed effortlessly and efficiently.
π Website: FeedRecap
π Repository: GitHub
- Choose from predefined categories:
- Politics
- Geopolitics
- Finance
- AI
- Tech
- Crypto
- Meme
- Sports
- Entertainment
- Set your preferred newsletter delivery times (Morning, Afternoon, Night).
- Receive AI-curated newsletters with the top 15 tweets from your selected categories and share them easily with friends via WhatsApp, Telegram, or Email.
- Add Twitter profiles via an auto-suggestion feature.
- Follow as many Twitter profiles as you like.
- Get personalized newsletters based on your custom profile feed, curated by AI.
- Access your personalized dashboard with these tabs:
- Newsfeed: View top tweets based on your selected categories or custom profiles.
- Latest Newsletter: Access the most recent newsletters.
- Settings: Update your categories, custom profiles, timezone, and delivery time.
- Newsletter: AI-powered newsletter content delivered straight to your inbox.
- Top Tweets: Curated top tweets of the day.
- Share Easily: Share tweets or newsletters to:
- Telegram
- Web Link: Access your newsletter via a web link for easy sharing with friends.
FeedRecap includes a comprehensive audit logging system that tracks all user activities for security, analytics, and debugging purposes.
-
Automatic Activity Tracking: All major user actions are automatically logged:
- Page visits (all pages)
- Account creation and login/logout
- Password changes
- Account updates
- Twitter account linking/unlinking
- Category and profile updates
- Feed type changes
- Newsletter views
- Link clicks (with full URLs)
- Feedback submissions
-
Metadata Storage: Each log entry includes:
- User ID and email
- Activity type and description
- Page/route information
- IP address and user agent
- Timestamp
- Additional metadata (links, categories, etc.)
-
Database Storage: All audit logs are stored in MongoDB with indexed fields for fast queries and analytics.
FeedRecap includes a powerful admin dashboard for monitoring and analytics (accessible only to admin users).
-
Admin Authentication:
- Users with
isAdmin: truein the database can access the admin dashboard - Protected by JWT authentication middleware
- Accessible at
/adminroute
- Users with
-
Analytics Features:
- Page Views Analytics: Track page visits with time period filters (1d, 3d, 7d, 30d, 6m, 1y)
- Link Clicks Tracking: Monitor all clicked links with user information and timestamps
- Activity Statistics: View activity distribution with visual charts
- User Metrics: Track total users, feed type distribution, Twitter account linking stats
-
Visualizations:
- Line charts for page views over time
- Pie charts for activity distribution
- Scrollable lists for link clicks and live activities
-
Live Activities Feed:
- Real-time audit log display
- Filter by user email
- Filter by activity type
- Shows timestamp, user, activity, description, and page
-
User Management:
- View all users with email, feed type, and Twitter account status
- User statistics and metrics
- Framework: Next.js, React
- Language: TypeScript
- State Management: React Context API
- HTTP Client: Axios with JWT interceptors
- Analytics: Google Analytics, Vercel Analytics
- Deployed On: Vercel
- Framework: Express.js
- Authentication: JWT (JSON Web Tokens), Google OAuth, Email-based login with two-step verification
- Database: MongoDB with Mongoose
- API: SendGrid (Email), Gemini AI, Axios
- Language: TypeScript
- Dev Tools: Nodemon, MongoDB Atlas, Postman, Node.js
- Automation: Node Cron for scheduling newsletter tasks
- Generative AI: Google Gemini AI
FeedRecap/
βββ client/ # Frontend (Next.js)
β βββ app/ # Next.js app directory
β β βββ api/ # API routes (DeepSeek, Twitter, video-proxy)
β β βββ dashboard/ # User dashboard page
β β βββ signin/ # Sign-in page
β β βββ signup/ # Sign-up page
β β βββ ... # Other pages
β βββ components/ # React components
β β βββ dashboard/ # Dashboard-specific components
β β βββ PageVisitLogger.tsx # Automatic page visit logging
β βββ app/
β β βββ admin/ # Admin dashboard page
β βββ context/ # React Context (UserContext)
β βββ utils/ # Utility functions (axios, notifications)
β βββ public/ # Static assets
βββ server/ # Backend (Express.js)
β βββ src/ # TypeScript source files
β β βββ server.ts # Main server file with JWT auth
β β βββ userModel.ts # User MongoDB model
β β βββ newsletterModel.ts # Newsletter MongoDB model
β β βββ tweetModel.ts # Tweet MongoDB model
β β βββ auditLogModel.ts # Audit log MongoDB model
β β βββ auditLogger.ts # Audit logging utilities
β β βββ digest.ts # Newsletter generation logic
β β βββ db.ts # Database connection
β βββ dist/ # Compiled JavaScript files
βββ start.sh # Startup script for client + server
βββ README.md # This file
- Node.js (v18 or higher)
- npm or yarn
- MongoDB database (local or MongoDB Atlas)
- Environment variables configured (see Environment Variables section below)
Before running the application, you need to configure environment variables:
# MongoDB Configuration
MONGO_USERNAME=your_mongodb_username
MONGO_PASSWORD=your_mongodb_password
# JWT Configuration
JWT_SECRET=your_jwt_secret_key (or auto-generated if not provided)
JWT_EXPIRES_IN=7d (default: 7 days)
# SendGrid Email Configuration
SENDGRID_API_KEY=your_sendgrid_api_key
FROM_EMAIL=your_sender_email@example.com
# Google OAuth Configuration
CLIENT=your_google_oauth_client_id
SECRET=your_google_oauth_client_secret
# Server URLs
SERVER=http://localhost:3001
ORIGIN=http://localhost:3000
ORIGINTEST=http://localhost:3000 (optional, for testing)
CLIENT_URL=http://localhost:3000# Backend Server URL
NEXT_PUBLIC_SERVER=http://localhost:3001
# EmailJS Configuration (optional, for contact forms)
NEXT_PUBLIC_SERVICE_ID=your_emailjs_service_id
NEXT_PUBLIC_TEMPLATE_ID=your_emailjs_template_id
NEXT_PUBLIC_PUBLIC_KEY=your_emailjs_public_keyNote: Create .env file in the server directory and .env.local file in the client directory with the above variables.
Use the provided start.sh script to automatically start both client and server:
# Make the script executable (first time only)
chmod +x start.sh
# Run the application
./start.shThe script will:
- β Check and install dependencies for both client and server
- β Build the TypeScript server code
- β Start the Express.js server on port 3001
- β Start the Next.js client on port 3000
- β Handle graceful shutdown with Ctrl+C
Access the application:
- π Client: http://localhost:3000
- π§ Server: http://localhost:3001
If you prefer to run the services separately:
- Navigate to the
clientfolder:cd client - Install dependencies:
npm install
- Create a
.env.localfile with required environment variables - Start the development server:
The client will run on http://localhost:3000
npm run dev
- Navigate to the
serverfolder:cd server - Install dependencies:
npm install
- Create a
.envfile with required environment variables - Build the TypeScript code:
npm run build
- Start the backend server:
The server will run on http://localhost:3001
npm run start
To grant admin access to a user, update the user's isAdmin field in MongoDB:
// Using MongoDB shell or MongoDB Compass
db.users.updateOne(
{ email: "admin@example.com" },
{ $set: { isAdmin: true } }
)Or use MongoDB Atlas interface to update the user document directly.
Once a user has isAdmin: true, they can:
- Access the admin dashboard at
/admin - View all analytics and audit logs
- Monitor user activities in real-time
FeedRecap uses JWT (JSON Web Tokens) for stateless authentication, providing secure and scalable user authentication.
-
Sign Up: Users register with email and password
- Two-step email verification (OTP) required for account creation
- Password is hashed using bcrypt before storage
- JWT token issued upon successful registration
-
Sign In: Users sign in with email and password
- Credentials verified against MongoDB
- JWT token issued upon successful authentication
- Users can sign up or sign in using their Google account
- OAuth flow handled via Passport.js Google Strategy
- JWT token issued after successful OAuth authentication
- New users are automatically created with default settings
-
Token Generation:
- Tokens are signed with
userIdandemailin the payload - Default expiration: 7 days (configurable via
JWT_EXPIRES_IN) - Secret key stored in environment variable
JWT_SECRET - Issuer: "feedrecap"
- Tokens are signed with
-
Token Verification:
authenticateJWTmiddleware protects authenticated routes- Validates token signature and expiration
- Extracts user information from token payload
- Attaches user data to request object for route handlers
-
Protected Routes:
/data- Fetch user dashboard data/updateProfiles- Update custom Twitter profiles/updateFeedType- Change feed type (category/custom)/updateCategories- Update selected categories/getIsNewUser- Check if user is new/getUserDetails- Get user account details/updateAccount- Update account information/check-session- Validate current session/unlinkX- Unlink Twitter account- And more...
-
Token Storage:
- JWT tokens stored in
localStorageastoken - Persists across browser sessions
- Automatically removed on logout or expiration
- JWT tokens stored in
-
Token Usage:
- Axios interceptor automatically adds
Authorization: Bearer <token>header to all API requests - Token validated on app initialization
- Automatic redirect to sign-in page on token expiration (401 errors)
- Axios interceptor automatically adds
-
Token Management:
- Token retrieved from URL parameters after OAuth redirects
- Token validated via
/check-sessionendpoint - Email extracted from token for user context
- β Password hashing with bcrypt (10 salt rounds)
- β JWT token expiration (default 7 days)
- β Token signature verification
- β CORS protection with origin validation
- β Request origin/referer validation
- β Automatic token cleanup on expiration
- β Secure HTTP-only token handling
- Login/Registration β Server validates credentials β JWT token generated
- Token Storage β Frontend stores token in localStorage
- API Requests β Axios interceptor adds token to Authorization header
- Route Protection β Backend middleware validates token
- Token Expiration β Frontend detects 401 β Removes token β Redirects to sign-in
| Route | Description | Auth Required |
|---|---|---|
/ |
Homepage | No |
/signin |
User sign-in page | No |
/signup |
User sign-up page | No |
/aboutus |
Learn more about FeedRecap | No |
/samplenewsletter |
Preview a sample newsletter | No |
/dashboard |
User dashboard with 3 tabs: | Yes (JWT) |
| - Newsfeed: View top tweets | ||
| - Latest Newsletter: Access recent | ||
| - Settings: Manage preferences | ||
/readnewsletter |
Read newsletter by ID | No |
/unsubscribe |
Unsubscribe from newsletters | No |
/admin |
Admin dashboard with analytics | Yes (Admin) |
| Route | Method | Description | Auth Required |
|---|---|---|---|
/login |
POST | Email/password login | No |
/register |
POST | User registration | No |
/logout |
POST | User logout | Yes (JWT) |
/check-session |
GET | Validate JWT token | Yes (JWT) |
/data |
GET | Get user dashboard data | Yes (JWT) |
/updateProfiles |
POST | Update custom Twitter profiles | Yes (JWT) |
/updateFeedType |
POST | Change feed type (category/custom) | Yes (JWT) |
/updateCategories |
POST | Update selected categories | Yes (JWT) |
/updateTimes |
POST | Update newsletter delivery times | Yes (JWT) |
/updateAccount |
POST | Update user account details | Yes (JWT) |
/getUserDetails |
GET | Get user account information | Yes (JWT) |
/getIsNewUser |
GET | Check if user is new | Yes (JWT) |
/newsletter/:id |
GET | Get newsletter by ID | No |
/sentOTP |
POST | Send OTP for email verification | No |
/resetPassword |
POST | Reset user password | No |
/validateEmail |
GET | Check if email exists | No |
/saveX |
POST | Link Twitter account | No |
/unlinkX |
POST | Unlink Twitter account | Yes (JWT) |
/auth/google/signup |
GET | Google OAuth sign-up | No |
/auth/google/signin |
GET | Google OAuth sign-in | No |
/auth/google/callback |
GET | Google OAuth callback | No |
/logPageVisit |
POST | Log page visit | Yes (JWT) |
/logLinkClick |
POST | Log link click | Yes (JWT) |
/logFeedback |
POST | Log feedback submission | Yes (JWT) |
/admin/analytics/pageviews |
GET | Get page views analytics | Yes (Admin) |
/admin/analytics/linkclicks |
GET | Get link clicks analytics | Yes (Admin) |
/admin/analytics/activities |
GET | Get activity statistics | Yes (Admin) |
/admin/audit-logs |
GET | Get all audit logs (live feed) | Yes (Admin) |
/admin/users |
GET | Get all users and metrics | Yes (Admin) |
- AI-Driven: Save time by getting top tweets curated with AI (Gemini AI).
- Personalized: Choose your favorite categories or custom Twitter profiles.
- Engaging Content: Access newsletters with trending tweets and easily share them with friends.
- Seamless Dashboard: Stay updated with a user-friendly dashboard.
- Effortless Automation: Newsletters and updates are automated with Node Cron.
- Secure Authentication: JWT-based stateless authentication for scalability and security.
- Multiple Auth Options: Sign in with email or Google OAuth.
- Easy Setup: One-command startup with
start.shscript. - Comprehensive Audit Logging: Track all user activities for security and analytics.
- Admin Dashboard: Powerful analytics dashboard with visualizations and real-time activity monitoring.
AI-powered-newsletter personalized-newsletters Twitter-curation top-tweets trending-news AI-curated-content category-based-news custom-twitter-profiles AI-news-delivery tech-newsletters sports-newsletters finance-newsletters politics-newsletters Next.js React Express.js MongoDB TypeScript Google-OAuth Vercel SendGrid JWT-authentication newsletter-app social-media-curation open-source news-dashboard feedrecap curated-tweets trending-topics Axios Node-Cron Gemini-AI automation JWT-tokens stateless-authentication personalized-content AI-newsletter-platform generative-AI-tech time-based-newsletters tweet-curation-tools Twitter-news-integration news-sharing-platform newsletter-dashboard curated-news-updates Twitter-profile-suggestions category-based-curation breaking-news-aggregator AI-newsletter-software JWT-based-auth custom-profile-news delivery-time-preferences trending-tweet-insights automation-with-cron MongoDB-database-newsletter AI-driven-social-curation tailored-newsletters Google-OAuth-authentication React-front-end social-media-newsletters Gemini-AI-integration analytics-for-newsletters SendGrid-email-integration efficient-newsletter-system curated-social-updates open-source-newsletter-platform audit-logging admin-dashboard user-activity-tracking analytics-dashboard activity-monitoring user-analytics page-visit-tracking link-click-analytics real-time-monitoring admin-panel user-management-dashboard
This project is licensed under the MIT License. See the LICENSE file for details.
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeatureName
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/YourFeatureName
- Open a pull request.
If you like this project, please consider starring π the repository on GitHub to support its growth and visibility!
For questions or suggestions, feel free to reach out:
- Author: Peal Hasan
- Email: contact@feedrecap.com
