PS Dev Blog

Latest News

Working on Next.JS Project

Working more with Next.JS and appDir folder structure. Framework is solid, some of the features are beta.

Found pages/api is easier for certain routes.

Lots to learn still.

The project is mostly a template that I expect to use in the future to deploy full sites with authentication.

Updated to Gatsby 5.0

Dreaded this day but finally updated to Gatsby 5.0. The update went smoother than expected. Trying to get back into coding more since start of the year.

Recursive JS: Tower Of Hanoi

Sample tower of hanoi code snippet using recursion. Based on Recursion 'Super Power' (in Python) - Computerphile

const hanoi = () => {
	const a = { name: 'fir', discs: [4, 3, 2, 1] };
	const b = { name: 'sec', discs: [] };
	const c = { name: 'thi', discs: [] };
	let moves = 0;
	function move(items, from, to, helper) {
		console.log(items, from.name, to.name, helper.name);
		if (items === 0) return;
		move(items - 1, from, helper, to);
		++moves;
		to.discs.push(from.discs.pop());
		console.log(items, moves.toString() + ': ', a.discs, b.discs, c.discs);
		move(items - 1, helper, to, from);
	}
	move(a.discs.length, a, c, b);
	console.log(a, b, c);
};

Tailwind CSS?

Been hearing more and more good things about Tailwind CSS. I think I will give it a try in the next few days, possibly restyling this blog. Right now I been using custom SASS with a rough BEM class naming convention.

I think it has worked well, but with Tailwind CSS the look may be more modern and may reduce design complexity for the blog.


After thinking about it, for this project, I will stay with custom SASS/CSS styling. For more general projects I may start with Tailwind CSS.

I will use custom SASS/CSS for more design freedom. Even if the design choices may be bad sometimes, they should allow the site to become more unique over time. It may eventually become more than just a blog with tutorials, videos, code, and varius apps integrated.

Server Side Node Packages

ExpressJS

Server side framework that is very popular and well documented. Development appears to be limited currently with no commits as of 10/2019 in the v5 alpha branch.

Fastify

Alternative to ExpressJS - Appears to be in very active development as of 2/2020

An efficient server implies a lower cost of the infrastructure, a better responsiveness under load and happy users. How can you efficiently handle the resources of your server, knowing that you are serving the highest number of requests as possible, without sacrificing security validations and handy development?

Enter Fastify. Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express and as far as we know, it is one of the fastest web frameworks in town.

NestJS

Provides TypeScript support with decorators for creating API routes. Can be used with ExpressJS and Fastify.

"Nest (NestJS) is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with and fully supports TypeScript (yet still enables developers to code in pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).

Under the hood, Nest makes use of robust HTTP Server frameworks like Express (the default) and optionally can be configured to use Fastify as well!"

OneGraph GraphQl API

GraphQL API for connecting to 3rd party services.

OneGraph Link to Home Page

Random LinkFinance App
© 2023 by Peter Sowa (devspeter), Built with Gatsby