{"id":51332890,"url":"https://github.com/princepal-dev/shortly","last_synced_at":"2026-07-02T00:30:35.474Z","repository":{"id":348334304,"uuid":"1197523409","full_name":"princepal-dev/shortly","owner":"princepal-dev","description":"Production-grade URL shortener built with Java and Spring Boot.","archived":false,"fork":false,"pushed_at":"2026-05-13T18:18:35.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T20:18:52.671Z","etag":null,"topics":["java","redis","spring-boot","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"Java","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/princepal-dev.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-31T16:45:01.000Z","updated_at":"2026-05-13T18:18:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/princepal-dev/shortly","commit_stats":null,"previous_names":["princepal-dev/shortly"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/princepal-dev/shortly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal-dev%2Fshortly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal-dev%2Fshortly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal-dev%2Fshortly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal-dev%2Fshortly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/princepal-dev","download_url":"https://codeload.github.com/princepal-dev/shortly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal-dev%2Fshortly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35028640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java","redis","spring-boot","url-shortener"],"created_at":"2026-07-02T00:30:33.048Z","updated_at":"2026-07-02T00:30:35.424Z","avatar_url":"https://github.com/princepal-dev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shortify\n\nProduction-grade URL shortener built with Java and Spring Boot.\n\nShortify lets users create short URLs, manage links, and track click analytics, with authentication via JWT, Redis-backed caching, PostgreSQL persistence, and Docker-based local infrastructure.\n\n## Project Status\n\nThis repository is currently in the **bootstrap stage**:\n- Spring Boot application scaffold is in place.\n- Docker Compose services for PostgreSQL and Redis are defined.\n- Core modules (auth, URL APIs, analytics, admin) are planned and documented below.\n\n## Core Features (Target)\n\n- URL shortening with customizable alias support\n- JWT-based authentication and authorization\n- Link management (create, update, deactivate, delete)\n- Click analytics (total clicks, unique visitors, referrers, user agents, timestamps)\n- Redis caching for hot link resolution and reduced DB reads\n- PostgreSQL as primary persistent store\n- Dockerized local development stack\n\n## Tech Stack\n\n- Java 17\n- Spring Boot\n- Spring Security + JWT\n- Spring Data Redis\n- PostgreSQL\n- Docker / Docker Compose\n- Maven\n\n## High-Level Architecture\n\n- **API Layer**: REST endpoints for auth, URL operations, and analytics\n- **Security Layer**: JWT filter chain and role-based access control\n- **Service Layer**: business logic for shortening, resolving, tracking, and management\n- **Cache Layer (Redis)**: fast alias lookup and frequently accessed metadata\n- **Database Layer (PostgreSQL)**: durable storage for users, URLs, and analytics records\n\n## Prerequisites\n\n- JDK 17+\n- Maven 3.9+\n- Docker + Docker Compose\n\n## Quick Start (Docker-backed services)\n\nFrom project root:\n\n```bash\ndocker compose up -d\n./mvnw spring-boot:run\n```\n\n## Local Development\n\n1. Start infrastructure services:\n\n```bash\ndocker compose up -d postgres redis\n```\n\n2. Run the app:\n\n```bash\n./mvnw spring-boot:run\n```\n\n## API Surface (Planned)\n\n### Authentication\n- `POST /api/auth/register`\n- `POST /api/auth/login`\n- `POST /api/auth/refresh`\n\n### URL Management\n- `POST /api/urls` - create short URL\n- `GET /api/urls/{code}` - get URL details\n- `PUT /api/urls/{code}` - update URL metadata\n- `DELETE /api/urls/{code}` - deactivate/delete URL\n- `GET /r/{code}` - redirect to original URL\n\n### Analytics\n- `GET /api/urls/{code}/analytics` - per-link analytics\n- `GET /api/analytics/dashboard` - account-level aggregates\n\n## Security Notes\n\n- Use strong JWT secrets and rotate regularly\n- Keep access and refresh token lifetimes short and explicit\n- Store secrets in environment variables or a secret manager\n- Enforce HTTPS in production\n- Add rate limiting for auth and redirect endpoints\n\n## Caching Strategy (Planned)\n\n- Cache key: short code -\u003e destination URL + metadata\n- Cache hit path: serve redirect without database lookup\n- Cache invalidation on URL update/deletion\n- Optional TTL for stale data protection\n\n## Analytics Strategy (Planned)\n\n- Track redirect events asynchronously where possible\n- Capture timestamp, IP hash, user agent, referrer, and geo metadata\n- Store raw events for audit + aggregate counters for fast dashboards\n\n## Roadmap\n\n1. Implement domain model and persistence layer\n2. Implement JWT auth and user management\n3. Build URL create/resolve/manage endpoints\n4. Add click tracking and analytics aggregation\n5. Add Redis caching and invalidation logic\n6. Add API documentation and production hardening\n7. Add CI/CD and deployment manifests\n\n## Repository Structure\n\n- `src/main/java/com/princeworks/shortify` - application source\n- `compose.yaml` - PostgreSQL and Redis services\n- `pom.xml` - Maven dependencies and build config\n\n## License\n\nAdd your preferred license (MIT/Apache-2.0/etc.) in this repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincepal-dev%2Fshortly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincepal-dev%2Fshortly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincepal-dev%2Fshortly/lists"}