Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐Ÿ›’ Tronixy

Full Stack Electronics E-Commerce Platform


Node.js Express MongoDB JavaScript Cloudinary


Your one-stop destination for electronics & tech accessories โ€” Built in India ๐Ÿ‡ฎ๐Ÿ‡ณ


Live Demo Report Bug GitHub



๐Ÿ“– About

Tronixy is a production-ready full stack e-commerce web application focused on electronics and tech accessories. Built with Node.js, Express, and MongoDB on the backend and pure HTML, Tailwind CSS, and Vanilla JavaScript on the frontend โ€” no React, no build step, zero client-side dependencies.

The platform features a Rule-Based Recommendation System that suggests relevant products based on category and price range, a complete shopping experience with cart management, JWT-based authentication, Cloudinary image storage, and a full Admin Panel for managing products, orders, and categories.


โœจ Features

๐Ÿ›๏ธ User Features
Feature Description
๐Ÿ” Product Search & Filtering Search by keyword, filter by category
๐Ÿค– Smart Recommendations Rule-based suggestions by category & price proximity (ยฑโ‚น9000)
โญ Reviews & Ratings Logged-in users can submit reviews and star ratings
๐Ÿ›’ Shopping Cart Add, remove, update quantities โ€” persisted in localStorage
๐Ÿ’ณ Checkout Shipping info, COD or Online payment, automatic GST calculation
๐Ÿ“ฆ Order Tracking Full order history with live status (Processing โ†’ Shipped โ†’ Delivered)
๐Ÿ” Authentication Register, Login, Logout with JWT + bcrypt security
๐Ÿ‘ค User Profile View personal info, address, and account details
๐Ÿ“ฑ Responsive Design Optimised for both desktop and mobile
โš™๏ธ Admin Features
Feature Description
๐Ÿ“ Product Management Create, edit, delete products with Cloudinary image uploads
๐Ÿšš Order Management View all orders, advance order status with one click
๐Ÿ—‚๏ธ Category Management Full CRUD for categories with automatic product relinking on delete
๐Ÿ“Š Dashboard Stats Live count of products, orders, categories, and total revenue

๐Ÿ—๏ธ Project Structure

Tronixy/
โ”œโ”€โ”€ client/                          # Frontend โ€” HTML, Tailwind CSS, Vanilla JS
โ”‚   โ”œโ”€โ”€ index.html                   # Entry point โ€” redirects to home
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ”œโ”€โ”€ api.js                   # Core: fetch wrapper, Auth, Cart, Toast, TokenStore
โ”‚   โ”‚   โ””โ”€โ”€ nav.js                   # Shared navbar component loaded by every page
โ”‚   โ””โ”€โ”€ pages/
โ”‚       โ”œโ”€โ”€ home.html                # Landing page โ€” hero, search, products grid, footer
โ”‚       โ”œโ”€โ”€ login.html               # JWT login
โ”‚       โ”œโ”€โ”€ register.html            # User registration (7 fields)
โ”‚       โ”œโ”€โ”€ product.html             # Product detail, image gallery, reviews, recommendations
โ”‚       โ”œโ”€โ”€ cart.html                # Cart management
โ”‚       โ”œโ”€โ”€ checkout.html            # Shipping info + COD/Online payment
โ”‚       โ”œโ”€โ”€ my-orders.html           # Order history
โ”‚       โ”œโ”€โ”€ order-detail.html        # Single order breakdown
โ”‚       โ”œโ”€โ”€ profile.html             # User info display
โ”‚       โ””โ”€โ”€ admin/
โ”‚           โ”œโ”€โ”€ dashboard.html       # Admin stats overview
โ”‚           โ”œโ”€โ”€ products.html        # Product CRUD + image upload
โ”‚           โ”œโ”€โ”€ orders.html          # All orders + status management
โ”‚           โ””โ”€โ”€ categories.html      # Category CRUD
โ”‚
โ”œโ”€โ”€ server/                          # Backend โ€” Node.js / Express
โ”‚   โ”œโ”€โ”€ server.js                    # Entry point โ€” Express app, middleware, routes
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ db.js                    # MongoDB connection via Mongoose
โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”œโ”€โ”€ userController.js        # Auth: register, login, logout, profile, update
โ”‚   โ”‚   โ”œโ”€โ”€ productController.js     # Products: CRUD, search, reviews, recommendations
โ”‚   โ”‚   โ”œโ”€โ”€ orderController.js       # Orders: create, my-orders, payments, admin management
โ”‚   โ”‚   โ””โ”€โ”€ categoryController.js   # Category: create, get all, update, delete
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ userModel.js             # User schema โ€” bcrypt pre-save hook + JWT methods
โ”‚   โ”‚   โ”œโ”€โ”€ productModel.js          # Product schema โ€” embedded reviews sub-document
โ”‚   โ”‚   โ”œโ”€โ”€ orderModel.js            # Order schema โ€” status enum + delivery tracking
โ”‚   โ”‚   โ””โ”€โ”€ categoryModel.js         # Category schema
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ userRoutes.js            # /api/v1/user
โ”‚   โ”‚   โ”œโ”€โ”€ productRoutes.js         # /api/v1/product
โ”‚   โ”‚   โ”œโ”€โ”€ orderRoutes.js           # /api/v1/order
โ”‚   โ”‚   โ”œโ”€โ”€ categoryRoutes.js        # /api/v1/cat
โ”‚   โ”‚   โ””โ”€โ”€ testRoutes.js            # /api/v1/test
โ”‚   โ”œโ”€โ”€ middlewares/
โ”‚   โ”‚   โ”œโ”€โ”€ authMiddleware.js        # isAuth + isAdmin JWT middleware
โ”‚   โ”‚   โ””โ”€โ”€ multer.js                # Multer memory storage for file uploads
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ features.js              # getDataUri โ€” converts file buffer to base64 data URI
โ”‚
โ”œโ”€โ”€ .vscode/
โ”‚   โ””โ”€โ”€ settings.json                # Live Server root config
โ””โ”€โ”€ .gitignore

