A full-stack store rating platform where users can discover stores, submit ratings, and manage their ratings. Administrators can manage users and stores, while store owners can monitor ratings for their stores.
StoreRate is a role-based web application built with a NestJS backend, React frontend, and PostgreSQL database.
The application provides three different roles:
- ADMIN — manages users, stores, and platform statistics.
- USER — searches stores and submits or updates ratings.
- STORE_OWNER — views store information, ratings, and average ratings.
Authentication is implemented using JWT, with role-based route protection and server-side validation.
Users can search stores, view overall ratings, see their own ratings, and submit or update ratings using the 1–5 star interface.
Store owners can view their store information, average rating, total ratings, and customer rating details.
Administrators can manage users and stores, view platform statistics, search and filter records, and manage different user roles.
Users and store owners can securely change their account password through the application interface.
- Secure admin login
- Dashboard statistics:
- Total users
- Total stores
- Total ratings
- Create users
- Create administrators
- Create store owners
- Create stores
- Assign stores to store owners
- Search users
- Filter users by:
- Name
- Address
- Role
- Sort users ascending/descending by:
- Name
- Address
- Role
- Search stores
- Filter stores by:
- Name
- Address
- Sort stores ascending/descending by:
- Name
- Address
- Rating
- View user details
- View store-owner/store rating information
- Logout
- Secure login
- Store listing
- Search stores by name
- Search stores by address
- View overall store rating
- View personal submitted rating
- Submit a rating from 1 to 5
- Modify an existing rating
- Sort stores by:
- Name
- Address
- Overall rating
- Change password
- Logout
- Secure login
- Owner dashboard
- View owner information
- View assigned stores
- View store name, email, and address
- View average rating
- View total ratings
- View customer rating list
- Sort customer ratings by:
- User name
- Rating
- Submitted date
- Change password
- Logout
- React
- Vite
- React Router
- Axios
- Lucide React
- NestJS
- TypeScript
- Prisma ORM
- PostgreSQL
- JWT Authentication
- Passport
- class-validator
- Node.js
- npm
- Git
- GitHub
- Docker
- Docker Compose
┌─────────────────────┐
│ Browser │
│ React + Vite │
└──────────┬──────────┘
│
│ HTTP / JSON
▼
┌─────────────────────┐
│ NestJS API │
│ │
│ Authentication │
│ Authorization │
│ Admin Module │
│ Users Module │
│ Owner Module │
│ Rating APIs │
└──────────┬──────────┘
│
│ Prisma ORM
▼
┌─────────────────────┐
│ PostgreSQL │
│ │
│ Users │
│ Stores │
│ Ratings │
└─────────────────────┘
StoreRate uses JWT-based authentication.
After successful login:
- The backend validates the user's credentials.
- A JWT access token is generated.
- The frontend stores the authentication information.
- Axios sends the JWT using the
Authorizationheader. - NestJS guards validate the token.
- Role-based guards restrict protected routes.
Supported roles:
ADMIN
USER
STORE_OWNER
Each role has access only to its permitted dashboard and APIs.
The backend validates user input using class-validator.
Minimum: 20 characters
Maximum: 60 characters
Maximum: 400 characters
Minimum: 8 characters
Maximum: 16 characters
The password must contain:
- At least one uppercase letter
- At least one special character
A valid email format is required.
Ratings must be an integer between:
1 and 5
StoreRate/
│
├── backend/
│ ├── prisma/
│ ├── src/
│ │ ├── admin/
│ │ ├── auth/
│ │ ├── owner/
│ │ ├── prisma/
│ │ └── users/
│ ├── package.json
│ └── README.md
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── context/
│ │ ├── pages/
│ │ │ ├── admin/
│ │ │ ├── owner/
│ │ │ └── user/
│ │ └── services/
│ ├── package.json
│ └── vite.config.js
│
├── docker-compose.yml
├── .gitignore
└── README.md
Install the following before running the project:
- Node.js
- npm
- PostgreSQL
Optional:
- Docker
- Docker Compose
Open a terminal:
cd backend
npm installCreate a local .env file:
DATABASE_URL="postgresql://USERNAME:PASSWORD@localhost:5432/storerate?schema=public"
JWT_SECRET="your-development-secret"Important: Never commit
.envto GitHub. The actual project.envfile is excluded using.gitignore.
Generate Prisma Client:
npx prisma generateApply the database schema:
npx prisma migrate devStart the backend:
npm run start:devThe backend runs on:
http://localhost:3000
Open another terminal:
cd frontend
npm installStart the development server:
npm run devThe Vite development server will display the local URL in the terminal.
cd backend
npm run buildcd frontend
npm run buildBoth projects should build without compilation errors.
POST /auth/login
POST /auth/register
GET /stores
POST /stores/:storeId/rating
GET /owner/dashboard
GET /admin/dashboard
GET /admin/users
GET /admin/users/:id
POST /admin/users
GET /admin/stores
POST /admin/stores
The complete API implementation is available in the backend source code.
StoreRate includes:
- JWT authentication
- Role-based authorization
- Protected frontend routes
- Protected backend routes
- Password hashing
- Input validation
- Environment-based database configuration
- Environment-based JWT secret
- CORS configuration
Sensitive configuration is intentionally excluded from Git.
StoreRate uses PostgreSQL with Prisma ORM.
The main application entities are:
User
Store
Rating
Relationships:
User
├── can submit Ratings
└── can own Stores
Store
└── has many Ratings
Rating
├── belongs to User
└── belongs to Store
A user's rating for a store can be updated instead of creating multiple ratings for the same user/store combination.
StoreRate
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
ADMIN USER STORE_OWNER
│ │ │
▼ ▼ ▼
Admin Dashboard User Dashboard Owner Dashboard
│ │ │
┌─────┼─────┐ │ ┌─────┴─────┐
│ │ │ │ │ │
Users Stores Stats Ratings Stores Ratings
│ │ │
│ │ │
▼ ▼ ▼
Manage Manage Submit / Update
Users Stores Rating
Before deployment or submission, verify:
- Admin login
- User login
- Store Owner login
- User registration
- Admin creates user
- Admin creates store owner
- Admin creates store
- Store assignment
- User store search
- User rating submission
- User rating modification
- Admin filtering
- Admin sorting
- User store sorting
- Store Owner rating sorting
- User password change
- Store Owner password change
- Logout
- Role-based route protection
- Backend build
- Frontend build
The complete StoreRate project is maintained in a single Git repository containing both the frontend and backend.
Repository:
https://github.com/Sachingupta209/StoreRate
The repository contains:
- React frontend
- NestJS backend
- Prisma schema
- PostgreSQL integration
- Docker Compose configuration
- Project documentation
Sensitive files such as .env, dependencies, build output, and local Docker database data are excluded using .gitignore.
Possible future enhancements include:
- Pagination for large datasets
- Advanced dashboard analytics
- Rating distribution charts
- Email notifications
- Automated deployment
- Docker-based production deployment
- CI/CD pipeline
- Comprehensive unit tests
- End-to-end testing
- Production monitoring and logging
This project was developed as a software engineering challenge and portfolio project.



