About this app
URL shortener with Svelte
Details
- Github repository
- The `task` branch of the repository is a working branch
- `adapter-cloudflare` to deploy to Cloudflare Pages
- Integrate Cloudflare Pages with GitHub repository
- Activate CI/CD for integration
- Enable pull requests from `task` to `master` branch
- Use Cloudflare Workers KV as storage backend
- Create Svelte `+server.ts` route for `/[shortUrl]`
- Use 302 redirect to the [shortUrl]
- Store the following data in KV:
- Redirect time
- User Agent
- Geoip data provided by Cloudflare
- Client IP address
- Create route `+page.svelte` for `/[shortUrl]/stats` page
- 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)
- Route `/list` to display all generated links
UI Requirements
- Use Svelte Form Enhancements to create quality input form
- Input form contains text input for long URL input and `Submit` button. Use URL validation.
- Prevent double click/submission of long URL.
- Once long URL is submitted and short one was generated, replace button with short URL.
- Check for duplicate URL and issue an error if it exists.
Code Requirements
- Minimal usage of 3rd-party libraries
- TypeScript in strict mode
- Maximal usage of Svelte (layouts, etc.)