A Spring Boot-based web application that helps users keep track of their upcoming, due, and overdue payments. It features OTP-based authentication via email and uses JWT for securing API endpoints.
- User Registration using email and username
- OTP-based Login (No passwords)
- OTP Verification via Email
- JWT Authentication for secure APIs
- Automated Payment Reminders sent via Email:
- 2 days before due date
- On the due date
- After due date (overdue)
- Intelligent backend scheduling using Spring's cron jobs
- Professional HTML email templates for reminders
- Backend: Spring Boot, Java
- Authentication: OTP via Email, JWT (JSON Web Token)
- Database: MySQL (configurable)
- Scheduler: Spring
@Scheduled
with Cron jobs - Email: JavaMailSender (SMTP)
- Register with your email and username
- System sends an OTP to your registered email
- Enter the OTP to verify and login
- On successful login, a JWT token is generated and returned
- Include the JWT token in the browser Cookie (HttpOnly) for all protected endpoints
The system sends emails at 9 AM daily for:
- Upcoming Payments: 2 days before the due date
- Due Today Payments: On the due date
- Overdue Payments: Past due date
This is done using a Spring @Scheduled
cron job.
Prerequisites
- Java 17 or later
- Maven
- MySQL installed and running
- SMTP-enabled email (e.g. Gmail)
First Clone the repository
- Set up the MySQL database:
CREATE DATABASE payment_db;
- Update application.yml:
- Add your MySQL credentials
- Add your email SMTP details
- Add a secure JWT secret key
spring:
datasource:
url: jdbc:mysql://localhost:3306/payment_db
username: root
password: <your_sql_password>
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
show-sql: false
hibernate:
ddl-auto: update
mail:
host: smtp.gmail.com
port: 587
username: <from_email_id>
password: <app_password>
properties:
mail:
smtp:
auth: true
starttls:
enable: true
JWT_SECRET: <your secret key>
- Run the project:
./mvnw spring-boot:run
- Access the app:
http://localhost:8080/auth/register
visit this after login
http://localhost:8080/test/reminder