A full-stack web application that helps users track and manage their subscriptions, featuring automated payment reminders and trial period tracking.
- Google OAuth Authentication: Secure user authentication using Google Sign-In
- Subscription Management:
- Add and track multiple subscriptions
- Set billing cycles and payment dates
- Categorize subscriptions for better organization
- Monitor subscription status
- Payment Reminders:
- Automated email notifications for upcoming payments
- Customizable notification settings
- Detailed payment summaries
- Trial Period Tracking: Keep track of free trial periods to avoid unwanted charges
- User Dashboard: Comprehensive view of all active subscriptions and trials
- Node.js with Express.js
- MongoDB with Mongoose ODM
- Passport.js for authentication
- Nodemailer for email notifications
- Node-cron for scheduled tasks
- React (Vite)
- Tailwind CSS
Before running this application, make sure you have:
- Node.js (v14 or higher)
- MongoDB installed and running
- Google OAuth credentials
- SMTP server credentials for email notifications
Create a .env file in the root directory with the following variables:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
SESSION_SECRET=your_session_secret
SMTP_HOST=your_smtp_host
SMTP_PORT=your_smtp_port
SMTP_USER=your_smtp_username
SMTP_PASS=your_smtp_password
- Clone the repository:
git clone [repository-url]
cd subscription-tracker- Install dependencies:
npm install- Start the development server:
npm run dev- The server will run on
http://localhost:3000and the frontend onhttp://localhost:5173
subscription-tracker/
βββ server.js # Express server configuration
βββ auth.js # Authentication setup and routes
βββ notifs.js # Email notification service
βββ models/ # Database models
βββ routes/ # API routes
βββ controllers/ # Route controllers
- User initiates Google Sign-In
- On successful authentication:
- Creates/updates auth user record
- Links to subscription user profile
- Establishes session
- Subsequent requests use session authentication
- Checks for upcoming payments every 2 minutes
- Sends email notifications 3 days before payment due
- Includes detailed payment information and subscription summary
- Automatically updates next payment dates
- Logs all notification events
GET /auth/google- Initiate Google OAuthGET /auth/google/callback- OAuth callbackGET /auth/logout- User logoutGET /auth/status- Check authentication status
GET /user/:_id- Get user profile with subscriptions and trialsPOST /subscription- Create new subscriptionPUT /subscription/:_id- Update subscriptionDELETE /subscription/:_id- Delete subscription