Introducing Nasaq, an application platform I’m building in Java.
My long-term vision is for Nasaq to become a free, open-source platform that developers can use to build different kinds of applications. I imagine a core CMS, an admin interface, a website builder, and a plugin system that lets developers extend it for their own projects.
Now that I’m writing this down, I’m realizing that it sounds a lot like WordPress. And, well, that’s not entirely wrong!
I’m still figuring out exactly what Nasaq will become, and I expect that vision to change as I build it. Eventually, I want it to be useful to other developers. Right now, I’m using the project to learn Java and work through the pieces of backend development more deliberately.
The source code is on GitHub:
Why I’m building Nasaq
I like learning by doing. Reading about something helps, but I usually understand it better once I have to use it, make a decision, and deal with what happens afterward.
That was the idea behind my idempotency example and small HTTP server in C. I took something I wanted to understand and built a small version that made the moving parts easier to see.
Nasaq gives me a project I can keep returning to. As I learn more, I can add to it, revisit an earlier decision, or find out why something that worked in a small example stops making sense as the project grows.
Having a larger idea gives the smaller exercises somewhere to go. An article class can eventually become part of a content system. Saving an article leads to questions about storage. Letting someone edit it brings up users and permissions.
I don’t need to solve all of that at once. I do want to understand how those pieces fit together.
Starting with Java
I’m learning Java from scratch through this project, so I’m starting with the basics: command-line arguments, classes, methods, collections, and handling invalid input.
There’s already plenty to think about at that level. Where should an article’s state live? What should the rest of the program be allowed to change? What happens when a command receives something it can’t use?
Those questions give me a reason to learn a feature and then use it in the same program. They also give me something concrete to come back to when I learn a better way of doing it.
What exists right now
The current version is a small command-line program. There’s no admin dashboard, website builder, or plugin system yet.
Most of the code lives in two files. Main.java handles commands, while Article.java represents an article with an ID, a title, a body, and a published state.
The program creates a few sample articles in memory. I can list them, find one by its ID, and publish one.
For example:
java Main publish 100prints:
Before publishing: false
After publishing: trueThe article’s publish() method changes its published state. That’s all this command does at the moment; it doesn’t put an article on a website.
There’s also no persistence yet. Each command starts a new program invocation and creates the sample articles again. If I publish article 100 and then run find 100 separately, that article will be unpublished again.
That’s a useful limit to notice. Changing an object in memory and saving that change for the next time the program runs are separate problems.
The platform I have in mind
The larger idea is to have a core that handles content, with an interface for managing it and a way to extend what the platform can do.
A website builder would make it easier to turn that content into pages. Plugins would let developers add functionality for a particular application, including things like e-commerce, without putting every feature into the core.
That’s the direction I have in mind, rather than a finished architecture. I still need to work out what belongs in the core, what an extension should be allowed to do, and how those parts should communicate.
Databases, serving requests, authentication, and permissions are also things I want to explore as the project develops. Each one is a substantial topic on its own, and I expect building with them to change some of my assumptions.
Keeping the learning visible
I want the repository to show how the project develops, including the small steps.
So far, that has meant going from an entry point to reading arguments, handling missing input, introducing an article model, managing several articles, and finding and publishing them by ID.
Some of those changes are small. They still matter to me because each one represents something I had to understand before moving on.
I also want to write about the decisions behind the code as I go. Explaining why I changed something is useful practice, and it gives me a chance to notice when I don’t understand it as clearly as I thought I did.
Trying the current version
You’ll need a JDK with javac and java available. If you’re setting up Java for the first time, there’s an official getting-started guide.
The current version can be compiled and run with:
git clone https://github.com/yousofabouhalawa/nasaq.git
cd nasaq
javac Main.java Article.java
java Main start
java Main find 100
java Main publish 100This is still an early learning project. The repository is there to follow along with, read, and experiment with as it grows.
There’s a lot between the version I have now and the platform I described at the start. I want these posts to show how I work through that gap, including the parts I get wrong.