June 29 2023

Yesterday I received this question:

“Do you mind sharing what is Forml0gic.com that you are building? It looks appealing “
2:50 PM · Jun 27, 2023 submitted by @Bobbyy_18

I’ve been thinking about this question more. I have concluded that it may be a good idea to narrow down the focus for the time being.
If I were to re-answer this question today it would be:

Currently Formlogic is simply a form building and data analytics app. There is a broader scope to what we have in mind but for now that is the focus.

Features for standard users:
We have an intuitive form builder right on the landing page that visitors can use to build forms immediately without having to sign up for an account. Just add an email where you want to receive the form submissions and copy the URL in the share link to share your form.
If you want to edit the form, create additional forms and view analytics you can click the create password link in any of the emails you get with the form data. That will set you up with a verified account where you can access the main form builder, all of your forms & your form share links. If you would like to embed a form on your website, you can copy the html code in the code area at the bottom of the form builder and paste that into your website.

For Developers:
Formlogic uses a dynamic routing feature that allows developers to add our route to their existing forms that are hosted on external sites. We do this through the generation of a unique token that is added to the form’s action attribute like this:

      <form class="formClass" id="submitForm" action="https://forml0gic.com/submit-public-form/6VZNYAHQgD" method="POST">
        <!-- Add your form fields here -->

This route token is generated automatically during the new account creation process and is available under our free tier.
Users can set Access Control to this submission route to ensure only the sites in the ACL list are allowed to submit data. Additionally, users can add a redirect URL so that once a form is submitted the page redirects to a success page that can be hosted on your site. There is no need for your users to ever leave your site when submitting data through our servers.
Users can also add multiple emails to receive form submission notifications that include the data directly in the email so nobody on your team has to login to our site to view the form data. In addition to that, if the form includes an email input for the individual filling out the form a copy of the completed form will also be sent to them as a form submission confirmation.
In our user-portal you can view a variety of analytics about the forms that are submitted, and tailor the graphs to show visualizations of what is most important to you.
All of these features are due for public release in December 2023.

June 9 2023

Today I got the app to automatically generate unique database tables for each user, this allows each user to store unique configurations, data and be able to import and export.
Here is an overview of where the code is so far, provided by ChatGPT:
The provided code is an implementation of an Express.js server with various routes and functionalities. Here is an overview of what the code does:
1- Imports necessary modules and libraries: The code imports several modules and libraries required for the server, such as Express.js, PostgreSQL (pg), bcrypt, multer, nodemailer, session, passport, LocalStrategy, and dotenv.
2- Sets up email transporter: Nodemailer is configured with the necessary settings for sending emails, such as using the "sendmail" command.
3- Loads environment variables: The code uses the dotenv package to load environment variables from a .env file.
4- Initializes session and passport middleware: The code initializes the session middleware for login and authentication functionality. It also initializes Passport and configures it to use the LocalStrategy for authentication.
5- Defines Passport strategies: Passport is configured with a LocalStrategy that checks the email and password against the users stored in a PostgreSQL database. If the credentials are valid, the user object is returned.
6- Sets up body parser and multer: The code sets up body parser middleware to parse incoming request bodies, and multer middleware for handling file uploads.
7- Connects to the PostgreSQL database: A connection is established to the PostgreSQL database using the provided environment variables.
8- Serves static files: The code serves CSS files and HTML files located in the "public" directory.
9- Defines routes for user signup and verification: The code defines routes for user signup and verification. When a user signs up, their information is stored in the database. An email verification link is sent to the user's email address. Upon verification, a default user table is created for the user.
10- Defines routes for user login and authentication: The code defines routes for user login and authentication. When a user logs in, Passport authenticates the credentials using the LocalStrategy. If the login is successful, the user is redirected to the user portal.
11- Defines a middleware for protecting routes: An "authenticate" middleware function is defined to protect certain routes. It checks if a user is authenticated using Passport's isAuthenticated method. If not authenticated, the user is redirected to the login page.
12- Defines protected routes: The code defines several routes that are only accessible to logged-in users. These routes serve HTML pages for analytics, user forms, and data.
13- Implements password reset functionality: The code provides password reset functionality. It includes routes for requesting a password reset, verifying the reset token, and resetting the password. Emails are sent to the user's email address with reset instructions.
14- Defines routes for password reset pages: The code defines routes for serving HTML pages related to password reset, such as the password reset form and success pages.
15- Starts the server: The code starts the Express.js server, listening on port 3006.

Overall, this code sets up an Express.js server with user authentication, email verification, file upload, and password reset functionalities using various middleware, libraries, and a PostgreSQL database.

