GitHub

About this app

URL shortener with Svelte

Details

  1. Github repository
  2. The `task` branch of the repository is a working branch
  3. `adapter-cloudflare` to deploy to Cloudflare Pages
  4. Integrate Cloudflare Pages with GitHub repository
  5. Activate CI/CD for integration
  6. Enable pull requests from `task` to `master` branch
  7. Use Cloudflare Workers KV as storage backend
  8. Create Svelte `+server.ts` route for `/[shortUrl]`
  9. Use 302 redirect to the [shortUrl]
  10. Store the following data in KV:
    • Redirect time
    • User Agent
    • Geoip data provided by Cloudflare
    • Client IP address
  11. Create route `+page.svelte` for `/[shortUrl]/stats` page
  12. At `/[shortUrl]/stats` whow the following info
    • table with link open history with previously stored data (time, ip, user-agent, geoip)
    • Total amount of link activated (redirected to)
  13. Route `/list` to display all generated links

UI Requirements

  1. Use Svelte Form Enhancements to create quality input form
  2. Input form contains text input for long URL input and `Submit` button. Use URL validation.
  3. Prevent double click/submission of long URL.
  4. Once long URL is submitted and short one was generated, replace button with short URL.
  5. Check for duplicate URL and issue an error if it exists.

Code Requirements

  1. Minimal usage of 3rd-party libraries
  2. TypeScript in strict mode
  3. Maximal usage of Svelte (layouts, etc.)