ShopLocal is a modern full-stack local commerce platform that helps users discover nearby shops and weekly markets in their area. Users can explore local businesses, search and filter shops, browse products, view locations on interactive maps, manage their cart, place orders, and review shops, products, and markets, while shop owners can manage their business through a dedicated seller dashboard with product, order, customer, review, analytics, and shop management features.
- πͺ Overview
- π Live Demo
- π Features
- π Location-Based Shop Discovery
- πΊοΈ Maps & Location Services
- ποΈ Shopping & Orders
- πͺ Weekly Markets
- π€ Community Contributions
- π Seller Dashboard
- β Reviews & Ratings
- π Authentication & Security
- βοΈ Image Uploads & Media
- π How It Works
- π οΈ Tech Stack
- π Project Architecture
- π‘ API Endpoints
- π§ Local Setup for Developers
- π Documentation
- π¨βπ» Developer
ShopLocal is a full-stack local commerce and discovery platform designed to connect customers with nearby shops and recurring weekly markets.
The platform allows users to discover local shops, search for products and businesses, view detailed shop information, find weekly markets, check locations on interactive maps, browse products, add items to their cart, place orders, and share their experience through reviews.
ShopLocal also provides a dedicated seller experience where shop owners can register their business and manage their shop, products, orders, customers, reviews, analytics, and settings from a centralized dashboard.
The platform also includes a community contribution system, allowing authenticated users to contribute information about local shops and weekly markets that can be added to the platform.
πͺ Built with the MERN stack, ShopLocal demonstrates practical full-stack development, geolocation-based discovery, MongoDB geospatial queries, interactive maps, e-commerce functionality, authentication, cloud image storage, REST APIs, and responsive UI development.
π Access ShopLocal live here: Visit ShopLocal
-
πͺ Local Shop Discovery
- Discover local shops and explore detailed shop information.
-
π Search & Filtering
- Search across shops, products, and weekly markets and explore available results using relevant filters.
-
π Location-Based Discovery
- Use the user's current location to find nearby shops and calculate their distance.
-
πΊοΈ Interactive Maps
- View shop and market locations using MapLibre and MapTiler.
-
ποΈ Product Browsing
- Browse products offered by local shops and view individual product details.
-
π Shopping Cart
- Add products to the cart, update quantities, remove products, and review the cart before checkout.
-
π³ Checkout & Orders
- Enter delivery information, select available payment methods, and place orders.
-
π¦ Order Management
- Customers can view their orders and cancel eligible orders, while sellers can manage incoming orders and update their status.
-
πͺ Weekly Markets
- Discover recurring weekly markets with information about their location, Market schedule, and category.
-
π€ Community Contributions
- Authenticated users can contribute local shops and weekly markets to the platform.
-
π Seller Dashboard
- Shop owners can manage their shop, products, orders, customers, reviews, analytics, and settings.
-
β Reviews & Ratings
- Users can review shops, products, and markets, while sellers can reply to reviews.
-
π Secure Authentication
- Separate customer and seller authentication with JWT-based protected routes and password hashing.
-
βοΈ Cloud Image Uploads
- Shop, product, market, and contribution images can be uploaded and stored using Cloudinary.
-
π± Responsive Interface
- The application adapts to desktop, tablet, and mobile screen sizes.
-
β οΈ Error Handling- Handles authentication, API, validation, location, and other application errors with user-friendly feedback.
Location-based discovery is one of the main features of ShopLocal.
The platform can use the user's browser location or a manually entered location to obtain latitude and longitude for finding nearby shops.
ShopLocal supports two ways to provide a location:
User Location
|
ββββββββββββ΄βββββββββββ
| |
v v
Allow Location Enter Location
Access Manually
| |
v v
Browser Geolocation Forward Geocoding
API (Nominatim)
| |
ββββββββββββ¬βββββββββββ
|
v
Latitude + Longitude
|
v
ShopLocal Backend
|
v
MongoDB Geospatial Query
|
v
Nearby Shops
|
v
Distance in Kilometers
When the user allows location access, ShopLocal uses the browser's Geolocation API to obtain the user's current latitude and longitude.
If the user does not want to use their current location, they can enter a location manually.
ShopLocal sends the entered location to the OpenStreetMap Nominatim API for forward geocoding.
Manual Location
|
v
Nominatim Forward Geocoding
|
v
Latitude + Longitude
|
v
Nearby Shop Search
The application uses the Nominatim base URL:
https://nominatim.openstreetmap.org
This converts a location such as a city, area, or address into geographic coordinates that can be used for nearby-shop discovery.
ShopLocal stores shop locations as GeoJSON Point coordinates.
The coordinate structure is:
[longitude, latitude]
The backend uses MongoDB's 2dsphere geospatial index and $geoNear aggregation to find shops based on their distance from the user's location.
The backend first calculates the distance in meters and then converts it into kilometers before returning the shop data.
User Coordinates
|
v
MongoDB $geoNear
|
v
distanceMeters
|
v
distanceKm
|
v
Nearby Shop Results
This allows ShopLocal to display shops according to their actual geographic distance instead of simply filtering by city or area.
The nearby-shop API accepts a distance parameter and uses a default search radius when no specific distance is provided.
This makes it possible to request shops within a particular geographic range around the user's selected or current location.
User Location
|
v
Search Radius
|
v
MongoDB Geospatial Query
|
v
Shops Within Radius
This location-based approach helps users discover relevant local shops based on their actual geographic proximity.
ShopLocal uses interactive maps to make local discovery easier.
The frontend uses:
- MapLibre GL
- MapTiler
The map can display the location of shops and markets using their latitude and longitude coordinates.
Shop / Market
|
v
Latitude + Longitude
|
v
MapLibre GL
|
v
MapTiler Map Style
|
v
Interactive Location
Shop addresses can be converted into geographic coordinates using OpenStreetMap Nominatim.
ShopLocal supports:
- Forward geocoding
- Reverse geocoding
- Address formatting
- Latitude and longitude handling
Address
|
v
Nominatim
|
v
Latitude + Longitude
Latitude + Longitude
|
v
Nominatim
|
v
Readable Address
This allows the application to work with both human-readable addresses and geographic coordinates.
ShopLocal provides a complete shopping flow for products offered by local shops.
Shop
|
v
Browse Products
|
v
Product Details
|
v
Add to Cart
|
v
Cart
|
v
Checkout
|
v
Place Order
|
v
Order Success
Users can:
- Browse products
- View product details
- Add products to their cart
- Change product quantities
- Remove products
- Review cart totals
- Enter delivery information
- Select available payment methods
- Place orders
- View previous orders
- Cancel eligible orders
Orders contain information such as:
- Customer
- Seller
- Shop
- Ordered products
- Product quantities
- Product prices
- Subtotal
- Delivery fee
- Total amount
- Delivery address
- Payment method
- Order status
- Cancellation information
The order stores the relevant product information at the time the order is created so that the order remains consistent even if product information changes later.
ShopLocal is not limited to permanent shops.
The platform also helps users discover weekly and recurring local markets.
Users can view market information such as:
- Market name
- Description
- Category
- Address
- City
- State
- Pincode
- Latitude
- Longitude
- Market schedule
- Reviews
- Market images
Weekly Markets
|
v
Search / Explore
|
v
Market Card
|
v
Market Details
|
+---- Location
|
+---- Schedule
|
+---- Contact
|
+---- Reviews
Markets have dedicated listing and detail pages so that users can explore them separately from local shops.
ShopLocal allows authenticated users to contribute information about local shops and weekly markets.
This helps expand the platform beyond businesses that are already registered by sellers.
Users can contribute:
Local Shop
OR
Weekly Market
A shop contribution can include information such as:
- Shop name
- Category
- Description
- About
- Address
- City
- State
- Pincode
- Phone
- Opening time
- Closing time
- Latitude
- Longitude
- Shop logo
- Shop banner
- Gallery images
A market contribution can include:
- Market name
- Description
- Category
- Address
- City
- State
- Pincode
- Market day
- Start time
- End time
- Latitude
- Longitude
- Phone
- Market image
Authenticated User
|
v
Contribution Form
|
v
Client-side Validation
|
v
POST /api/contributions
|
v
Authentication Check
|
v
Server-side Validation
|
v
Image Upload
|
v
Create Shop / Market
|
v
Create Contribution Record
|
v
Approved Contribution
The contribution backend validates the submitted data and geographic coordinates before creating the corresponding Shop or Market document.
Uploaded contribution images are stored in Cloudinary.
The contribution record stores information about the submitting user and the document created from the contribution.
Currently, contributed shops and markets are automatically approved after successful validation and creation.
ShopLocal provides a separate dashboard for shop owners.
The seller dashboard gives shop owners a centralized place to manage their business.
Sellers can create and manage their shop information, including:
- Shop name
- Category
- Description
- Contact information
- Address
- Opening hours
- Shop images
- Delivery and takeaway options
- Payment methods
- Other shop information
Sellers can:
- Add products
- Edit products
- Delete products
- Search products
- Filter products
- Manage product information
- Manage availability
- Manage stock
- Upload product images
Sellers can:
- View incoming orders
- Search orders
- Filter orders
- View order details
- Update order status
Sellers can:
- View customers
- Search customers
- Filter customers
- View customer details
- View customer order information
Sellers can:
- View shop reviews
- View product reviews
- Search reviews
- Filter reviews by rating
- View review details
- Reply to customer reviews
The analytics section provides seller-focused information such as:
- Sales information
- Order performance
- Customer insights
- Top products
- Sales charts
Sellers can manage account, shop, order, and notification-related settings from the settings section.
ShopLocal allows authenticated users to submit reviews for supported platform entities.
Reviews can contain:
- Rating
- Comment
- Target type
- Target ID
The platform supports reviews for:
- Shops
- Products
- Markets
User
|
v
Shop / Product / Market
|
v
Write Review
|
v
Rating + Comment
|
v
Review API
|
v
MongoDB
|
v
Review Display
Sellers can also reply to customer reviews from their dashboard.
This allows communication between customers and shop owners while keeping reviews connected to the relevant shop or product.
ShopLocal uses separate authentication systems for customers and sellers.
Customer authentication supports:
- Signup
- Login
- Current-user access
- Profile updates
- Password updates
- Logout
Customer routes are protected using authentication middleware.
Seller authentication supports:
- Seller registration
- Seller login
- Current-seller access
- Seller profile updates
- Password changes
- Logout
Seller dashboard routes are protected using dedicated seller authentication middleware.
JSON Web Tokens are used to authenticate protected API requests.
The frontend stores separate authentication tokens for customers and sellers and sends the appropriate token when communicating with protected backend routes.
Customer
|
v
Customer Login
|
v
JWT Token
|
v
Protected Customer Routes
Seller
|
v
Seller Login
|
v
JWT Token
|
v
Protected Seller Routes
Passwords are hashed using bcryptjs before being stored in the database.
Plain-text passwords are not stored directly.
The backend uses:
- Helmet for security-related HTTP headers
- CORS for controlled cross-origin communication
- JWT for protected authentication
- bcryptjs for password hashing
- Environment variables for sensitive configuration
- Authentication middleware for protected resources
ShopLocal uses Cloudinary for cloud-based image storage.
Images are used for:
- Shop banners
- Shop logos
- Shop gallery images
- Product images
- Market images
- Community contribution images
Frontend
|
v
Image Selection
|
v
Multipart Form Data
|
v
Express Backend
|
v
Multer
|
v
Cloudinary
|
v
Image URL
|
v
MongoDB Document
The backend uses Multer and Cloudinary integration to process uploaded images and store their resulting URLs with the relevant application data.
ShopLocal follows a frontend β backend β database/services β backend β frontend architecture.
-
User opens ShopLocal
- The React frontend loads the application.
-
User chooses a location
- The browser can provide the user's current latitude and longitude.
-
User explores shops or markets
- The frontend requests shop or market data from the backend API.
-
Backend processes the request
- Express routes and controllers handle the request.
-
MongoDB provides application data
- Shop, product, market, review, user, seller, and order information is stored in MongoDB.
-
Location requests use geospatial queries
- Nearby shop requests can use MongoDB
$geoNearand the shop's 2dsphere index.
- Nearby shop requests can use MongoDB
-
Frontend displays the results
- React renders the shops, products, markets, maps, and other information.
-
Customer can shop
- Products can be added to the cart and ordered through checkout.
-
Seller manages the business
- Sellers use the protected dashboard to manage their shop and customer activity.
ββββββββββββββββββββ
β User β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β React Frontend β
β + Vite β
ββββββββββ¬ββββββββββ
β
β REST API
βΌ
ββββββββββββββββββββ
β Express Backend β
β + Node.js β
βββββββββ¬βββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β MongoDB β β Cloudinary β β Geocoding β
β Database β β Images β β Services β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
-
React.js
- Builds the interactive customer and seller interfaces.
-
Vite
- Provides the frontend development server and production build system.
-
Tailwind CSS
- Provides utility-based styling for the responsive user interface.
-
React Router
- Handles client-side routing between public, customer, authentication, and seller dashboard pages.
-
Axios
- Handles communication between the frontend and backend API.
-
TanStack React Query
- Supports API data fetching and server-state management.
-
React Helmet Async
- Manages page metadata and document information.
-
Lucide React
- Provides interface icons.
-
React Icons
- Provides additional icons used throughout the application.
-
Recharts
- Used for seller analytics and data visualization.
-
MapLibre GL
- Provides interactive maps and location visualization.
-
Node.js
- Provides the server-side JavaScript runtime.
-
Express.js
- Handles backend routing, middleware, and REST API endpoints.
-
Multer
- Handles multipart file uploads.
-
Cloudinary
- Stores uploaded images in the cloud.
-
CORS
- Controls cross-origin communication between the frontend and backend.
-
Morgan
- Logs HTTP requests during development.
-
Dotenv
- Loads environment variables from
.env.
- Loads environment variables from
-
MongoDB
- Stores users, sellers, shops, products, orders, markets, reviews, addresses, and contribution records.
-
Mongoose
- Provides schemas, models, validation, and MongoDB interaction.
-
MongoDB Geospatial Indexes
- Support location-based shop discovery using GeoJSON and 2dsphere indexing.
-
JSON Web Token
- Provides authentication tokens for protected customer and seller routes.
-
bcryptjs
- Hashes user and seller passwords.
-
Helmet
- Adds security-related HTTP headers.
The project follows a modular architecture that keeps ShopLocal scalable, maintainable, and easy to extend.
ShopLocal-Full-Stack-Local-Commerce-Platform/
β
βββ .gitignore
βββ README.md
β
βββ client/
| βββ .env
β βββ eslint.config.js
β βββ index.html
β βββ package-lock.json
β βββ package.json
β βββ vercel.json
β βββ vite.config.js
β β
β βββ src/
β βββ main.jsx
β β
β βββ app/
β β βββ App.jsx
β β βββ providers.jsx
β β βββ router.jsx
β β
β βββ assets/
β β βββ herosection.png
β β βββ logo.png
β β
β βββ modules/
β β β
β β βββ about/
β β β βββ components/
β β β β βββ AboutCTA.jsx
β β β β βββ AboutCustomers.jsx
β β β β βββ AboutFeatures.jsx
β β β β βββ AboutHero.jsx
β β β β βββ AboutHowItWorks.jsx
β β β β βββ AboutMission.jsx
β β β β βββ AboutShopOwners.jsx
β β β β
β β β βββ pages/
β β β βββ AboutPage.jsx
β β β
β β βββ auth/
β β β βββ pages/
β β β βββ LoginPage.jsx
β β β βββ SellerLoginPage.jsx
β β β βββ SellerRegisterPage.jsx
β β β βββ SignupPage.jsx
β β β
β β βββ cart/
β β β βββ components/
β β β β βββ CartItem.jsx
β β β β βββ CartSummary.jsx
β β β β
β β β βββ pages/
β β β βββ CartPage.jsx
β β β βββ CheckoutPage.jsx
β β β βββ OrderSuccessPage.jsx
β β β
β β βββ dashboard/
β β β βββ components/
β β β β βββ header/
β β β β β βββ DashboardHeader.jsx
β β β β β
β β β β βββ sidebar/
β β β β β βββ DashboardSidebar.jsx
β β β β β
β β β β βββ LogoutModal.jsx
β β β β
β β β βββ pages/
β β β β
β β β βββ analytics/
β β β β βββ AnalyticsPage.jsx
β β β β βββ components/
β β β β βββ AnalyticsStatCard.jsx
β β β β βββ CustomerInsights.jsx
β β β β βββ OrderPerformance.jsx
β β β β βββ SalesChart.jsx
β β β β βββ TopProducts.jsx
β β β β
β β β βββ customers/
β β β β βββ CustomersPage.jsx
β β β β βββ components/
β β β β βββ CustomerDetailsModal.jsx
β β β β βββ CustomerFilters.jsx
β β β β βββ CustomerStatusBadge.jsx
β β β β βββ CustomerTable.jsx
β β β β
β β β βββ dashboardhome/
β β β β βββ DashboardHome.jsx
β β β β
β β β βββ orders/
β β β β βββ OrdersPage.jsx
β β β β βββ components/
β β β β βββ OrderDetailsModal.jsx
β β β β βββ OrderFilters.jsx
β β β β βββ OrderStatusBadge.jsx
β β β β βββ OrderTable.jsx
β β β β
β β β βββ products/
β β β β βββ ProductsPage.jsx
β β β β βββ components/
β β β β βββ ProductCard.jsx
β β β β βββ ProductDeleteModal.jsx
β β β β βββ ProductForm.jsx
β β β β βββ ProductList.jsx
β β β β
β β β βββ reviews/
β β β β βββ ReviewsPage.jsx
β β β β βββ components/
β β β β βββ ProductReviews.jsx
β β β β βββ ReviewDetailsModal.jsx
β β β β βββ ReviewFilters.jsx
β β β β βββ ReviewRatingBadge.jsx
β β β β βββ ReviewSummary.jsx
β β β β βββ ShopReviews.jsx
β β β β
β β β βββ settings/
β β β β βββ SettingsPage.jsx
β β β β βββ components/
β β β β βββ AccountSettings.jsx
β β β β βββ NotificationSettings.jsx
β β β β βββ OrderSettings.jsx
β β β β βββ SettingsSection.jsx
β β β β βββ ShopSettings.jsx
β β β β
β β β βββ ShopInfo/
β β β βββ ShopInfoPage.jsx
β β β βββ components/
β β β βββ RegisterShopModal.jsx
β β β βββ ShopForm.jsx
β β β βββ ShopInformation.jsx
β β β
β β βββ home/
β β β βββ components/
β β β β βββ CategorySection.jsx
β β β β βββ HeroSection.jsx
β β β β βββ HowItWorksSection.jsx
β β β β βββ NearbyShopsSection.jsx
β β β β βββ ShopOwnerCTASection.jsx
β β β β βββ WeeklyMarketsSection.jsx
β β β β
β β β βββ pages/
β β β βββ HomePage.jsx
β β β
β β βββ maps/
β β β βββ components/
β β β βββ MapLibreMap.jsx
β β β
β β βββ markets/
β β β βββ components/
β β β β βββ MarketFilters.jsx
β β β β βββ MarketGrid.jsx
β β β β βββ MarketHero.jsx
β β β β βββ MarketInfo.jsx
β β β β βββ MarketLocation.jsx
β β β β βββ MarketSearch.jsx
β β β β
β β β βββ pages/
β β β βββ MarketDetailsPage.jsx
β β β βββ MarketsPage.jsx
β β β
β β βββ reviews/
β β β βββ components/
β β β βββ ReviewForm.jsx
β β β βββ ReviewItem.jsx
β β β βββ ReviewList.jsx
β β β βββ ReviewSection.jsx
β β β
β β βββ shops/
β β β βββ components/
β β β β βββ ProductCard.jsx
β β β β βββ ProductDescription.jsx
β β β β βββ ProductDetailsHero.jsx
β β β β βββ ProductPurchaseCard.jsx
β β β β βββ ProductSpecifications.jsx
β β β β βββ RelatedProducts.jsx
β β β β βββ ShopCard.jsx
β β β β
β β β βββ pages/
β β β β βββ ProductDetailsPage.jsx
β β β β βββ ShopDetailsPage.jsx
β β β β βββ ShopsPage.jsx
β β β β
β β β βββ sections/
β β β βββ LocationSection.jsx
β β β βββ ProductSection.jsx
β β β βββ ShopBanner.jsx
β β β βββ ShopOverviewSection.jsx
β β β βββ ShopsFilterSection.jsx
β β β βββ ShopsGrid.jsx
β β β βββ ShopsHero.jsx
β β β βββ SimilarShopsSection.jsx
β β β
β β βββ user/
β β βββ MyProfile.jsx
β β βββ Orders.jsx
β β
β βββ services/
β β βββ api.js
β β βββ authService.js
β β βββ locationService.js
β β βββ shopService.js
β β
β βββ shared/
β β βββ components/
β β β βββ ContributionPage.jsx
β β β βββ LocationModal.jsx
β β β βββ PageNotFoundPage.jsx
β β β βββ ProtectedRoute.jsx
β β β βββ ProtectedSellerRoute.jsx
β β β βββ QuickActionCards.jsx
β β β β
β β β βββ navigation/
β β β βββ Footer.jsx
β β β βββ Navbar.jsx
β β β
β β βββ context/
β β β βββ AuthContext.jsx
β β β βββ CartContext.jsx
β β β βββ LocationContext.jsx
β β β βββ ReviewContext.jsx
β β β
β β βββ layouts/
β β β βββ DashboardLayout.jsx
β β β βββ PublicLayout.jsx
β β β
β β βββ meta/
β β β βββ MetaWrapper.jsx
β β β βββ PageMeta.jsx
β β β βββ pageTitles.js
β β β
β β βββ utils/
β β βββ distance.js
β β
β βββ styles/
β βββ animations.css
β βββ globals.css
β βββ variables.css
β
βββ server/
βββ .env
βββ package-lock.json
βββ package.json
β
βββ src/
βββ app.js
βββ server.js
β
βββ config/
β βββ cloudinary.js
β βββ db.js
β
βββ controllers/
β βββ analyticsController.js
β βββ contributionController.js
β βββ customerController.js
β βββ marketController.js
β βββ orderController.js
β βββ productController.js
β βββ reviewController.js
β βββ sellerAuthController.js
β βββ sellerSettingsController.js
β βββ shopController.js
β βββ userAddressController.js
β βββ userAuthController.js
β
βββ init/
β βββ data.js
β βββ index.js
β
βββ middleware/
β βββ sellerAuthMiddleware.js
β βββ uploadMiddleware.js
β βββ userAuthMiddleware.js
β
βββ models/
β βββ Market.js
β βββ Order.js
β βββ Product.js
β βββ Review.js
β βββ Seller.js
β βββ Shop.js
β βββ User.js
β βββ UserContribution.js
β
βββ routes/
β βββ analyticsRoutes.js
β βββ contributionRoutes.js
β βββ customerRoutes.js
β βββ marketRoutes.js
β βββ orderRoutes.js
β βββ productRoutes.js
β βββ reviewRoutes.js
β βββ sellerAuthRoutes.js
β βββ sellerSettingsRoutes.js
β βββ sellerShopRoutes.js
β βββ shopRoutes.js
β βββ userAddressRoutes.js
β βββ userAuthRoutes.js
β
βββ utils/
βββ geocodeAddress.js
βββ token.js
βββ uploadToCloudinary.js
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/user/signup |
Register a customer account |
| POST | /api/auth/user/login |
Login as a customer |
| GET | /api/auth/user/me |
Get the authenticated customer |
| PUT | /api/auth/user/profile |
Update customer profile |
| PUT | /api/auth/user/password |
Change customer password |
| POST | /api/auth/user/logout |
Logout the customer |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/seller/signup |
Register a seller account |
| POST | /api/auth/seller/login |
Login as a seller |
| GET | /api/auth/seller/me |
Get the authenticated seller |
| PUT | /api/auth/seller/profile |
Update seller profile |
| PUT | /api/auth/seller/password |
Change seller password |
| POST | /api/auth/seller/logout |
Logout the seller |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shops |
Get available shops |
| GET | /api/shops/:id |
Get a specific shop |
| POST | /api/seller/shop |
Create a seller shop |
| GET | /api/seller/shop |
Get the seller's shop |
| PUT | /api/seller/shop |
Update the seller's shop |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/products |
Get products |
| GET | /api/products/:id |
Get a specific product |
| GET | /api/products/seller |
Get seller products |
| POST | /api/products |
Create a product |
| PUT | /api/products/:id |
Update a product |
| DELETE | /api/products/:id |
Delete a product |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/orders |
Create an order |
| GET | /api/orders/my |
Get customer's orders |
| GET | /api/orders/:id |
Get a customer's order |
| PUT | /api/orders/:id/cancel |
Cancel a customer order |
| GET | /api/orders/seller |
Get seller orders |
| GET | /api/orders/seller/:id |
Get seller order details |
| PUT | /api/orders/seller/:id/status |
Update seller order status |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/customers |
Get seller customers |
| GET | /api/customers/:id |
Get customer details |
| GET | /api/customers/:id/orders |
Get customer's orders |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/markets |
Get weekly markets |
| GET | /api/markets/:id |
Get a specific market |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/reviews/:targetType/:targetId |
Get reviews for a target |
| POST | /api/reviews |
Create a review |
| GET | /api/reviews/my |
Get the customer's reviews |
| PUT | /api/reviews/:id |
Update a review |
| DELETE | /api/reviews/:id |
Delete a review |
| GET | /api/reviews/seller |
Get seller reviews |
| PUT | /api/reviews/:id/reply |
Reply to a review |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/contributions |
Submit a shop or market contribution |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/seller/analytics |
Get seller analytics |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/seller/settings |
Get seller settings |
| PUT | /api/seller/settings |
Update seller settings |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users/me/addresses |
Get saved addresses |
| POST | /api/users/me/addresses |
Add an address |
| PUT | /api/users/me/addresses/:id |
Update an address |
| DELETE | /api/users/me/addresses/:id |
Delete an address |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Check whether the ShopLocal API is running |
All API routes were tested using Thunder Client.
- Fork the repository on GitHub and clone it
git clone <your-forked-repo-url>- Install backend dependencies
cd server
npm install- Install frontend dependencies
Open another terminal:
cd client
npm install- Set up environment variables
Create a .env file inside the server folder.
PORT=5000
NODE_ENV=development
MONGO_URI=your-mongodb-connection-string
JWT_SECRET=your-jwt-secret
JWT_EXPIRES_IN=7d
CLIENT_URL=http://localhost:5173
CLOUD_NAME=your-cloudinary-cloud-name
CLOUD_API_KEY=your-cloudinary-api-key
CLOUD_API_SECRET=your-cloudinary-api-secret
JWT_SECRETcan be any random string used to sign authentication tokens.
Create a .env file inside the client folder.
VITE_API_URL=http://localhost:5000/api
VITE_MAPTILER_API_KEY=your-maptiler-api-key- Start the development servers
Backend:
Inside the server folder:
cd server
npm run devFrontend:
Inside the client folder:
cd client
npm run devBoth servers run in development mode. The frontend port may vary depending on your system.
- Visit the application
Open the URL displayed in the terminal (usually http://localhost:5173) in your browser to use the frontend.
- Build for production
Inside the client folder:
cd client
npm run buildThis creates an optimized production build of the frontend.
- Preview the production build
After building the frontend, run:
npm run previewThe terminal will display the URL where you can preview the production build.
π Complete project documentation link will be added soon.
| Developed by | GitHub | |
|---|---|---|
| Harshal Waghmare | GitHub |