My app simplifies link tracking, making it ideal for evaluating digital engagement. It's built on clean, tested code, ensuring reliability. Designed for ease and efficiency, it generates trackable shortened URLs.
Some 'cheats' that I used in the home assignment:
- Github Copilot ( only to auto complete some methods or variables )
- Github Copilot to generate bases of rspec files ( fixed inconsistencies and some small tests by myself )
ruby 3.2.2 ( [yjti enabled](https://github.com/Shopify/yjit) )
rails 7.1.2
responders
browser
geoip
figaro
sqlite3
ruby-lsp
rspec
rubocop
factory_bot_rails
simplecov
The API has been meticulously documented using Slate, offering enhanced readability and interpretation for users. This documentation provides a comprehensive guide, ensuring ease of use and accessibility for all potential API consumers.
https://breim.github.io/link_tracker_api_docs/
The API postman collection is also available in the root folder of the project (tracker.postman_collection.json)
Just run inside the project folder:
rspecYou also can check the tests covarage using simplecov after running rspec:
open coverage/index.htmlTo enhance convenience, I have developed a compact Docker image.
Build:
docker build -f Dockerfile.dev -t link_tracker .Run:
docker run -p 3000:3000 link_trackerOpen in your browser to redirect and save the access:
http://localhost:3000/<TOKEN>
I've integrated the GeoIP library and Maxmind's database within the analytics functionality to capture and store geographical details such as latitude, longitude, city, state, and additional information based on IP addresses. However, when accessed via localhost in a development environment, Rails captures the IP address 127.0.0.1, leading to limited data retrieval. In contrast, in a production environment with a genuine IP address, the system is designed to successfully return a comprehensive set of information.
[
{
"id": 3,
"system_name": "macOS",
"browser_name": "Chrome",
"browser_version": "121.0.0.0",
"referer": null,
"country": null,
"region": null,
"city": null,
"latitude": null,
"longitude": null,
"ip": "::1",
"device": "mac",
"created_at": "2024-02-11T22:33:00.106Z"
},
{
"id": 4,
"system_name": "macOS",
"browser_name": "Chrome",
"browser_version": "121.0.0.0",
"referer": null,
"country": null,
"region": null,
"city": null,
"latitude": null,
"longitude": null,
"ip": "::1",
"device": "mac",
"created_at": "2024-02-11T22:36:11.708Z"
},
]Materials and links I used for consulting during the project development: