How embarkxofficial/url-shortener-project works
Main Components
A. Frontend Layer (url-shortener-react):
• React Application Container
• Components Module (showing key components like Dashboard, Auth pages)
• Context API Module
• API Integration Layer
• Routing Module
B. Backend Layer (url-shortener-sb):
• Spring Boot Application Container
• Controllers Layer
• Service Layer
• Repository Layer
• Security Layer
• Models/DTOs
C. Database Layer:
• Database (likely PostgreSQL/MySQL based on Spring Boot setup)
• Main entities: User, UrlMapping, ClickEvent
Component Relationships
• Frontend → Backend: Show REST API calls with JWT authentication
• Backend → Database: Show data persistence flows
• Security Layer: Show JWT token flow and authentication process
Specific Implementation Details
Frontend Structure:
React App
• Public Routes (Landing, Login, Register)
• Protected Routes (Dashboard)
• Shared Components
• API Integration Layer
Backend Structure:
Spring Boot App
• Security (JWT + Spring Security)
• Controllers (Auth, URL, Redirect)
• Services
• Repositories
URL Shortening Flow
• User input → API call → URL generation → Database storage
URL Redirection Flow
• Short URL request → Lookup → Redirect → Click tracking
Authentication Flow
• Login/Register → JWT generation → Protected routes
Additional Elements
• Notes for important architectural decisions
• Scaling considerations
• Error handling paths
Technical Stack Callouts
Frontend:
• React
• Context API for state management
• React Router
• Tailwind CSS
Backend:
• Spring Boot
• Spring Security
• JPA/Hibernate
• JWT Authentication