live updates + visualizations
quick update on the web analytics service!
✦ changed the db schema to store aggregated data for each site instead of adding a new item for each page view.
✦ added origin configuration. now it only works with specified sites.
✦ created an http stream endpoint that streams the analytics data to the dashboard. this means the dashboard is now live and updates in real-time! well, i set it to update every five seconds for now.
✦ decided to add location data by country. tried a few different libraries to get the country from the ip address, but i couldn't get them to work. i whipped up ipToCountry, and it's good enough for now.
✦ added some bar charts for the browser, os, screen size, location, and views overall data.
✦ added a timestamps table to record time data for specific paths (making it easier to calculate sites' daily, weekly, and monthly view percentages).
i'm going to add a site page view to show all the data for specific sites!
here's a preview