AFFORDMED ® Technology, Innovation &Af ordability Develop a HTTP URL Shortener Microservice Ensure you’ve followed the instructions and registered provided in the Campus Hiring Evaluation - Pre-Test Setup document before starting. Your task is to develop a robust HTTP URL Shortener Microservice that provides core URL shortening functionality along with basic analytical capabilities for the shortened links. Requirements & Constraints ● Mandatory Logging Integration: Your app MUST extensively use the Logging Middleware you created in the Pre-Test Setup stage. Use of inbuilt language loggers or console logging is not allowed. ● Microservice Architecture: Implement a single microservice capable of handling the specified API endpoints. ● Authentication: For the purpose of this evaluation, assume users accessing your APIs are pre-authorized. Your application must not require user registration or login mechanisms for API access. ● Short Link Uniqueness: All generated short links must be globally unique. ● Default Validity: If a user does not specify a validity period for a shortened URL, it must default to 30 minutes. Validity input from the user will always be provided as an integer representing minutes. ● Custom Shortcodes: Users may optionally provide a custom shortcode of their choice. If a shortcode is provided, your service must attempt to use it, ensuring it is unique and valid (e.g., alphanumeric, reasonable length). If no shortcode is provided, your service must automatically generate a unique shortcode. ● Redirection: When a user accesses a shortened URL (e.g., http://hostname:port/abcd1), the service must redirect them to the original long URL. ● Error Handling: Implement robust error handling. Your API endpoints should return appropriate HTTP status codes and descriptive JSON response bodies for invalid requests (e.g., malformed input, non-existent shortcode, shortcode collision, expired link). Afford Medical Technologies Private Limited B 230 2nd Main Road, Sainikpuri, Hyderabad-500094, Telangana, INDIA. Phone: 91-40-27117068/27116133, Web: www.affordmed.com, E-mail:
[email protected], CIN: U72200TG2007PTC056067, URN: UDYAM-TS-20-0013532
AFFORDMED ® Technology, Innovation &Af ordability ● shortLink: The complete shortened URL. ● expiry: The ISO 8601 formatted timestamp indicating when the short link expires. Retrieve Short URL Statistics ● Description: Retrieves usage statistics for a specific shortened URL. ● Method: GET ● Route: http://hostname:port/shorturls/:abcd1 ● The response must be a JSON object containing statistics related to the specified shortcode, including: ○ The total number of times the short link has been clicked. ○ Information about the original URL it points to, its creation date, and its expiry date. ○ Detailed click data for each interaction, which should include the timestamp of the click, the source from which the click originated (e.g., referrer), and a coarse-grained geographical location of the click. Develop a React URL Shortener Web App Develop a responsive React frontend web application that integrates with the backend microservice to provide a user interface for URL shortening and analytics. ● Mandatory Logging Integration: Your app MUST extensively use the Logging Middleware you created in the Pre-Test Setup stage. Use of inbuilt language loggers or console logging is not allowed. ● Running Environment: Your React application must run exclusively on http://localhost:3000. ● Integration: Your React application must be integrated with the backend APIs developed as part of this evaluation. The React application must not implement the URL shortening logic or the statistics aggregation itself; it should solely consume the backend APIs for these functionalities. Afford Medical Technologies Private Limited B 230 2nd Main Road, Sainikpuri, Hyderabad-500094, Telangana, INDIA. Phone: 91-40-27117068/27116133, Web: www.affordmed.com, E-mail:
[email protected], CIN: U72200TG2007PTC056067, URN: UDYAM-TS-20-0013532