A database-driven e-commerce web application for video games. This platform enables users to browse titles, manage shopping carts, and place orders through simulated payment processing. It includes a comprehensive administration console for managing inventory, viewing stats, promoting user accounts, and managing game uploads.
-
Authentication & Authorization: Secure signup, login, and role-based access control (Customers vs. Administrators) with bcrypt password hashing and session management.
-
Registration Security: Enforced registration password constraints validated on both the frontend and backend:
- Length must be between 8 and 25 characters.
- Must contain at least one uppercase letter, one lowercase letter, one number, and one special symbol.
- Real-time password strength meter (Weak/Medium/Strong visual tracker) and confirm password matching validation on signup.
-
Game Catalog: Browsing, filtering, and responsive coming-soon catalogs.
-
Cart & Order Lifecycle: Real-time cart calculations, checkout processing, order logs, and simulated credit card validation.
-
Admin Console: Unified dashboard displaying key registration stats, product inventory controls (adding, editing, deleting items), and promotion of users to administrators.
-
Cloudinary Image Hosting: Integrated Cloudinary hosting for game images. Uploads are handled in the cloud instead of local directories:
- Automatic cleanup destroys old Cloudinary image assets when an administrator replaces a product image or deletes a product.
-
Security & Validation: Form validation, input sanitization, and Helmet-based security headers.
- Frontend: HTML5, Vanilla CSS, JavaScript (ES6), EJS templating.
- Backend: Node.js, Express.js.
- Database: Microsoft SQL Server (MSSQL) using the tedious driver.
- Cloud Storage: Cloudinary (Image uploads).
- Security: bcrypt password hashing, Express sessions, Helmet CSP headers.
- Node.js (v18.0.0 or later)
- Microsoft SQL Server instance
-
Clone the Repository:
git clone <repository-url> cd GamerZone
-
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.envfile in the root directory based on.env.exampleand supply your credentials:PORT=3000 SESSION_SECRET=your-session-secret-key # Database Configuration DB_SERVER=your-sql-server.database.windows.net DB_PORT=1433 DB_NAME=GameArena DB_USER=your_db_username DB_PASSWORD=your_db_password # Cloudinary Configuration CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Initialize the Database: Run the SQL scripts provided in the repository (
database/schema.sql) inside your SQL Server instance to create the necessary tables, relationships, and triggers. -
Start the Application:
npm start
Open
http://localhost:3000in your web browser.
The codebase contains a vercel.json configuration file to run Express.js as serverless functions.
- Install the Vercel CLI:
npm i -g vercel. - Link your project and deploy:
vercel. - Configure environment variables in the Vercel dashboard.
The application contains Web.config rules to run on IIS and Node.js on Azure.
- Connect your repository to Azure App Service deployment center.
- Define environment variables under Application Settings.
- Configure Azure SQL Database connection firewall rules.