{"id":28169429,"url":"https://github.com/azharuddinmalik/urlshort","last_synced_at":"2026-02-07T21:02:46.037Z","repository":{"id":284119260,"uuid":"953878684","full_name":"AzharuddinMalik/URLShort","owner":"AzharuddinMalik","description":"A Java-based URL shortener utility that converts long URLs into manageable short codes","archived":false,"fork":false,"pushed_at":"2025-07-19T10:42:22.000Z","size":762,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-03T19:04:06.869Z","etag":null,"topics":["css","docker","flyway","html","java","javascript","maven","postgresql","spring-boot","stripe-api","url-shortener"],"latest_commit_sha":null,"homepage":"https://urlshort-bc7a.onrender.com/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AzharuddinMalik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-24T08:19:27.000Z","updated_at":"2025-07-22T19:57:54.000Z","dependencies_parsed_at":"2025-03-24T09:35:33.753Z","dependency_job_id":"9a4c0e15-1af1-4989-8fbd-6c4b592678c1","html_url":"https://github.com/AzharuddinMalik/URLShort","commit_stats":null,"previous_names":["azharuddinmalik/urlshort"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AzharuddinMalik/URLShort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzharuddinMalik%2FURLShort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzharuddinMalik%2FURLShort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzharuddinMalik%2FURLShort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzharuddinMalik%2FURLShort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AzharuddinMalik","download_url":"https://codeload.github.com/AzharuddinMalik/URLShort/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzharuddinMalik%2FURLShort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29208176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T20:33:12.493Z","status":"ssl_error","status_checked_at":"2026-02-07T20:30:47.381Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","docker","flyway","html","java","javascript","maven","postgresql","spring-boot","stripe-api","url-shortener"],"created_at":"2025-05-15T16:17:11.471Z","updated_at":"2026-02-07T21:02:46.016Z","avatar_url":"https://github.com/AzharuddinMalik.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🔗 Short.ly - Advanced URL Shortener\nShort.ly is a powerful and user-friendly URL shortening service designed for individuals and businesses. It transforms lengthy URLs into concise, shareable links, offering robust features like custom aliases, detailed analytics, and secure user authentication with subscription plans.\n\nThis project is built using Spring Boot for the backend and a modern HTML, CSS, and JavaScript frontend, ensuring a seamless and responsive user experience.\n\n## Architecture\n\n\n![Project Front-End](assets/Home_Page.png)\n![Project Architecture](assets/project-architecture.png)\n## ✨ Features\n* URL Shortening: Convert long, unwieldy URLs into compact, easy-to-share short links.\n* Custom Aliases: Create personalized and memorable short URLs (e.g., short.ly/MyProject).\n* User Authentication: Secure user registration and login system to manage personal links.\n* Subscription Plans:\n  * Free: Basic link shortening with limited features. \n  * Pro: Advanced features like increased link limits, custom domains, API access, and priority support. \n  * Business: High-volume link management, multiple custom domains, premium analytics, and 24/7 support.\n* Real-time History: View a list of your recently shortened URLs directly on the dashboard.\n* Theming: Toggle between light and dark modes for a personalized browsing experience.\n* Responsive Design: Optimized for seamless usage across all devices (desktop, tablet, mobile).\n* Stripe Integration: Secure payment processing for subscription plans via Stripe Checkout.\n* Backend Webhooks: Handles Stripe webhook events for automated subscription and payment management.\n* Database Persistence: Stores all URL mappings, user data, subscriptions, and payments in a MySQL database.\n\n## 🚀 Technologies Used\n\n### Backend (Spring Boot):\n* Java 17+\n* Spring Boot 3.x: Application framework.\n* Spring Data JPA: For robust database interaction and ORM. \n* MySQL: Relational database for data storage. \n* Stripe Java SDK: For payment processing and webhook handling. \n* HikariCP: High-performance JDBC connection pool. \n* Apache Commons Lang: Utility functions for string manipulation. \n* Maven: Build automation and dependency management. \n* Lombok: Reduces boilerplate code. \n* Flyway: Database migration tool for schema version control.\n\n### Frontend (HTML, CSS, JavaScript):\n* HTML5: Semantic structure for all web pages. \n* CSS3: Modern styling with custom properties (CSS variables) for easy theming (Light/Dark Mode).\n* JavaScript (Vanilla JS): Interactive elements, API calls, and client-side logic.\n* Font Awesome: For scalable vector icons.\n* Google Fonts (Inter, Merriweather): Typography for a clean and professional look\n\n## 📂 Project Structure\n\n    .\n    ├── src/\n    │   ├── main/\n    │   │   ├── java/com/example/url_shortener/\n    │   │   │   ├── config/             # Spring configurations (e.g., PricingPlanConfig)\n    │   │   │   ├── controller/         # REST API endpoints (Payment, Pricing, URL, Auth)\n    │   │   │   ├── dto/                # Data Transfer Objects (e.g., UrlDto)\n    │   │   │   ├── model/              # JPA Entities (User, Subscription, Payment, PricingPlan, Url)\n    │   │   │   │   └── enums/          # Enums for statuses (PaymentStatus, SubscriptionStatus)\n    │   │   │   ├── repository/         # Spring Data JPA repositories and PasswordEncoder\n    │   │   │   ├── service/            # Business logic (Payment, Pricing, URL, User, Auth)\n    │   │   │   └── UrlShortenerApplication.java # Main Spring Boot application\n    │   │   └── resources/\n    │   │       ├── resources/db/migration/ # Flyway SQL migration scripts\n    │   │       ├── static/             # Frontend static assets\n    │   │       │   ├── css/\n    │   │       │   │   └── style.css   # Unified global styles\n    │   │       │   ├── js/\n    │   │       │   │   └── main.js     # Consolidated JavaScript logic for all pages\n    │   │       │   ├── about.html      # About page\n    │   │       │   ├── index.html      # Main URL shortening page\n    │   │       │   ├── login.html      # User login page\n    │   │       │   ├── price.html      # Pricing plans page\n    │   │       │   └── signup.html     # User registration page\n    │   │       └── application.properties # Spring Boot configuration (database, Stripe keys)\n    ├── .gitignore                      # Specifies intentionally untracked files to ignore\n    ├── pom.xml                         # Maven project object model\n    └── README.md                       # Project README file\n\n## ⚙️ Setup and Installation\n### Prerequisites\n* Java Development Kit (JDK) 17 or later\n* Apache Maven\n* MySQL Server (running locally or via Docker)\n* Git\n* An IDE (e.g., IntelliJ IDEA, VS Code) is recommended.\n\n### Backend Setup\n#### 1. Clone the repository:\n```\ngit clone https://github.com/AzharuddinMalik/URLShort.git\ncd URLShort\n```\n#### 2. MySQL Database Configuration:\n\n* Ensure your MySQL server is running. \n* Update src/main/resources/application.properties with your MySQL database credentials.\n\n ```spel\nspring.datasource.url=jdbc:mysql://localhost:3306/url_shortener_db?createDatabaseIfNotExist=true\u0026useSSL=false\u0026serverTimezone=UTC\nspring.datasource.username=your_mysql_username\nspring.datasource.password=your_mysql_password\nspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n\n# Hibernate Configuration\nspring.jpa.hibernate.ddl-auto=update # Use 'update' for development, 'validate' or 'none' for production\nspring.jpa.show-sql=true\nspring.jpa.open-in-view=false\n```\n\n* Flyway will automatically run the migration script V1__Create_pricing_plan_table.sql to create necessary tables.\n#### 3. Stripe API Keys (Secure Handling):\n* Obtain your Stripe Secret Key (sk_test_...) and Webhook Secret (whsec_...) from your Stripe Dashboard (Developers -\u003e API keys and Webhooks).\n\n* IMPORTANT: DO NOT commit your actual keys to GitHub. For local development, you can add them to application.properties. For production, use environment variables.\n\n* In src/main/resources/application.properties:\n```\nstripe.api.key=sk_test_YOUR_ACTUAL_STRIPE_SECRET_KEY\nstripe.webhook.secret=whsec_YOUR_ACTUAL_STRIPE_WEBHOOK_SECRET\n```\n#### 4. Build the Project:\n```spel\nmvn clean install\n```\n\n### Frontend Setup\nThe frontend files are located in src/main/resources/static/. They are served directly by the Spring Boot application. No separate build step is required for the frontend.\n\n\n## ▶️ Usage\n##### 1. Run the Spring Boot Application:\n\n```spel\nmvn spring-boot:run\n```\nThe application will start on http://localhost:8080/.\n\n#### 2. Access the Web Application:\n\nOpen your web browser and navigate to:\n```\nhttp://localhost:8080/\n```\n#### 3. Register and Log In:\n* Navigate to /signup.html to create a new user account. \n* Navigate to /login.html to log in with your credentials.\n\n#### 4. Shorten URLs:\n\n* On the homepage (index.html), enter a long URL and optionally a custom alias. \n* Click \"Shorten URL\" to generate your short link.\n\n#### 5. Explore Pricing and Subscribe:\n* Visit /price.html to view different subscription plans. \n* Enter your email and click \"Get Started\" or \"Start Free Trial\" to be redirected to Stripe Checkout for secure payment.\n\n#### 6. Stripe Webhook Setup (for full functionality):\n* For local development, use a tool like ngrok to expose your local webhook endpoint to the internet.\n```\nngrok http 8080\n```\n* Copy the https forwarding URL provided by ngrok. \n* Go to your Stripe Dashboard -\u003e Developers -\u003e Webhooks.\n* Add a new endpoint: Paste your ngrok URL followed by ``` /api/payment/webhook ``` (e.g., ``` https://your-ngrok-url.ngrok-free.app/api/payment/webhook ```). \n* Select the events you want to listen to: ```checkout.session.completed```, ```invoice.paid```, ```customer.subscription.deleted``` . \n* Save the endpoint. This allows Stripe to notify your application of payment and subscription events.\n\n## 🤝 Contributing\nContributions are welcome! If you'd like to contribute, please follow these steps:\n\n1. Fork the repository.\n\n2. Create a new branch (```git checkout -b feature/your-feature-name```).\n\n3. Make your changes.\n\n4. Commit your changes (```git commit -m 'feat: Add new feature'```).\n\n5. Push to the branch (```git push origin feature/your-feature-name```).\n\n6. Open a Pull Request.\n\n## 📄 License\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazharuddinmalik%2Furlshort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazharuddinmalik%2Furlshort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazharuddinmalik%2Furlshort/lists"}