A full-stack single page application that allows learners to save learning resources in a central place that is publicly available to any user. This application was built using jQuery, NodeJS, Express, and PostgreSQL database.
This is one of the group projects for the Web Development Bootcamp at Lighthouse Labs. The group members are @navara99 and @scc416.
This project is deployed to Heroku:
https://the-resource-wall.herokuapp.com/
It might take some time to load up the server.
- Display all the resources
- Users can like any resource
- Display screenshot/embed video uploaded by the user
- Display resource details such as title, description, owner's username, date added, rating, number of likes and comments
- Users can view resources by category
- Users can search for already-saved resources created by any user
- Users can save an external URL along with a title and description
- Users can make resource public/private
- Users can categorize resource under a topic
- Users can upload an image as thumbnail
- If there the user does not upload a thumbnail, a screenshot of the website will be used
- Display details such as title, desciption, owner's username, added date, rating, list of comments, number of likes, ratings and comments,
- Users can comment/rate/like on any resources
- Users can enter user's page by clicking owner/comment
- Users can view all their own and all liked resources on one page (with filter)
- Owner can edit/delete resource
- Users can view user's details (Profile picture, username, bio, full name, created resources)
- Users can login with email/username and password
- Users can logout
- Users can regsiter with email (unique), password (enter twice) , username (unique)
- Users can update their profile (email, username, bio, first name, last name, link for profile picture)
- Users can change their password
- If there is any errors, it is shown on the top of the page under nav bar
- History.js is used to managed the history of this single page app
- Create the
.env
by using.env.example
as a reference:cp .env.example .env
- Update the .env file with your correct local information
The file has to include your ownIFRAME_KEY
(from Iframely) andAPIKEY
(from Screenshot Machine). Both of them are free. - Install dependencies:
npm i
- Fix to binaries for sass:
npm rebuild node-sass
- Reset database:
npm run db:reset
-
Use the
npm run db:reset
command each time there is a change to the database schema or seeds.- It runs through each of the files, in order, and executes them against the database.
- Note: you will lose all newly created (test) data each time this is run, since the schema files will tend to
DROP
the tables and recreate them.
-
Check the db folder to see what gets created and seeded in the SDB
- Run the server:
npm run local
- Note: nodemon is used, so you should not have to restart your server
- Visit
http://localhost:8080/
- jQuery: Used for DOM manipulation
- history.js: To manage browser history
- Materialize: A front-end library based on Google's material design
- timeago: To convert javascript timestamps to a user friendly format
- express: Provide server side logic
- ejs: Embedded JavaScript (EJS) templating language
- PG 6.x: PostgreSQL client for Node.js
- sass: Preprocessor scripting language that compiles into CSS
- axios: To make API requests to the back-end
- bcryptjs: A library to help hash passwords
- cookie-session: Used to save the user session
- chalk: Used to style string in the terminal
- dotenv: Used to load variables from .env files
- morgan: HTTP request logger middleware for node.js
- multer: Used to allow users to upload thumbnails
- valid-url: To check if the url entered by user is a valid url
📦resource-wall ┣ 📂.git ┣ 📂db ┃ ┣ 📂schema ┃ ┣ 📂seeds ┃ ┗ 📜query-helpers.js ┣ 📂docs ┣ 📂lib ┃ ┣ 📜db.js ┃ ┗ 📜sass-middleware.js ┣ 📂public ┃ ┣ 📂images ┃ ┃ ┗ 📜favicons.png ┃ ┣ 📂scripts ┃ ┃ ┣ 📂components ┃ ┃ ┃ ┣ 📂resource-details ┃ ┃ ┃ ┃ ┣ 📂helpers ┃ ┃ ┃ ┃ ┃ ┣ 📜comment.js ┃ ┃ ┃ ┃ ┃ ┣ 📜like.js ┃ ┃ ┃ ┃ ┃ ┗ 📜rating.js ┃ ┃ ┃ ┃ ┗ 📜main.js ┃ ┃ ┃ ┣ 📜edit-resource.js ┃ ┃ ┃ ┣ 📜error.js ┃ ┃ ┃ ┣ 📜header.js ┃ ┃ ┃ ┣ 📜home.js ┃ ┃ ┃ ┣ 📜login.js ┃ ┃ ┃ ┣ 📜my-resources.js ┃ ┃ ┃ ┣ 📜new-resource.js ┃ ┃ ┃ ┣ 📜profile.js ┃ ┃ ┃ ┣ 📜register.js ┃ ┃ ┃ ┗ 📜user-page.js ┃ ┃ ┣ 📜constants.js ┃ ┃ ┣ 📜network.js ┃ ┃ ┗ 📜view.js ┃ ┣ 📂styles ┃ ┃ ┣ 📜layout.css ┃ ┃ ┗ 📜main.css ┃ ┣ 📂uploads ┃ ┃ ┗ 📜.gitkeep ┃ ┗ 📂vendor ┃ ┃ ┣ 📜border-box.css ┃ ┃ ┣ 📜jquery-3.0.0.js ┃ ┃ ┗ 📜normalize-4.1.1.css ┣ 📂routes ┃ ┣ 📂json ┃ ┃ ┗ 📜providers.json ┃ ┣ 📂routeHelpers ┃ ┃ ┗ 📜mediaHelpers.js ┃ ┣ 📜resources.js ┃ ┗ 📜users.js ┣ 📂styles ┃ ┣ 📜error.scss ┃ ┣ 📜home.scss ┃ ┣ 📜layout.scss ┃ ┣ 📜main.scss ┃ ┣ 📜my-resources.scss ┃ ┣ 📜nav.scss ┃ ┣ 📜new-resource.scss ┃ ┣ 📜resource-details.scss ┃ ┗ 📜user-page.scss ┣ 📂views ┃ ┣ 📂my-resources ┃ ┃ ┣ 📜change-password.ejs ┃ ┃ ┣ 📜edit-resource.ejs ┃ ┃ ┣ 📜main.ejs ┃ ┃ ┣ 📜my-resources.ejs ┃ ┃ ┗ 📜update-profile.ejs ┃ ┣ 📜error.ejs ┃ ┣ 📜index.ejs ┃ ┣ 📜login.ejs ┃ ┣ 📜nav.ejs ┃ ┣ 📜new-resource.ejs ┃ ┣ 📜register.ejs ┃ ┣ 📜resource-details.ejs ┃ ┣ 📜resources.ejs ┃ ┣ 📜scripts.ejs ┃ ┣ 📜stylesheet.ejs ┃ ┣ 📜tabs.ejs ┃ ┗ 📜user-page.ejs ┣ 📜.editorconfig ┣ 📜.env.example ┣ 📜.eslintrc.json ┣ 📜.gitignore ┣ 📜README.md ┣ 📜package-lock.json ┣ 📜package.json ┗ 📜server.js
Contain sql files that created tables.
Contain sql files with dumb data.
Contains the functions that interact with the database.
Contain images for README.md
.
Contains the favicons.
Contains the javascript files for manipulating the front end.
Contains the css files that is compiled from the scss files.
Contains only a file .gitkeep
. This folder is where the uploaded thumbnails will be saved.
Contains a file providers.json
, which includes the oembed details for generating resources' media_url
.
Contains mediaHelpers.js
. The file has functions that generate media_url
from providers.json
and API of Screenshot Machine.
Contains route of the servers that interact with the resources
, likes
, comments
and ratings
tables in the database.
Contains route of the servers that interact with the users
table in the database.
Contains scss files that are compiled into css files.
Contains the ejs files.
Reference for creating .env
.
Contains files that are ignored by git
.
The document that you are reading.
This file contains:
- dependencies: node libraries that the code needs
- dev-dependencies: node libraries only needed by development tools
- scripts: Define the in-project shortcut commands
The main file where the server is defined.
The database consists of 6 tables:
- users
- resources
- categories
- likes
- comments
- ratings
- Favicons made by I Wayan Wika from www.flaticon.com, modified by @scc416