Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
drizzle-orm
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
-
neon
Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, branching, and bottomless storage.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Full code can be found on GitHub, live data can be seen on my website.
Inside the API route, convert the CSV file to JSON with csv-parser
Since Vercel's analytics pricing is a bit too expensive for my use case (where I hit the limit of 2,500 requests per month), and I didn't like using Google Analytics (not a big fan of Google), I decided to build my own analytics dashboard. Databases was something I didn't work with much before directly, so I decided to use an ORM, Drizzle, which is quite lightweight and easy to use.
I used Vercel Postgres as my database and Astro as my frontend framework. Vercel Postgres is basically a wrapper around Neon, a serverless SQL server provider. Setting up the database is pretty straightforward, I just followed the docs and got my database up and running in no time. Once my database was up and running, the time came to set up the database schema. The schema is pretty simple, it consists of a table called page_views with the following columns:
I used Vercel Postgres as my database and Astro as my frontend framework. Vercel Postgres is basically a wrapper around Neon, a serverless SQL server provider. Setting up the database is pretty straightforward, I just followed the docs and got my database up and running in no time. Once my database was up and running, the time came to set up the database schema. The schema is pretty simple, it consists of a table called page_views with the following columns: