Skip to content

Repository files navigation

Mauli Enterprises - Weight Scale Solutions

A full-stack web application for managing and showcasing weight scale products, categories, and customer reviews.

📁 Project Structure

This project is organized into frontend and backend directories for better maintainability and deployment:

  • src/: Frontend React application (Vite).
  • server/: Backend Express application (Node.js).
    • server/index.ts: Main server entry point.
    • server/data.json: Local JSON database (fallback).
  • dist/: Compiled frontend assets (generated after npm run build).

🚀 Local Setup

To run this project on your local machine, follow these steps:

1. Prerequisites

  • Node.js (v18 or higher recommended)
  • npm (comes with Node.js)

2. Installation

Clone the repository or download the source code, then navigate to the project directory and run:

npm install

3. Running the Development Server

Start the full-stack development server (Express + Vite):

npm run dev

The application will be available at http://localhost:3000.


🗄️ Database Setup

Currently, the application uses a Hybrid Data Layer. It defaults to a local JSON file but can easily scale to a cloud database.

Local JSON Database

  • Located at server/data.json.
  • Perfect for local testing and single-user setups.

MongoDB (Recommended for Production)

The application is already configured to support MongoDB. To use it:

  1. Create a free cluster on MongoDB Atlas.
  2. Get your Connection String (URI).
  3. Add it to your environment variables as MONGODB_URI.
  4. The server will automatically detect the URI and switch from data.json to MongoDB.

Benefits of MongoDB:

  • Persistence: Data is saved even if your server restarts.
  • Scalability: Handles thousands of products and reviews easily.
  • Reliability: Managed backups and high availability.

🌐 Deployment Process

Option 1: Cloud Run / Docker (Recommended)

Since this is an Express app, you can containerize it:

  1. Create a Dockerfile.
  2. Build the image: docker build -t mauli-app .
  3. Deploy to Google Cloud Run, AWS App Runner, or DigitalOcean App Platform.

Option 2: VPS (DigitalOcean, Linode, EC2)

  1. SSH into your server.
  2. Install Node.js and Git.
  3. Clone the repo and run npm install.
  4. Build the frontend: npm run build.
  5. Start the server using a process manager like PM2:
    pm2 start server/index.ts --interpreter tsx

🔑 Admin Access

  • Admin PIN: 8055 (Full access to add/edit/delete)
  • Customer PIN: 12345 (View only)

You can change these PINs in src/App.tsx inside the handleLogin function.


🎨 Customizing Themes

The app supports 10 dynamic themes. You can add more in src/App.tsx by updating the themes object.

About

This project is build for Mauli Enterprises weighing scale company and deployed on vercel and used firebase as a beginner.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages