Complete ShopNear code folder map
Full enterprise repository layout for backend, frontend, mobile, and DevOps.
This page gives you the complete folder structure to materialize the production-grade ShopNear system while the current runnable workspace remains the React/Vite prototype.
Backend
- • Java 21 + Spring Boot 3 modular monolith baseline
- • Spring Security JWT/refresh tokens/OAuth2/RBAC
- • PostgreSQL + PostGIS + Flyway + Redis
- • WebSocket chat and notification event pipeline
Frontend
- • React + TypeScript + Tailwind + shadcn-style components
- • Location-aware discovery, shopkeeper workspace, auth
- • Search, offer email, architecture, and code folder pages
Mobile
- • Flutter feature modules for customer discovery, chat, and shopkeeper tools
- • GPS permissions, maps, push notifications, and route views
DevOps
- • Docker Compose local stack
- • Kubernetes manifests behind Nginx ingress
- • GitHub Actions CI/CD and Terraform AWS modules
Repository tree
Use this as the target code folder for the complete enterprise implementation.
shopnear/
├── README.md
├── docker-compose.yml
├── .env.example
├── backend/
│ ├── pom.xml
│ ├── Dockerfile
│ └── src/main/java/com/shopnear/
│ ├── ShopNearApplication.java
│ ├── auth/ # JWT, refresh tokens, OAuth2, RBAC
│ ├── user/ # customers, shopkeepers, partners, admins
│ ├── shop/ # shop registration, verification, business hours
│ ├── product/ # products, inventory, tags, images
│ ├── geo/ # PostGIS nearby search + Haversine fallback
│ ├── chat/ # WebSocket rooms, typing, read receipts
│ ├── review/ # ratings, image reviews, moderation
│ ├── offer/ # coupons, flash sales, BOGO, festivals
│ ├── notification/ # FCM, email, SMS events
│ ├── analytics/ # shopkeeper and admin dashboards
│ ├── delivery/ # delivery partners, routes, earnings
│ ├── audit/ # immutable audit logging
│ └── common/ # exceptions, validation, OpenAPI, config
│ └── src/main/resources/
│ ├── application.yml
│ └── db/migration/
│ ├── V1__enable_postgis_and_core_schema.sql
│ ├── V2__shops_products_reviews.sql
│ └── V3__chat_offers_orders_audit.sql
├── frontend/
│ ├── package.json
│ ├── vite.config.ts
│ └── src/
│ ├── pages/ # discovery, shopkeeper, admin, analytics
│ ├── components/ # shadcn-style UI primitives
│ ├── services/ # axios, auth, geo, search, websocket
│ └── types/
├── mobile/
│ ├── pubspec.yaml
│ └── lib/
│ ├── main.dart
│ ├── features/discovery/
│ ├── features/shopkeeper/
│ ├── features/chat/
│ └── shared/
├── infra/
│ ├── nginx/nginx.conf
│ ├── k8s/
│ │ ├── backend-deployment.yaml
│ │ ├── frontend-deployment.yaml
│ │ ├── postgres-statefulset.yaml
│ │ └── redis-deployment.yaml
│ └── terraform/aws/
│ ├── main.tf
│ ├── variables.tf
│ └── outputs.tf
└── .github/workflows/ci-cd.ymlBackend starter
Spring Boot entrypoint plus the core PostGIS query shape.
// backend/src/main/java/com/shopnear/ShopNearApplication.java
package com.shopnear;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
@EnableJpaAuditing
@SpringBootApplication
public class ShopNearApplication {
public static void main(String[] args) {
SpringApplication.run(ShopNearApplication.class, args);
}
}
// Nearby search repository query shape
@Query(value = """
select s.*, ST_Distance(s.location, ST_SetSRID(ST_MakePoint(:lng, :lat), 4326)::geography) as distance_m
from shops s
where s.status = 'APPROVED'
and ST_DWithin(s.location, ST_SetSRID(ST_MakePoint(:lng, :lat), 4326)::geography, :radiusMeters)
order by distance_m asc
""", nativeQuery = true)
List<ShopDistanceProjection> findNearby(double lat, double lng, int radiusMeters);Run commands
Commands for the current frontend and the target complete stack.
# Frontend prototype in this workspace
npm install
npm run dev
# Target complete repository once backend/mobile/infra folders are materialized
docker compose up -d postgres redis
cd backend && ./mvnw spring-boot:run
cd frontend && npm run dev
cd mobile && flutter run