A full-stack web application for managing product inventory with user authentication, product CRUD operations, and filtering capabilities.
This Product Management App provides businesses with a streamlined way to manage their product catalog. It features a secure user authentication system, comprehensive product management functionality, and intuitive filtering options to help users quickly find products based on specific criteria.
- Secure user registration and login
- JWT-based authentication
- Password encryption with bcryptjs
- Create new products with auto-generated product IDs
- View all products in a responsive grid layout
- Update existing product information
- Delete products
- Feature products to highlight specific items
- Filter products by price range
- Filter products by minimum rating
- Combined filtering (price and rating)
- Quick access to featured products
- React (v18.3.1): UI component library
- Vite (v6.0.5): Fast, modern frontend build tool
- Axios: HTTP client for API requests
- Tailwind CSS (v4.0.0): Utility-first CSS framework
- ESLint: Code linting and formatting
- Node.js: Runtime environment
- Express.js: Web framework
- MongoDB: NoSQL database
- Mongoose: MongoDB object modeling
- JWT: Authentication token generation and verification
- bcryptjs: Password hashing
- dotenv: Environment variable management
- CORS: Cross-Origin Resource Sharing configuration
product-management-app/
│
├── frontend/ # React frontend application
│ ├── src/ # Source files
│ │ ├── App.jsx # Main application component
│ │ ├── main.jsx # Application entry point
│ │ └── index.css # Global styles
│ ├── public/ # Static assets
│ ├── .env # Frontend environment variables
│ ├── vite.config.js # Vite configuration
│ ├── eslint.config.js # ESLint configuration
│ └── package.json # Frontend dependencies
│
└── backend/ # Node.js backend
├── server.js # Express server and API routes
├── index.js # Server entry point
├── .env # Backend environment variables
└── package.json # Backend dependencies
- Node.js (v14 or higher)
- MongoDB account or local MongoDB installation
- Git
-
Clone the repository:
git clone [repository-url] cd product-management-app/backend -
Install dependencies:
npm install -
Create a
.envfile with the following variables:MONGODB_URI=your_mongodb_connection_string TOKEN_SECRET=your_jwt_secret NODE_ENV=development PORT=5000 -
Start the backend server:
npm start
-
Navigate to the frontend directory:
cd ../frontend -
Install dependencies:
npm install -
Create a
.envfile with the backend URL:VITE_BACKEND_URL=http://localhost:5000Note: For production, set this to your deployed backend URL.
-
Start the frontend development server:
npm run dev
- Register a new account with your email and password
- Log in with your credentials
- The system will automatically generate and store a JWT token for session management
- Adding Products: Fill in the product form with name, price, company, rating, and optional featured status
- Viewing Products: All products are displayed in a responsive grid layout
- Updating Products: Click the Edit button on a product card to modify its details
- Deleting Products: Click the Delete button on a product card to remove it from the database
- Price Filter: Use the slider to set a maximum price threshold
- Rating Filter: Use the slider to set a minimum rating threshold
- Apply Filters: Click the "Apply Filters" button to see products that match both criteria
- Featured Products: Click the "Featured Products" button to view only featured items
- All Products: Reset filters and view all products by clicking "All Products"
- POST /signup: Register a new user
- POST /login: Authenticate user and receive JWT token
- GET /products: Retrieve all products (requires authentication)
- POST /products: Add a new product (requires authentication)
- PUT /products/:id: Update a specific product (requires authentication)
- DELETE /products/:id: Delete a specific product (requires authentication)
- GET /products/featured: Get featured products (requires authentication)
- GET /products/price/:maxPrice: Get products below a price threshold (requires authentication)
- GET /products/rating/:minRating: Get products above a rating threshold (requires authentication)
- User passwords are hashed using bcryptjs before storage
- JWT tokens are used for authentication and API access
- CORS is configured to restrict access to specified origins
- Environment variables are used for storing sensitive information
- Input validation on both client and server sides
The backend is deployed on Railway at: https://product-management-app-production-9ac2.up.railway.app
The frontend is deployed on Vercel at: https://product-management-app-dun.vercel.app
ISC License