This is a platform that allows users to register for membership in an organisation. It is built of top of a MYSQL Database, and has two main functionalities:
- Displaying the current membership count (SELECT statement)
- Registering new members (INSERT INTO statement)
The basic steps in building the app are as follows:
- Create a MYSQL Database, called "aiden_foundation" (aiden_foundation.sql)
- Create a table inside this database which we'll call "members". This table has five columns:
- id: the index/primary key
- first_name: members's first name
- last_name: members's last name
- profession: members's profession
- created_at: date of registration
- Generate random data and insert into the table ("generate_random_data.js"). This is has been done using javascript using the faker(for random data generation) and msyql(to connect to MySQL) packages
- Create our main javasacript file -app.js-, an EJS file -./views/home.ejs- (which is just HTML file that allows us to right javascript codes) and CSS file -./public/app.css- for styling. Switch the view engine in our main js ile to EJS template
- Create two route inside our main js file:
- GET route to execute the SELECT statement to display the total nummber of members.
- POST route to execute the INSERT INTO statement
- Link the js file to the ejs