Skip to content

sharanggupta/thiasil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THIASIL

A modern web application for a laboratory glass manufacturing business, built with Next.js, React, and Node.js. Hosted on Vercel, with Cloudflare for DNS routing.

Live site: https://www.thiasil.com/


Features

  • Product catalog with categories, images, and details
  • Admin panel for inventory, pricing, and coupon management
  • Product backup and restore system (using Redis)
  • PDF catalog generation
  • Contact form and company info
  • Responsive, modern UI with glassmorphism and neon effects
  • Authentication for admin actions

Tech Stack

  • Frontend: Next.js (App Router), React, Tailwind CSS
  • Backend: Node.js (API routes in Next.js)
  • Database: JSON files for products/coupons, Redis for backups
  • Deployment: Vercel
  • Other: Docker (for local Redis), Cloudflare (DNS)

Local Development Setup

1. Clone the repository

git clone https://github.com/sharanggupta/thiasil.git
cd thiasil

2. Install dependencies

npm install

3. Set up environment variables

⚠️ IMPORTANT SECURITY UPDATE: The application now uses secure password hashing.

Generate Admin Password Hash:

node scripts/generate-admin-hash.js YOUR_SECURE_PASSWORD

Create .env.local file:

ADMIN_USERNAME=admin
ADMIN_PASSWORD_HASH=<hash_from_above_command>
REDIS_URL=redis://localhost:6379

📚 For detailed security setup instructions, see SECURITY.md

4. Start Redis (via Docker)

docker-compose up -d

This will start a Redis container named thiasil-redis on port 6379.

5. Run the development server

npm run dev

Visit http://localhost:3000


Usage

Admin Panel

  • Visit /admin and log in with the credentials from .env.local.
  • Manage products, categories, inventory, and prices.
  • Create, delete, and manage coupons.
  • Backup and restore product data (uses Redis).
  • Reset products to default using the backup management tools.

Product Catalog

  • Browse products by category on the main site.
  • View product details, images, and features.
  • Download the PDF catalog.

Backups

  • All product/category changes trigger a backup in Redis.
  • Restore or reset data from the admin panel.

Project Structure

├── src/
│   ├── app/                # Next.js app directory (pages, API routes, components)
│   ├── data/                # JSON data files (products, coupons, defaults)
│   ├── lib/                 # Utility modules and custom React hooks
│   └── ...
├── public/                  # Static assets (images, PDF, etc.)
├── docker-compose.yml       # Docker config for Redis
├── README.md
└── ...

Environment Variables

  • ADMIN_USERNAME - Username for admin login
  • ADMIN_PASSWORD_HASH - Secure bcrypt hash of admin password (generate with script)
  • REDIS_URL - Redis connection string (default: redis://localhost:6379)

⚠️ Security Note: Never use ADMIN_PASSWORD (plain text). Always use ADMIN_PASSWORD_HASH.


Deployment Notes

  • Deployed on Vercel (see next.config.mjs for config)
  • Uses Vercel KV in production if available, otherwise local Redis
  • Cloudflare is used for DNS

Vercel Environment Variables Setup:

  1. In Vercel Dashboard → Project Settings → Environment Variables
  2. Add:
    • ADMIN_USERNAME: admin
    • ADMIN_PASSWORD_HASH: Use the hash generated by the script
  3. Deploy your application

📚 See SECURITY.md for complete deployment security guide.


Contributing

PRs and issues are welcome! Please open an issue for bugs or feature requests.


License

MIT

About

Website for Thia Glass Works

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5