๐Ÿ”ง Tech Stack

Layer Technology Purpose
Frontend HTML5, Tailwind CSS, Vanilla JS UI, routing, state management
Backend Node.js, Express.js REST API server
Database MongoDB, Mongoose Data persistence and ODM
Authentication JWT, bcryptjs Secure login + password hashing
Image Storage Cloudinary CDN image upload and delivery
File Uploads Multer Multipart form data parsing
Payments Stripe Payment intent creation
Version Control Git & GitHub Source control
Deployment Render (Backend) / Vercel (Frontend) Dynamic & static file hosting

๐Ÿ” Authentication & Security

Tronixy uses a dual-token strategy for maximum browser compatibility:

  1. Server side โ€” JWT token set as an HTTP-only cookie on login response
  2. Client side โ€” Token also stored in localStorage and sent via Authorization: Bearer header on every request

The isAuth middleware reads from the cookie first, falls back to the Authorization header, then verifies using JWT.verify(). Protected admin routes additionally pass through isAdmin which checks req.user.role === "admin".

๐Ÿ”’ Passwords are never stored in plain text โ€” a Mongoose pre-save hook runs bcrypt.hash() with 10 salt rounds automatically before every user save operation.


๐Ÿ“ก API Reference

๐Ÿ‘ค User Routes โ€” /api/v1/user
Method Endpoint Auth Description
POST /register Public Create new user account
POST /login Public Login and receive JWT token
GET /profile ๐Ÿ”’ User Get logged-in user profile
GET /logout ๐Ÿ”’ User Clear cookie and end session
PUT /profile-update ๐Ÿ”’ User Update user info (name, address, city, country, phone)
PUT /update-password ๐Ÿ”’ User Change password with old password verification
PUT /update-picture ๐Ÿ”’ User Upload profile picture to Cloudinary
๐Ÿ“ฆ Product Routes โ€” /api/v1/product
Method Endpoint Auth Description
GET / Public Get all products (with category populated)
GET /search?keyword= Public Search products by name (MongoDB regex)
GET /:id Public Single product detail
GET /recommend/:id Public Similar products by category + price range (ยฑโ‚น9000)
POST /create ๐Ÿ”’ Admin Create product with Cloudinary image upload
PUT /:id ๐Ÿ”’ Admin Update product details
PUT /image/:id ๐Ÿ”’ Admin Add extra image to existing product
DELETE /image/:id?id= ๐Ÿ”’ Admin Delete specific product image from Cloudinary
DELETE /delete/:id ๐Ÿ”’ Admin Delete product and all its Cloudinary images
PUT /:id/review ๐Ÿ”’ User Submit review โ€” recalculates average rating
๐Ÿšš Order Routes โ€” /api/v1/order
Method Endpoint Auth Description
POST /create ๐Ÿ”’ User Place order + auto-decrement product stock
GET /my-orders ๐Ÿ”’ User Get all orders for logged-in user
GET /my-orders/:id ๐Ÿ”’ User Single order detail
POST /payments ๐Ÿ”’ User Create Stripe payment intent
GET /admin/get-all-orders ๐Ÿ”’ Admin All orders from all users
PUT /admin/order/:id ๐Ÿ”’ Admin Advance order status (processing โ†’ shipped โ†’ delivered)
๐Ÿ—‚๏ธ Category Routes โ€” /api/v1/cat
Method Endpoint Auth Description
POST /create ๐Ÿ”’ Admin Create new category
GET /get-all Public Get all categories
PUT /update/:id ๐Ÿ”’ Admin Rename category
DELETE /delete/:id ๐Ÿ”’ Admin Delete category and unlink from all products

๐Ÿš€ Getting Started

Prerequisites

Before you begin, make sure you have the following:

Installation

1. Clone the repository

git clone https://github.com/Devo-Hacker/Tronixy.git
cd Tronixy

2. Install server dependencies

cd server
npm install

3. Configure environment variables

Create a .env file inside the server/ folder:

PORT=8080
NODE_ENV=development
MONGO_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
CLOUDINARY_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET=your_cloudinary_api_secret
STRIPE_API_SECRET=your_stripe_secret_key

4. Start the backend server

nodemon server.js

Server will run at http://localhost:8080

5. Configure Live Server for frontend

Add this to .vscode/settings.json in the root:

{
  "liveServer.settings.root": "/client"
}

6. Open the frontend

Right-click client/index.html โ†’ Open with Live Server

The app will open at http://127.0.0.1:5500/pages/home.html


๐Ÿ’ก Frontend Architecture

The frontend uses zero client-side dependencies โ€” no React, no Vue, no bundler.

  • api.js โ€” Single shared module loaded by every page. Contains the fetch wrapper, Auth state object, Cart (localStorage), TokenStore, and toast notifications.
  • nav.js โ€” Shared navbar renderer. Reads Auth.user and builds the full navbar as an HTML template literal, injected via innerHTML.

Every page follows the same init pattern:

async function init() {
  await Auth.load();                          // fetch user from server
  if (!Auth.isLoggedIn()) go('login.html');   // guard
  renderNav('pageName');                      // build navbar
  loadPageData();                             // fetch and render content
}
init();

๐Ÿ“„ Pages Reference

Page File Access
Home pages/home.html ๐ŸŒ Public
Login pages/login.html ๐ŸŒ Public
Register pages/register.html ๐ŸŒ Public
Product Detail pages/product.html?id= ๐ŸŒ Public
Cart pages/cart.html ๐ŸŒ Public
Checkout pages/checkout.html ๐Ÿ”’ User
My Orders pages/my-orders.html ๐Ÿ”’ User
Order Detail pages/order-detail.html?id= ๐Ÿ”’ User
Profile pages/profile.html ๐Ÿ”’ User / Admin
Admin Dashboard pages/admin/dashboard.html ๐Ÿ”’ Admin
Admin Products pages/admin/products.html ๐Ÿ”’ Admin
Admin Orders pages/admin/orders.html ๐Ÿ”’ Admin
Admin Categories pages/admin/categories.html ๐Ÿ”’ Admin

๐Ÿ“ธ Screenshots

Tronixy Home Page
Tronixy Product Page

๐Ÿ‘ฅ Team

Built with โค๏ธ by the Tronixy Team:

Name Contact
Devo-Hacker GitHub
Niladree Bihari Nayak Email
Sakshi Mishra Email
Sanjana Email

๐Ÿ“œ License

This project is open source and available under the MIT License.


ยฉ 2026 TRONIXY. All Rights Reserved. | Made with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ


If you found this project helpful, please consider giving it a โญ on GitHub!

Star on GitHub

About

E-commerce Application based on the Rule-Based Recommendation system and designed algorithms specifically for electronics items

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages