Skip to content

iamrahulroyy/NearBuy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧭 NearBuy – Hyperlocal Shop Finder

NearBuy is a location-based application that helps users discover nearby shops (within a 2–5 meter radius) that stock specific items β€” like β€œMaggie”, β€œbatteries”, or β€œcoffee sachets” β€” with real-time availability, quantity, and shop status.

The project consists of a robust FastAPI backend and a modern Next.js frontend.


✨ Features

  • ⚑ Fast Geo-Search: Powered by Typesense, find shops within a given radius that stock a specific item.
  • πŸ›’ Real-Time Inventory: Track stock levels per shop, per item.
  • πŸ“ Accurate Spatial Queries: Uses PostGIS for precise location data management.
  • πŸ—ΊοΈ Interactive Maps: Visualize shop locations and search results on a map.
  • πŸ” Role-Based Auth: Secure cookie-based authentication for Users, Vendors, and Contributors.
  • πŸ“± Modern UI: Responsive design built with Next.js, Tailwind CSS, and Framer Motion.
  • 🐳 Fully Containerized: Docker support for consistent development and deployment.

πŸ› οΈ Tech Stack

Backend

  • Framework: FastAPI
  • Database: PostgreSQL + PostGIS
  • Search: Typesense
  • ORM: SQLAlchemy (Async) + SQLModel
  • Migrations: Alembic

Frontend

  • Framework: Next.js 16 (App Router)
  • Styling: Tailwind CSS v4
  • Maps: Leaflet (React Leaflet)
  • State/Validation: React Hook Form, Zod

πŸš€ Getting Started

Prerequisites

  • Docker & Docker Compose
  • Node.js 18+ (for local frontend)
  • Python 3.10+ (for local backend)

🐳 Run with Docker (Recommended)

The easiest way to run the full stack (Backend + DB + Search) is via Docker.

# Clone the repository
git clone https://github.com/iamrahulroyy/NearBuy
cd NearBuy

# Start the services
docker-compose up --build

πŸ’» Local Development

Backend

cd NearBuy
# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

# Install dependencies
pip install -r requirements.txt

# Run the server
python main.py

Frontend

cd frontend
# Install dependencies
npm install

# Run the development server
npm run dev

πŸ—‚οΈ Project Structure

NEARBUY/
β”œβ”€β”€ app/                 # Backend Source Code
β”‚   β”œβ”€β”€ api/             # API Endpoints
β”‚   β”œβ”€β”€ core/            # Config & Security
β”‚   β”œβ”€β”€ db/              # Database Models
β”‚   └── services/        # Business Logic
β”œβ”€β”€ frontend/            # Frontend Source Code
β”‚   β”œβ”€β”€ src/app/         # Next.js Pages
β”‚   └── src/components/  # UI Components
β”œβ”€β”€ scripts/             # Seeding & Utility Scripts
β”œβ”€β”€ alembic/             # Database Migrations
β”œβ”€β”€ docker-compose.yml   # Docker Services Config
└── README.md            # Project Documentation

🀝 Contributing

Pull requests are welcome! Please ensure your code follows the project's style guidelines.

πŸ“œ License

MIT Β© Rahul Roy

About

Open-source project – You're welcome to explore, modify, and contribute. Open to community improvements, suggestions, and collaboration. πŸš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors