Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gyanqui/webbackend-i-finalproject
CSE Motor is a university personal project for course CSE340 Web Backend Development I focus on MVC architecture
https://github.com/gyanqui/webbackend-i-finalproject
backend ejs javascript mvc-architecture
Last synced: 27 days ago
JSON representation
CSE Motor is a university personal project for course CSE340 Web Backend Development I focus on MVC architecture
- Host: GitHub
- URL: https://github.com/gyanqui/webbackend-i-finalproject
- Owner: gyanqui
- Created: 2024-06-29T15:22:14.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-24T06:06:26.000Z (5 months ago)
- Last Synced: 2024-11-28T19:13:24.123Z (27 days ago)
- Topics: backend, ejs, javascript, mvc-architecture
- Language: JavaScript
- Homepage: https://cse340-plt9.onrender.com/
- Size: 653 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Getting Started
This document is intended to get you started quickly in building a backend driven Node.js application complete with pages and content, backend logic and a PostgreSQL database for data storage.
## PrerequisitesThe only prerequisite software required to have installed at this point is Git for version control and a code editor - we will use VS Code (VSC).
## Package Management
The foundation of the project development software is Node. While functional, Node depends on "packages" to add functionality to accomplish common tasks. This requires a package manager. Three common managers are NPM (Node Package Manager), YARN, and PNPM. While all do the same thing, they do it slightly differently. We will use PNPM for two reasons: 1) All packages are stored on your computer only once and then symlinks (system links) are created from the package to the project as needed, 2) performance is increased meaning that when the project builds, it does so faster.
You will need to either install or activate PNPM before using it. See https://pnpm.io/## Install the Project Dependencies
1. Open the downloaded project folder (where this file is located) in VS Code (VSC).
2. Open the VSC terminal: Terminal > New Window.
3. Run the following command in the terminal:pnpm install
4. The first time it may take a few minutes, depending on the speed of your computer and the speed of your Internet connection. This command will instruct PNPM to read the package.json file and download and install the dependencies (packages) needed for the project. It will build a "node_modules" folder storing each dependency and its dependencies. It should also create a pnpm-lock.yaml file. This file should NEVER be altered by you. It is an internal file (think of it as an inventory) that PNPM uses to keep track of everything in the project.
## Start the Express Server
With the packages installed you're ready to run the initial test.
1. If the VSC terminal is still open use it. If it is closed, open it again using the same command as before.
2. Type the following command, then press Enter:pnpm run dev
3. If the command works, you should see the message "app listening on localhost:5500" in the console.
4. Open the package.json file.
5. Note the "Scripts" area? There is a line with the name of "dev", which tells the nodemon package to run the server.js file.
6. This is the command you just ran.
7. Open the server.js file.
8. Near the bottom you'll see two variables "Port" and "Host". The values for the variables are stored in the .env file.
9. These variables are used when the server starts on your local machine.## Move the demo file
When you installed Git and cloned the remote repository in week 1, you should have created a simple web page.
1. Find and move that simple web page to the public folder. Be sure to note its name.
## Test in a browser1. Go to http://localhost:5500 in a browser tab. Nothing should be visible as the server has not been setup to repond to that route.
2. Add "/filename.html" to the end of the URL (replacing filename with the name of the file you moved to the public folder).
3. You should see that page in the browser.