- Overview
- Key Features
- Technology Stack
- Project Structure
- User Roles & Permissions
- Getting Started
- System Architecture
- API Documentation
- Screenshots
- Contributing
- License
Analify is a comprehensive enterprise-level platform designed for multi-store retail management with integrated analytics and a unique monthly bidding system for product sections. The system provides role-based access control, real-time analytics, inventory management, order processing, and an innovative bidding mechanism for investors to acquire product display sections.
The platform serves a retail chain with multiple stores across different regions and states. It enables:
- Store Managers to manage their store operations and employees
- Cashiers to process customer orders
- Investors to bid on product display sections and manage inventory
- General Admins to oversee the entire operation with comprehensive analytics
- Real-time dashboard with key performance indicators (KPIs)
- Revenue tracking and trend analysis
- Sales distribution by region, state, and store
- Product performance analytics
- Predictive analytics for future trends
- Customizable filters based on user role
- Hierarchical organization (Region β State β Store)
- Store-specific employee management
- Cross-store inventory visibility
- Low stock alerts with store-level tracking
- Complete order lifecycle management
- Multi-item orders with discount support
- Role-based order creation and editing
- Order tracking with ship date management
- Historical order analytics
- Role-based access control
- Employee profile management
- Salary tracking
- Store assignment and transfer
- Comprehensive employee directory (Admin only)
The platform features a unique monthly bidding cycle for product display sections:
- Monthly Cycle: Each calendar month is a new bidding period
- Price Increases: On the 1st of every month, all section prices increase by 2%
- Bidding Window: Investors can place bids throughout the entire month
- Section Hierarchy: Categories β Rangs β Faces β Sections
- Winning Bids: Highest bid at month-end wins the section
- Browse available sections by category, rang, and face
- Place competitive bids on open sections
- Track current winning status in real-time
- View bid history and competing bids
- Manage won sections and possessions
- Monthly period information dashboard
- PENDING: Currently the highest bid (winning)
- OUTBID: Another investor bid higher
- WINNER: Won the bid after section closed
- Product catalog with categories and subcategories
- Multi-store inventory tracking
- Stock level management
- Price updates
- Product search and filtering
- Low stock alerts
- Framework: React 18 with TypeScript
- Build Tool: Vite
- UI Library: shadcn/ui (Radix UI components)
- Styling: Tailwind CSS
- State Management: React Query (TanStack Query v5)
- Routing: React Router v6
- Form Handling: React Hook Form + Zod validation
- Charts: Recharts
- Icons: Lucide React
- Framework: Spring Boot 3.4.13
- Language: Java 21
- Database: PostgreSQL
- ORM: Hibernate/JPA
- Security: Spring Security + JWT
- Validation: Jakarta Validation
- Mapping: MapStruct
- Password Encryption: BCrypt
- Containerization: Docker & Docker Compose
- Container Orchestration: Multi-service architecture
- Reverse Proxy: Nginx (production)
- Database: PostgreSQL 16 (containerized)
- LLM Service: Ollama
- Framework: Spring AI
- Model: llama3.2:3b (local deployment)
- Use Case: Analytics assistant with natural language queries
- API Testing: Postman/Insomnia recommended
- Database Tool: pgAdmin 4 or DBeaver
- Version Control: Git
- Container Runtime: Docker Engine 20.10+
analifyProject/
βββ frontAnalify/ # React + TypeScript Frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ services/ # API service layer
β β βββ contexts/ # React Context providers
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility functions
β β βββ types/ # TypeScript type definitions
β βββ README.md # Frontend documentation
β
βββ backAnalify/ # Spring Boot Backend
β βββ src/
β βββ main/
β β βββ java/com/analyfy/analify/
β β β βββ Controller/ # REST API endpoints
β β β βββ Service/ # Business logic
β β β βββ Repository/ # Database access
β β β βββ Entity/ # JPA entities
β β β βββ DTO/ # Data transfer objects
β β β βββ Mapper/ # Entity-DTO mappers
β β β βββ Security/ # JWT & auth
β β β βββ Enum/ # Enumerations
β β β βββ Exception/ # Custom exceptions
β β βββ resources/
β β βββ application.properties
β βββ README.md # Backend documentation
β
βββ BIDDING_SYSTEM_COMPLETE_FEATURES.md # Bidding system docs
βββ README.md # This file
Permissions:
- β Create and delete orders
- β View personal profile
- β Cannot access employee management
- β Cannot access analytics
- β Cannot manage products
Use Case: Point-of-sale employees processing customer transactions
Permissions:
- β View and edit orders from their store
- β View and manage employees in their store
- β View store-specific analytics (filtered by store)
- β See which cashier validated each order
- β Cannot create new orders (only cashiers can)
- β Cannot access other stores' data
Use Case: Store managers overseeing daily operations
Permissions:
- β
Full bidding system access
- Browse all sections (categories, rangs, faces)
- Place and cancel bids
- View bid history and current winning status
- Manage won sections/possessions
- β Manage products (view, create, edit, delete)
- β View low stock alerts across all stores
- β View analytics (filtered by their products)
- β Cannot access employee management
- β Cannot process orders
Use Case: Product suppliers bidding on display sections
Permissions:
- β Full access to all features
- β View all employees (including other admins and investors)
- β Manage all orders across all stores
- β View comprehensive analytics (region, state, store filters)
- β Access all bidding system data
- β Manage all products
- β System-wide oversight
Use Case: C-level executives and system administrators
The easiest way to run the entire application stack:
- Docker Engine 20.10+ (Install Docker)
- Docker Compose 2.0+
- 4GB+ available RAM
- 10GB+ free disk space
# Navigate to project root
cd analifyProject
# Start all services (backend, frontend, database, Ollama)
docker-compose up -d
# Check status
docker-compose ps
# View logs
docker-compose logs -fAccess:
- Frontend: http://localhost
- Backend API: http://localhost:8081/api
- Ollama LLM: http://localhost:11434
Manage:
# Stop services
docker-compose stop
# Restart services
docker-compose restart
# Rebuild after code changes
docker-compose up -d --build
# Stop and remove everything
docker-compose downπ Full Docker documentation: See README.Docker.md
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) and npm
- Java Development Kit (JDK 21)
- Maven (3.6 or higher)
- PostgreSQL (14 or higher)
- Ollama (for LLM analytics assistant)
- Git
-
Install PostgreSQL (if not already installed)
-
Create Database:
CREATE DATABASE analify;- Configure Database Connection:
- Navigate to
backAnalify/src/main/resources/application.properties - Update the following properties:
- Navigate to
spring.datasource.url=jdbc:postgresql://localhost:5432/analify
spring.datasource.username=YOUR_POSTGRES_USERNAME
spring.datasource.password=YOUR_POSTGRES_PASSWORD- Navigate to backend directory:
cd backAnalify- Build the project:
./mvnw clean installOn Windows, use mvnw.cmd instead of ./mvnw
- Run the application:
./mvnw spring-boot:runThe backend will start on http://localhost:8081
- Verify backend is running:
- Open browser: http://localhost:8081/api/bidding/categories
- You should see a JSON response
- Open a new terminal and navigate to frontend directory:
cd frontAnalify- Install dependencies:
npm install- Start development server:
npm run devThe frontend will start on http://localhost:5173
- Access the application:
- Open browser: http://localhost:5173
- You'll be redirected to the login page
Note: Ask your database administrator for test credentials, or create users via the employee management system
Example credentials structure:
Email: user@example.com
Password: [your-password]
βββββββββββββββββββββββββββββββββββββββββββ
β React Application β
β βββββββββββββββββββββββββββββββββββββ β
β β Components (shadcn/ui) β β
β β - Charts, Tables, Forms, etc. β β
β βββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββ β
β β Pages (Routes) β β
β β - Dashboard, Orders, Products β β
β β - Bidding, Analytics, etc. β β
β βββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββ β
β β Services (API Layer) β β
β β - HTTP requests via fetch β β
β β - JWT token management β β
β βββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββ β
β β State Management β β
β β - React Query (caching) β β
β β - Context API (auth) β β
β βββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Spring Boot Application β
β βββββββββββββββββββββββββββββββββββββββββ β
β β REST Controllers β β
β β - @RestController endpoints β β
β β - Request/Response DTOs β β
β βββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββ β
β β Service Layer β β
β β - Business logic β β
β β - Transaction management β β
β β - Role-based authorization β β
β βββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββ β
β β Repository Layer β β
β β - JPA Repositories β β
β β - Custom queries β β
β βββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββ β
β β Database (PostgreSQL) β β
β β - JPA Entity mapping β β
β β - Hibernate ORM β β
β βββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββ β
β β Security Layer β β
β β - JWT authentication β β
β β - Request interceptors β β
β β - Password encryption β β
β βββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
User Action (Frontend)
β
API Service Layer (TypeScript)
β
HTTP Request + JWT Token
β
Spring Security Filter (JWT Validation)
β
REST Controller (@GetMapping, @PostMapping, etc.)
β
Service Layer (Business Logic + Authorization)
β
Repository Layer (JPA/Hibernate)
β
PostgreSQL Database
β
Response DTO
β
React Query Cache
β
UI Component Render
http://localhost:8081/api
All API requests (except /auth/login) require JWT authentication:
Authorization: Bearer <jwt_token>
POST /auth/login- User login (returns JWT token)
GET /orders- Get all orders (with optional filters)GET /orders/{id}- Get specific orderPOST /orders- Create new orderPATCH /orders/{id}/ship-date- Update ship dateDELETE /orders/{id}- Delete order
GET /products- Get all products (with filters)GET /products/{id}- Get specific productPOST /products- Create new productPUT /products/{id}- Update productDELETE /products/{id}- Delete productPATCH /products/{id}/stock- Update stock quantityGET /products/alerts/low-stock- Get low stock alerts
GET /employees/getall- Get all employees (Admin only)GET /employees/{id}- Get employee profileGET /employees/store/{storeId}- Get store employeesPOST /employees/add- Create employeePUT /employees/{id}- Update employeeDELETE /employees/{id}- Delete employeePUT /employees/{id}/assign-role- Assign role to employee
GET /analytics/dashboard- Get dashboard statisticsGET /analytics/predictions- Get predictive analyticsPOST /analytics/deep-search- Advanced search
GET /bidding/categories- Get all categoriesGET /bidding/categories/{id}/rangs- Get rangs by categoryGET /bidding/rangs/{id}/faces- Get faces by rangGET /bidding/faces/{id}/sections- Get sections by faceGET /bidding/sections/{id}- Get section detailsPOST /bidding/bids- Place a bidDELETE /bidding/bids/{id}- Cancel a bidGET /bidding/my-bids- Get my bidsGET /bidding/my-current-winning-bids- Get bids I'm winningGET /bidding/my-winning-bids- Get bids I wonGET /bidding/my-possessions- Get sections I possessGET /bidding/season/current- Get current period info
For complete API documentation, see:
backAnalify/README.md- Detailed backend API docsBIDDING_SYSTEM_COMPLETE_FEATURES.md- Bidding system specification
Role-based dashboard showing KPIs, charts, and trends
Browse sections, place bids, track winning status
Create, edit, and track orders with multi-item support
Comprehensive employee directory with role assignment
Create .env file in frontAnalify/:
VITE_API_BASE_URL=http://localhost:8081/apiEdit backAnalify/src/main/resources/application.properties:
# Server
server.port=8081
# Database
spring.datasource.url=jdbc:postgresql://localhost:5432/analify
spring.datasource.username=postgres
spring.datasource.password=your_password
# JPA
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
# JWT (configure in JwtService.java)
jwt.secret=your-secret-key
jwt.expiration=86400000- Frontend: ESLint configuration with TypeScript rules
- Backend: Java coding conventions with Lombok for boilerplate reduction
main- Production-ready codedevelop- Development branchfeature/*- Feature branchesbugfix/*- Bug fix branches
Follow conventional commits:
feat: Add new bidding dashboard
fix: Resolve order date validation issue
docs: Update API documentation
refactor: Improve employee service logic
cd frontAnalify
npm run lint # Run linter
npm run build # Test production buildcd backAnalify
./mvnw test # Run unit tests
./mvnw verify # Run integration tests# Production deployment with Docker
docker-compose up -d
# Scale services if needed
docker-compose up -d --scale backend=2
# View resource usage
docker statsSee README.Docker.md for production deployment guide.
cd frontAnalify
npm run build # Creates dist/ foldercd backAnalify
./mvnw clean package # Creates target/*.jar file
java -jar target/analify-0.0.1-SNAPSHOT.jarServices won't start:
# Check service status
docker-compose ps
# View logs
docker-compose logs backend
docker-compose logs postgres
# Restart specific service
docker-compose restart backendPort conflicts:
- Edit
docker-compose.ymlto change port mappings - Example: Change frontend port from
80:80to8080:80
Ollama model not loading:
# Pull model manually
docker exec analify-ollama ollama pull llama3.2:3b
# Check available models
docker exec analify-ollama ollama listBackend won't start:
- Verify PostgreSQL is running
- Check database credentials in
application.properties - Ensure port 8081 is not in use
Frontend can't connect to backend:
- Verify backend is running on http://localhost:8081
- Check browser console for CORS errors
- Verify JWT token is being sent with requests
Database errors:
- Run
spring.jpa.hibernate.ddl-auto=createonce to recreate schema - Check PostgreSQL logs for connection issues
Authentication issues:
- Clear browser localStorage:
localStorage.clear() - Verify JWT token is valid and not expired
- Check user exists in database
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Development Team
- Full Stack Development
- UI/UX Design
- Database Architecture
- Business Logic Implementation
For questions, issues, or support:
- Issues: Open an issue on GitHub
- Documentation: See individual README files in
frontAnalify/andbackAnalify/ - API Docs: See
BIDDING_SYSTEM_COMPLETE_FEATURES.md
- Email notifications for bid status changes
- Mobile-responsive progressive web app (PWA)
- Advanced analytics with AI predictions
- Export functionality for reports
- Real-time notifications with WebSocket
- Multi-language support (i18n)
- Automated testing suite
- Docker containerization
- CI/CD pipeline setup
- β Core functionality complete
- β Role-based access control implemented
- β Monthly bidding system operational
- β Analytics dashboard functional
- β Multi-store management working
- π Ongoing refinements and optimizations
Built with β€οΈ using React, Spring Boot, and PostgreSQL