An intelligent location-based search application with Smart chat interface that helps users discover nearby places like restaurants, hospitals, ATMs, and more.
- Natural language processing for location queries
- Conversational interface with typing indicators
- Smart parsing of categories and search radius
- Context-aware responses with helpful suggestions
- Real-time geolocation using browser API
- Support for 10+ place categories
- Customizable search radius (2-20 km)
- Google Places API integration
- Glassmorphism design with dark theme
- Responsive layout for mobile and desktop
- Smooth animations and transitions
- User-friendly error messages
- Clickable map links for each place
- Direct Google Maps navigation
- Place ratings and addresses
- Opens in new tab or Google Maps app
Prerequisites:
- Node.js 18+ installed
- Google Places API key
Steps:
# 1. Clone the repository
git clone <repository-url>
cd nearby-locator
# 2. Setup Backend
cd backend
npm install
# Create .env file and add: GOOGLE_API_KEY=your_key_here
node index.js
# 3. Setup Frontend (in new terminal)
cd frontend
npm install
npm startAccess: http://localhost:3000
Prerequisites:
- Docker and Docker Compose installed
- Google Places API key
Steps:
# 1. Clone the repository
git clone <repository-url>
cd nearby-locator
# 2. Create .env file
cp .env.example .env
# Edit .env and add: GOOGLE_API_KEY=your_key_here
# 3. Run with Docker
# Windows:
start-docker.bat
# Linux/Mac:
chmod +x start-docker.sh
./start-docker.shAccess: http://localhost:3000
- Features
- Quick Start
- Project Structure
- Technology Stack
- Configuration
- API Documentation
- Docker Setup
- Development
- Deployment
- Troubleshooting
- Contributing
- License
nearby-locator-Smart Search/
βββ backend/ # Node.js Express API
β βββ index.js # Main server file
β βββ config.js # Configuration
β βββ package.json # Dependencies
β βββ Dockerfile # Docker configuration
β βββ .env # Environment variables (not in git)
β
βββ frontend/ # React application
β βββ src/
β β βββ App.js # Main React component
β β βββ components/ # React components
β β βββ icons/ # SVG icon components
β β βββ index.js # Entry point
β βββ public/ # Static assets
β βββ package.json # Dependencies
β βββ Dockerfile # Production Docker (with Nginx)
β βββ Dockerfile.dev # Development Docker (no Nginx)
β βββ nginx.conf # Nginx configuration
β
βββ docker-compose.yml # Production Docker setup
βββ docker-compose.dev.yml # Development Docker setup
βββ .env.example # Environment template
βββ start-docker.bat # Windows production start script
βββ start-docker.sh # Linux/Mac production start script
βββ start-docker-dev.bat # Windows development start script
βββ start-docker-dev.sh # Linux/Mac development start script
βββ README.md # This file
- React 19.2.0 - UI framework
- Tailwind CSS - Utility-first styling
- Node.js 18+ - Runtime environment
- Express.js - Web framework
- Axios - HTTP client
- CORS - Cross-origin resource sharing
- Google Places API - Location data
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Nginx - Production web server
File: backend/.env
GOOGLE_API_KEY=your_google_api_key_hereGet Google API Key:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable "Places API"
- Create credentials (API Key)
- Copy key to
.envfile
File: frontend/.env.production
REACT_APP_BACKEND_URL=http://localhost:5000For production deployment, update to your backend URL:
REACT_APP_BACKEND_URL=https://api.yourdomain.comFind nearby places based on location and category.
Request:
{
"latitude": 28.6139,
"longitude": 77.2090,
"category": "restaurant",
"radius": 2
}Response:
{
"status": "success",
"results": [
{
"name": "Pizza Palace",
"address": "123 Main Street",
"rating": 4.5,
"map_url": "https://www.google.com/maps/dir/?api=1&origin=..."
}
]
}Error Response:
{
"status": "error",
"message": "User-friendly error message"
}Health check endpoint for monitoring.
Response:
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00.000Z"
}restaurant- Restaurantshospital- Hospitalspharmacy- Pharmaciesatm- ATMsgas_station- Gas Stationsschool- Schoolsshopping_mall- Shopping Mallsbank- Bankscafe- Cafeslodging- Hotels
Optimized for deployment:
- Small image size (25MB frontend)
- Nginx web server
- Static file caching
- Gzip compression
# Windows
start-docker.bat
# Linux/Mac
./start-docker.sh
# Or manually
docker-compose up --buildOptimized for development:
- Hot reload enabled
- React dev server
- Volume mounting
- Easy debugging
# Windows
start-docker-dev.bat
# Linux/Mac
./start-docker-dev.sh
# Or manually
docker-compose -f docker-compose.dev.yml up --buildSee: DOCKER_SCRIPTS_GUIDE.md for detailed explanation
Backend:
cd backend
npm install
node index.jsFrontend:
cd frontend
npm install
npm startdocker-compose -f docker-compose.dev.yml upFrontend changes:
- Edit files in
frontend/src/ - Changes reflect automatically with hot reload
Backend changes:
- Edit files in
backend/ - Restart server:
Ctrl+Cthennode index.js - Or use nodemon:
npm install -g nodemonthennodemon index.js
Frontend:
cd frontend
npm testBackend:
cd backend
# Add your tests
npm test1. Build production images:
docker-compose build2. Tag images:
docker tag nearby-locator-backend:latest your-registry/backend:v1.0
docker tag nearby-locator-frontend:latest your-registry/frontend:v1.03. Push to registry:
docker push your-registry/backend:v1.0
docker push your-registry/frontend:v1.0Vercel (Frontend):
cd frontend
vercel deployRender (Backend):
- Connect GitHub repository
- Set environment variables
- Deploy
AWS ECS / Google Cloud Run / Azure:
- Use Docker images
- Configure environment variables
- Set up load balancer
- Enable HTTPS
Cause: Invalid or missing Google API key
Solution:
- Check
backend/.envhas validGOOGLE_API_KEY - Verify Places API is enabled in Google Cloud Console
- Restart backend server
Cause: No results in the area or API error
Solution:
- Try increasing search radius
- Try different category
- Check backend logs:
docker-compose logs backend
Cause: Another service using port 3000 or 5000
Solution:
# Windows
netstat -ano | findstr :3000
# Kill the process
# Linux/Mac
lsof -i :3000
kill -9 <PID>Cause: Missing dependencies or network issues
Solution:
# Clean rebuild
docker-compose down -v
docker-compose build --no-cache
docker-compose up- Check logs:
docker-compose logs -f - Verify environment:
cat .env - Check service health:
curl http://localhost:5000/health - Review documentation in
/docsfolder
- START_HERE.md - Simple getting started guide
- DOCKER_SCRIPTS_GUIDE.md - Docker scripts explained
- README_DOCKER.md - Complete Docker guide
- DOCKER_SETUP.md - Detailed Docker setup
- WHICH_DOCKER_SETUP.md - Choosing Docker setup
- ERROR_HANDLING_GUIDE.md - Error messages guide
- RESPONSE_PREVIEW.md - UI response preview
- Natural language understanding
- Typing indicators
- Message timestamps
- User and bot avatars
- Quick action buttons
- Distance selector
- Location permission handling
- Place cards with details
- Star ratings
- Clickable map links
- Google Maps integration
- Responsive design
- Environment variables for sensitive data
- CORS configuration
- Security headers (Nginx)
- Input validation
- Error message sanitization
- No sensitive data in logs
- Code splitting
- Lazy loading
- Image optimization
- Gzip compression (production)
- Static asset caching (production)
- Efficient API calls
- Error handling
- Health checks
- Logging
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work
- Google Places API for location data
- React team for the framework
- Tailwind CSS for styling
- Docker for containerization
For support, email support@example.com or open an issue on GitHub.
- Add more place categories
- Implement user favorites
- Add place reviews
- Multi-language support
- Mobile app (React Native)
- Offline mode
- Advanced filters
- Social sharing
- Lines of Code: ~3,000+
- Components: 10+
- API Endpoints: 2
- Docker Images: 2
- Supported Categories: 10+
Made with β€οΈ using React, Node.js, and Docker
β If you find this project useful, please give it a star!