A comprehensive full-stack web application for store rating and management system with role-based access control.
The Store Rating System is a modern web application built as part of a FullStack Intern Coding Challenge. It enables users to submit ratings (1-5 stars) for registered stores with a sophisticated role-based authentication system supporting three distinct user types: System Administrators, Normal Users, and Store Owners.
- π Role-Based Authentication: Secure login system with JWT tokens
- β Store Rating System: Interactive 1-5 star rating functionality
- π Admin Dashboard: Comprehensive analytics and user management
- π Advanced Search & Filtering: Search stores by name, address, and ratings
- π± Responsive Design: Mobile-first design with TailwindCSS
- π Real-time Updates: Dynamic rating calculations with database triggers
- π‘οΈ Security First: Input validation, password hashing, and CORS protection
| Role | Password | Access Level | |
|---|---|---|---|
| System Admin | admin@storerating.com |
Password123! |
Full system access |
| Store Owner | owner@techmart.com |
Password123! |
Store management |
| Normal User | demouser@xyz.com |
Demo@123 |
Rating & browsing |
- βοΈ React.js 18+ with TypeScript
- π¨ TailwindCSS for responsive styling
- π§ React Router Dom for client-side routing
- π‘ Axios for API communication
- β‘ Vite for fast development and building
- π Express.js with TypeScript
- π JWT authentication & authorization
- π‘οΈ bcryptjs for password hashing
- β express-validator for input validation
- π§ CORS & Helmet for security
- π¬ MySQL 8.0+ with connection pooling
- βοΈ Aiven Cloud for production database hosting
- π Database Triggers for automatic rating calculations
- π Render for frontend hosting
- βοΈ Cloud Platform for backend deployment
- π GitHub Actions ready for CI/CD
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β β β β
β React.js βββββΊβ Express.js βββββΊβ MySQL DB β
β Frontend β β Backend API β β Database β
β β β β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
TailwindCSS JWT + Validation Triggers + Indexes
React Router CORS + Helmet Connection Pool
- Node.js 18+ and npm
- MySQL 8.0+ database
- Git for version control
git clone https://github.com/adarsh47-bug/Store-Rating-System.git
cd Store-Rating-Systemcd backend
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Edit .env with your database credentials
# Setup database and sample data
npm run setup-db
# Build and start development server
npm run build
npm run devcd ../frontend
# Install dependencies
npm install --legacy-peer-deps
# Configure environment variables
cp .env.example .env
# Update VITE_API_URL if needed
# Start development server
npm start- Frontend: http://localhost:5173
- Backend API: http://localhost:8080
- Admin Panel: Login with
admin@storerating.com/Password123!
- β User Management: Create/view users and admins
- β Store Management: Add and manage all stores
- β Analytics Dashboard: View comprehensive statistics
- β Advanced Filtering: Filter by name, email, address, role
- β User Details: Access detailed user information and ratings
- β Self Registration: Sign up with email verification
- β Store Discovery: Browse and search stores
- β Rating System: Submit and modify ratings (1-5 stars)
- β Profile Management: Update password and personal info
- β Search & Filter: Find stores by name and address
- β Store Dashboard: View store analytics and ratings
- β Rating Insights: See who rated their store
- β Average Rating: Real-time store rating calculations
- β Profile Management: Update password and store info
POST /api/auth/login # User login
POST /api/auth/register # User registration
GET /api/auth/profile # Get user profile
PUT /api/auth/password # Update passwordGET /api/admin/dashboard # Admin dashboard data
POST /api/admin/users # Create new user
GET /api/admin/users # List all users
POST /api/admin/stores # Create new store
GET /api/admin/stores # List all storesGET /api/user/stores # List stores for rating
POST /api/user/ratings # Submit store rating
GET /api/user/ratings # Get user's ratingsGET /api/store-owner/dashboard # Store dashboard
GET /api/store-owner/ratings # Store ratings details
GET /api/store-owner/summary # Rating summary- π JWT Authentication: Secure token-based authentication
- π Password Hashing: bcryptjs with salt rounds
- β Input Validation: Comprehensive form validation
- π‘οΈ CORS Protection: Cross-origin resource sharing control
- π« SQL Injection Prevention: Parameterized queries
- π Role-Based Access: Route-level permission control
- id (Primary Key)
- name (20-60 characters)
- email (Unique, validated)
- password (Hashed, 8-16 chars with uppercase & special char)
- address (Max 400 characters)
- role (system_admin/normal_user/store_owner)
- status (Active/Inactive)
- created_at, updated_at- id (Primary Key)
- name, email, address
- owner_id (Foreign Key to Users)
- average_rating (Auto-calculated)
- total_ratings (Auto-calculated)
- status, created_at, updated_at- id (Primary Key)
- user_id, store_id (Foreign Keys)
- rating (1-5, validated)
- status, created_at, updated_at
- Unique constraint: one rating per user per store| Field | Validation Rules |
|---|---|
| Name | 20-60 characters, required |
| Valid email format, unique | |
| Password | 8-16 chars, 1 uppercase, 1 special character |
| Address | Maximum 400 characters |
| Rating | Integer between 1-5 |
- π± Responsive Design: Mobile-first approach
- π― Interactive Components: Star ratings, modals, tables
- π Search & Filter: Real-time search functionality
- π Data Visualization: Rating charts and statistics
- π¨ Modern UI: Clean, professional interface
- βΏ Accessibility: ARIA labels and keyboard navigation
# Build command
npm run build
# Publish directory
./dist
# Environment Variables
VITE_API_URL=your_backend_url# Build command
npm run build
# Start command
npm start
# Environment Variables
DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME
JWT_SECRET, FRONTEND_URLDeveloper: Adarsh Kadam
GitHub: @adarsh47-bug
Project: Store Rating System
β Star this repository if you found it helpful!
π Live Demo β’ π Documentation β’ π Report Bug β’ π‘ Feature Request