After participating in the CodeNewbie Challange, I decided to create something similar to a census web app during my coding journey.
This app will be a vey general census web app in which you can create multiple census for different purposes. This will also use the local file system for data storage which I will explain the reason later on.
I named it Acme Census Program because:
- It's for fun, hence the word "Acme"
- Since it is used to keep record of things I just name it "census".
This program is written in Perl, utilising the old school CGI technology and served by the Apache2 program running on Linux (Debian). I'm also using the HTML::Template module so that the frontend and backend codes can be separated. Most of the stuff are coded from scratch but I'm using Bootstrap for the styling.
For whatever reason, I couldn't make Apache run as root user on my device. Initially it was running as the 'www-data' user but I couldn't make sense out of it so I configured it to run as me. This means that all the files ie census data will be saved into my profile's file system and I can make changes to them however I wish without root previlege. Later on I found that this "problem" actually allows me to code the whole thing in a cool way which I never thought before.
The web app will process data and save the state into my local file system as YAML format. If someone is also running the same web app on another device, my data can be ported to the other person's device and the data can be accessd there. It's like saying moving the data of a program eg. game from one computer to another computer and everything will still work :)
I also tried my best to make sure UTF-8 characters are displayed correctly.
The codes are uploaded to GitHub and more details can be found there
Below are some screenshots of the program. To be honest, I haven't put much thought on the colour scheme yet :)
When there are no census data ie no related directory found, you'll see this:
This is what you'll see when the census data directories exist:
The next thing will be making the blue and green buttons work. The blue button will allow the user to create a new census while the green buttons will let the user access the corresponding census data which I'll probably leave it for next week :)
Oldest comments (0)