June 7 2023

Development today:
This morning I was staring into the abyss that is the daunting task that lies before me. Right now I'm building the "Dynamic Form Builder" which allows users to create customized forms dynamically within the express.js application architecture.
I found a strategy to use with this project and I thought that maybe I should document in a little more detail what my methodology is. The Idea is to take a large concept like what I envision the end product to be, look at where I am, and find a way to move forward despite the feeling of futility that I'm struggling with. There is so much that needs to be in place before the end result can be realized & if I'm going to succeed I have to contend with this. My strategy is to just build it through incrementalism, to focus on building one block at a time starting with the base architecture.
So what have I done so far and what do I plan to do next?
I began development on Forml0gic.com on May 5th 2023. I had just concluded with my "thesis project" so to speak for my second 100 Days of Code Challenge. That project is called Springb0ard and the primary objective was to develop a cloud server initialization script that would get a brand new server ready for production within minutes. A key feature if this script was the installer/configurator for a Postfix + Dovecot email server. This email server would be a core component of my next project which is Formlogic.
The original Idea for Formlogic was to choose a proven market that has a track record for generating revenue. Instead of trying to develop some brand new concept nobody has done before which seems to be what many people in tech are trying to do I wanted to choose an existing market and make some positive change to it that would add value. Starting with forms and moving into improving a niche of that market is what I intend to do, but first things first. I have to be able to build the architecture to produce at least basic forms dynamically.
In May when I began development on Formlogic I had the email server and the web server up but I had no Idea how to handle forms other than some experimentation I had done with PHP. Now many may wonder why I decided to build something like this from scratch why not use wordpress or some other framework? I guess my response to that is, I am using this as an opportunity to deep dive into what makes it all tick and I thought I would get a more profound understanding like this then to try and make this the so called "fast way". Even If I made this app using React.js or something I would still deal with similar issues but I would have less of an understanding about the basics of the plumbing of an application like this. After consulting with ChatGPT about what it would take to develop a web application like the one I had in mind I decided to go with Express.js because I wanted to use Node.js rather than PHP to handle the back end processing of form data etc. I had just finished a basic javascript course with free code camp and wanted to use javascript on the frontend as well as the backend so there would be a common language interaction between the two. Express.js is written in regular or "vanilla" javascript which would also allow me to focus on the fundamentals of the language rather than compound my learning curve by adding more complexity to an already complex programming language.
From May 5th to May 25th I focused on implementing an express application, using it to create user password protected pages/routes and started the CSS design for my dynamic form. From May 26th to June 6th I focused on the CSS styling of the site, using dynamic charts (Apache eCharts), implementing password reset by email & initiating email generation using Node & Express.js to interact with the Postfix + Dovecot email server.
Yesterday & today I returned to the dynamic form concept which, for frame of reference is basically what is used in wordpress, google forms and microsoft forms. Although this is a standard drag and drop style design, for me it's very complicated because I have to build it from scratch unless I find another way to create this. Either way I will still need to get data into the database and have it specific to an individual user. Thinking about this problem is where I decided to break things down into the nano level and ask chatGPT very simple straightforward questions.
After consulting with chatGPT I found a starting place with this by focusing on the basics of users and their interactions with the database. currently when a user logs in they are basically granted access to pages within the authentication wall. There is no way for them to do anything to make or see anything unique. Over the last few days I have been dealing with the password reset process for users that lost or forgot their passwords. During that development I was introduced to the concept of token based identity. What this is, is when a user request a password reset the system produces a unique token and attaches it to a password reset form URL that's sent to the user's email and expires after a few minutes. when the user clicks the link they return to a special protected form on the site and the URL contains a token to signal to the system that the user obtained the link through the same email/username that the original password was tied to. the new password is then entered into the form and when the submit button is pressed the system extracts the token from the URL and cross references it with the one that was generated and stored in the users database then checks to make sure it matches and is within the expiration time tied to the token. This token in the URL thing, this seems to be a good way to tie a user to an ID in the database. So that's where I'm at now, my next step is to generate a unique token and tie it to the user as they navigate the site, when they come into the dashboard it recognizes the user and generates the environment variables That are specific to that user. When the user interacts with the form we are creating to make another form, all the data goes into their own tables in the database and are protected by the authentication system.
In closing for today, the key to moving forward is through incrementalism, adding one piece of the puzzle together at a time, looking on the nano level and building simplified models of what the larger model will contain. Later we stack them together.

Today, I created this no BS blog page because I wasn't happy with what was out there, and I'm a web developer so why not just make what I want to use?