Welcome to the URL Shortener Web App! This project implements a full-stack URL shortener web application with a modern UI, secure authentication, and a scalable backend . Users can register, log in, shorten URLs, and view analytics for their shortened URLs.
- User Registration & Login: Users must sign up and log in to use the URL shortener service. JWT-based authentication (access & refresh tokens) is used. Passwords are securely stored with bcrypt or Argon2.
- Authorization & Access Control: Only authenticated users can create, view, and manage their URLs. Each user can only see their own shortened URLs.
- OAuth (Bonus Feature): Social login (Google/GitHub OAuth) for faster access.
- UI Components:
- Login & Register pages with form validation.
- Landing Page: A simple webpage.
- Dashboard for authenticated users to manage shortened URLs.
- URL Shortening Page with an input field & copy button.
- URL Analytics Page showing clicks & usage stats.
- Tech Stack:
- React.js with TypeScript
- TailwindCSS (or any other CSS framework/library of your choice)
- React Query / SWR for state management (optional)
- API Integration:
- Use JWT tokens for authenticated API requests.
- Show error messages for invalid credentials or API failures.
- API Endpoints:
POST /auth/register
: User registrationPOST /auth/login
: User login & JWT token generationPOST /auth/logout
: Logout & token invalidationPOST /shorten
: Authenticated users shorten URLsGET /urls
: Fetch user-specific URLsGET /analytics/:shortUrl
: Get URL stats
- Containerization:
- Dockerized backend & frontend.
- Provide a
docker-compose.yml
for local setup.
- Local or Cloud Deployment: Deploy anywhere you prefer.
- Java Spring Boot
- PostgreSQL
- JWT for authentication
- React.js with TypeScript
- Node.js and npm installed
- PostgreSQL
- Java Development Kit (JDK) installed
-
Clone the repository:
git clone https://github.com/Y-elv/QTChallenge_Repo.git cd QTChallenge_Repo
-
Set up the backend:
cd service ./mvnw install
-
Set up the frontend:
cd client npm install
-
Backend: Configure your database and JWT credentials in the
service/src/main/resources/application.properties
file.spring.datasource.url=your_database_url jwt.secret=your_jwt_secret
-
Frontend: Configure your API endpoints in the
client/.env
file.REACT_APP_API_URL=your_api_url
-
Backend:
cd service ./mvnw spring-boot:run
-
Frontend:
cd client npm run dev
This project is licensed under the MIT License.