Adding Time Range Generation to Data Diluvium

Following up on my previous posts about adding humidity and temperature data generation to Data Diluvium, I’m now adding a Time Range generator. I decided this would be a nice addition to give any graphing of the data a good look. This will complete the trio of generators I needed for my TimeScale DB setup. While humidity and temperature provide the environmental data, the Time Range generator ensures we have properly spaced time points for our time-series analysis.

Why Time Range Generation?

When working with TimeScale DB for time-series data, having evenly spaced time points is crucial for accurate analysis. I’ve found that many of my experiments require data points that are:

  • Evenly distributed across a time window
  • Properly spaced for consistent analysis
  • Flexible enough to handle different sampling rates
  • Random in their starting point to avoid bias

The Implementation

I created a Time Range generator that produces timestamps based on a 2-hour window. Here’s what I considered:

  • Default 2-hour time window
  • Even distribution of points across the window
  • Random starting point within a reasonable range
  • Support for various numbers of data points

Here’s how I implemented this in Data Diluvium:

Continue reading “Adding Time Range Generation to Data Diluvium”

MongoDB Atlas SDK: A Modern Toolkit

Lately, I’ve been diving into the MongoDB Atlas SDK, and it’s clear that this tool isn’t just about simplifying interactions with Atlas it’s about reimagining the developer experience across multiple languages. Whether you’re a JavaScript junkie or a polyglot juggling Go, Java, and C#, the Atlas SDK aims to be an intuitive, powerful addition to your toolkit.

In this post, I’ll break down some of the core features of the Atlas SDK, share some hands-on experiences, and extend my exploration with examples in Go, Java, and C#. If you’ve ever wished that managing your clusters and configurations could be more straightforward and less “boilerplate heavy,” keep reading.

A Quick Recap: What the Atlas SDK Brings to the Table

At its heart, the MongoDB Atlas SDK abstracts the underlying Atlas API, making it easier to work with managed clusters, deployments, and security configurations. Here are a few standout features:

  • Intuitive API: The SDK feels natural, following patterns that resonate with MongoDB’s broader ecosystem. It’s almost always nice to just call into a set of SDK libraries vs. writing up an entire layer to call and manage the calls to an API tier itself.
  • Robust Functionality: It covers everything from cluster management to advanced security settings.
  • Modern Practices: Asynchronous and promise-based (or equivalent in your language of choice), the SDK fits snugly into today’s development paradigms.
  • Streamlined Setup: Detailed documentation and easy configuration mean you can spend more time coding and less time wrestling with setup.
Continue reading “MongoDB Atlas SDK: A Modern Toolkit”

A Successful Deploy to Vercel + Adding More Auth & Login Features to The Web Interface (Plus an Error!)

In the last few posts I knocked out a slew of initial work. Much of it was just to get things up and running and make sure the database was live, the site was live, and that there was a good connection between the two. I did this by building the first basic login page with a dashboard that just shows that the user is logged in, along with a few pages to display general static content. That can be found in:

  1. Building “Adron’s Core Platform”: Starting a React App on Vercel
  2. Getting a Vercel PostgreSQL Database and Basic Authentication Operational
  3. The Confederacy of Errors Starting With Next Auth; Error, Error, npm ERR!

The tasks I’ll accomplish in the following post:

  1. I want a horizontal menu across the top that will link to the dashboard, login, and about page.
  2. I want an account creation page.
  3. I want to make sure that I set things up for the post-login action to be a redirect to the dashboard page.

Adding a Horizontal Menu

For this menu I’m going to add a div with links, assign it as a flex space (css), and add the pertinent links. The changed ./src/app/components/Navigation.tsx with changes looks like this now.

Continue reading “A Successful Deploy to Vercel + Adding More Auth & Login Features to The Web Interface (Plus an Error!)”

The Confederacy of Errors Starting With Next Auth; Error, Error, npm ERR!

In the interim while I was getting to the next stage of this app, I ran into (what was I doing? 🤷🏼‍♂️) this error.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-auth@4.24.10
npm ERR! Found: react@19.0.0-rc-66855b96-20241106
npm ERR! node_modules/react
npm ERR!   react@"19.0.0-rc-66855b96-20241106" from the root project
npm ERR!   peer react@"^18.2.0 || 19.0.0-rc-66855b96-20241106" from next@15.0.3
npm ERR!   node_modules/next
npm ERR!     next@"15.0.3" from the root project
npm ERR!     peer next@"^12.2.5 || ^13 || ^14 || ^15" from next-auth@4.24.10
npm ERR!     node_modules/next-auth
npm ERR!       next-auth@"^4.24.10" from the root project
npm ERR!   2 more (react-dom, styled-jsx)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2 || ^18" from next-auth@4.24.10
npm ERR! node_modules/next-auth
npm ERR!   next-auth@"^4.24.10" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@18.3.1
npm ERR! node_modules/react
npm ERR!   peer react@"^17.0.2 || ^18" from next-auth@4.24.10
npm ERR!   node_modules/next-auth
npm ERR!     next-auth@"^4.24.10" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

As with these dependency issue errors I was getting, which seems to be somewhat common with React these days (or maybe just most of web development!), I went about fixing it with the following steps.

First I removed the existing next-auth installation.

npm uninstall next-auth

Next I installed the beta version of next auth that supports Next.js 15 and React 19 (yes, I RTFMed (i.e. Read The Fucking Manual) a bit and read some other things to finally get to that conclusion).

Continue reading “The Confederacy of Errors Starting With Next Auth; Error, Error, npm ERR!”

Getting a Vercel PostgreSQL Database and Basic Authentication Operational

Quick links to all posts in the series and related at end of this post.

In the last post I’ve detailed getting started with setup of a basic React App using Next.js and deploying it to Vercel using their respective command line tooling. That post is Building “Adron’s Core Platform”: Starting a React App on Vercel.

Database Time – Getting a PostgreSQL Database

First, I setup the database in Vercel. Navigate to Storage.

Next I clicked on “Create” next to the Neon option.

The next prompt form will appear. I went with PostgreSQL (Neon) database, as shown, then the closest region (mine is Portland).

Continue reading “Getting a Vercel PostgreSQL Database and Basic Authentication Operational”