Skip to content

ashrees/Assignment4-WEB322

Repository files navigation

WEB322 Assignment-6

This web application is built for WEB322 Assignment-6, evolving from previous assignments with enhanced features including authentication, database integration, and CRUD operations for National Historic Sites of Canada.

Features

  • User Authentication

    • User registration with secure password hashing
    • Login/logout functionality
    • User login history tracking
    • Session management
  • National Historic Sites Management

    • View all sites with pagination
    • Filter sites by region and province/territory
    • View detailed information for individual sites
    • Add new sites (authenticated users)
    • Edit existing sites (authenticated users)
    • Delete sites (authenticated users)
  • Error Handling

    • Custom 404 page for resources not found
    • Custom 500 page for server errors

Tech Stack

Frontend

  • EJS - Templating engine for generating HTML with JavaScript
  • TailwindCSS - Utility-first CSS framework
  • DaisyUI - Component library for TailwindCSS

Backend

  • Node.js - JavaScript runtime environment
  • Express - Web application framework
  • client-sessions - Session management middleware

Database

  • PostgreSQL - Relational database
  • Sequelize - ORM for PostgreSQL
  • MongoDB - NoSQL database (via Mongoose)

Authentication

  • bcryptjs - Password hashing library

Dependencies

Production Dependencies

  • @tailwindcss/typography (^0.5.16) - Typography plugin for TailwindCSS
  • bcryptjs (^3.0.2) - Library for hashing passwords
  • client-sessions (^0.8.0) - Secure client-side sessions
  • daisyui (^4.12.23) - Tailwind CSS component library
  • dotenv (^16.4.7) - Environment variable management
  • ejs (^3.1.10) - Embedded JavaScript templates
  • express (^4.21.2) - Web framework for Node.js
  • mongoose (^8.13.2) - MongoDB object modeling
  • pg (^8.14.1) - PostgreSQL client
  • pg-hstore (^2.3.4) - Serializing and deserializing JSON data to hstore format
  • sequelize (^6.37.6) - Promise-based ORM for PostgreSQL

Development Dependencies

  • tailwindcss (^3.4.17) - Utility-first CSS framework

Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)
  • PostgreSQL database
  • MongoDB database

Clone the Repository

git clone https://github.com/ashrees/Assignment6-Ashish.git
cd Assignment6-Ashish

Environment Setup

Create a .env file in the root directory with the following variables:

SESSION_SECRET=your_session_secret
POSTGRES_DB_URL=your_postgres_connection_string
MONGODB_URL=your_mongodb_connection_string

Install Dependencies

npm install

Running the Application

Start the Server

npm run start

Build TailwindCSS (in a separate terminal)

npm run tw:build

The application will be available at http://localhost:8080

Deployment

This application is deployed on Vercel and can be accessed at: https://assignment4-web-322-git-main-ashrees-projects.vercel.app/

Author

  • Ashish Shrees

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors