Your one-stop destination for electronics & tech accessories โ Built in India ๐ฎ๐ณ
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.
๐๏ธ 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 |
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
| 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 |
Tronixy uses a dual-token strategy for maximum browser compatibility:
- Server side โ JWT token set as an HTTP-only cookie on login response
- Client side โ Token also stored in localStorage and sent via
Authorization: Bearerheader 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.
๐ค 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 |
Before you begin, make sure you have the following:
- Node.js v16 or above
- npm
- MongoDB Atlas account
- Cloudinary account
- Stripe account (for payment features)
1. Clone the repository
git clone https://github.com/Devo-Hacker/Tronixy.git
cd Tronixy2. Install server dependencies
cd server
npm install3. 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_key4. Start the backend server
nodemon server.jsServer 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
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. ReadsAuth.userand builds the full navbar as an HTML template literal, injected viainnerHTML.
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();| 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 |
Built with โค๏ธ by the Tronixy Team:
| Name | Contact |
|---|---|
| Devo-Hacker | |
| Niladree Bihari Nayak | |
| Sakshi Mishra | |
| Sanjana |
This project is open source and available under the MIT License.