Student Lab Learning Workbook: Full Stack JavaScript Application with Express JS and SQLite
In this workbook, you will learn how to build a Full Stack JavaScript application using Express JS and SQLite. We will cover the basics of setting up the project, creating a web server with Express JS, and using forms with routing endpoints to transact data between the HTML FORM and the SQLite database.
When you click the Submit Button on the form:
<form action="will url link to your server with the routing end point specifed”
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
Table of Contents
Introduction
Setting Up the Project
Creating the Web Server with Express JS
Setting Up the SQLite Database
Creating Forms to Transact Data
Conclusion
1. Introduction
A Full Stack JavaScript application consists of a frontend (client) and a backend (server) that work together to provide a seamless user experience. In this workbook, we will use the following technologies:
Express JS: A minimal, unopinionated web application framework for Node.js that makes it easy to create a web server.
SQLite: A self-contained, serverless, zero-configuration, transactional SQL database engine that is easy to set up and use.
Later we will look at other back end data stores:
Firebase
MONGO: JSON
2. Setting Up the Project
Start by creating a new directory for your project and navigate to it:
mkdir fullstack-js-app && cd fullstack-js-app
Initialize a new Node.js project and install the required dependencies:
npm init -y
npminstall express body-parser sqlite3
3. Creating the Web Server with Express JS
Create a new file called app.js and set up the basic structure of an Express JS application:
In this workbook, you learned how to create a Full Stack JavaScript application using Express JS and SQLite. You set up a project, created a web server using Express JS, and used forms to transact data between the webpage and SQLite database.
You can now build upon this foundation to create more advanced applications, such as adding authentication, user management, and more complex business logic.
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (