Skip to content

Samiksha998/HelloWorld_WebApp

Repository files navigation

🚀 Multi-Module WebApp with Role-Based Access

A feature-rich web application with 3 independent modules (Category, Product, Admin) with role-based access control using SQLite.

📋 Features

  • Multi-Module Architecture: Category, Product, and Admin modules
  • User Authentication: Simple login/register system
  • Role-Based Access Control: User, Editor, Admin roles
  • SQLite Database: Persistent data storage
  • RESTful API: CRUD operations for all modules
  • Responsive UI: Modern, clean design

📦 Installation

1. Install Dependencies

npm install

2. Seed Database (Optional - Adds Test Data)

npm run seed

This creates:

  • Admin User: admin / admin123
  • Editor User: editor / editor123
  • Regular User: user / user123

3. Start the Application

npm start

Visit http://localhost:3000

🔑 User Roles & Permissions

👤 Regular User

  • View categories
  • View products
  • Browse dashboard

✏️ Editor

  • All User permissions
  • Create products
  • Edit own products

👨‍💼 Admin

  • All permissions
  • Manage users
  • Manage categories and products
  • Access admin dashboard

📊 Modules

1️⃣ Category Module (/categories)

  • View all categories
  • View category details with products
  • Create/Edit/Delete (Admin only)

2️⃣ Product Module (/products)

  • View all products with filtering
  • View product details
  • Create/Edit/Delete (Admin/Editor)

3️⃣ Admin Module (/admin)

  • Dashboard with statistics
  • User management (CRUD)
  • Category and product oversight

🗄️ Database

SQLite database with 3 main tables:

  • users: User accounts with roles
  • categories: Product categories
  • products: Product inventory

🚀 Quick Start

  1. Install: npm install
  2. Seed: npm run seed
  3. Run: npm start
  4. Visit: http://localhost:3000

📚 Tech Stack

  • Backend: Node.js, Express.js
  • Database: SQLite3
  • Frontend: EJS, HTML5, CSS3

📄 License

MIT

Project Structure

  • app.js - Node.js web application
  • package.json - Dependencies
  • Dockerfile - Container configuration
  • .github/workflows/ - CI/CD pipeline
  • gcp/ - GCP Cloud Run configs
  • azure/ - Azure App Service configs
  • scripts/ - Automation scripts

Deployment

GitHub Actions (Automatic)

  1. Push to main branch
  2. Workflow automatically deploys to both GCP and Azure

Manual Deployment

GCP:

gcloud run deploy helloworld-app --image gcr.io/PROJECT_ID/helloworld-app --platform managed --region us-central1 --allow-unauthenticated --port 8080

Azure:

az webapp create --resource-group helloworld-rg --plan helloworld-asp --name helloworld-app

Features

  • ✅ Multi-cloud deployment (GCP + Azure)
  • ✅ Automated CI/CD with GitHub Actions
  • ✅ Docker containerization
  • ✅ Security policies (IAM, network rules)
  • ✅ Autoscaling configuration
  • ✅ Comprehensive monitoring

Prerequisites

  • Node.js 18+
  • Docker
  • GCP project with billing enabled
  • Azure subscription
  • GitHub account

Security

  • npm audit checks for vulnerabilities
  • Service account credentials via GitHub Secrets
  • IAM role-based access control
  • Network security groups and firewall rules

Monitoring

Documentation

For detailed guides, see:

  • DEPLOYMENT-GUIDE.md - Step-by-step deployment
  • ARCHITECTURE.md - System design
  • SECURITY-AUTOSCALING.md - Advanced configuration

Cost

  • GCP Cloud Run: ~$5-20/month (low traffic)
  • Azure App Service: ~$10-40/month (low traffic)

Support

For issues or questions, check the troubleshooting section in the detailed guides or review GitHub Actions logs.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors