BusinessDirectory is an open-source, modern, fast, SEO-friendly business directory platform for developers who want to build specialized directory websites.
The platform originated from Geoscraper, a Google Maps scraping tool, and has evolved into a comprehensive business directory solution.
You can manage detailed business profiles, including reviews and ratings, and organize them into categories and subcategories.
Features
🎨 Modern UI/UX – Responsive design with beautiful interfaces and smooth user interactions.
🔍 Advanced Search & Filtering – Location-based search with category filtering and intelligent results.
🏢 Detailed Business Profiles – Complete business listings with reviews, ratings, and contact information.
📊 Category Management System – Organized business categories with subcategory support and hierarchical structure.
🚀 SEO Optimization – Built-in SEO features with meta tags, structured data, and search engine visibility.
☁️ Cloudflare Workers Deployment – Global edge computing with fast performance and automatic scaling.
🗄️ Multiple Database Support – PostgreSQL, D1, and SQLite compatibility with automatic schema management.
🐳 Docker Support – Containerized deployment with production-ready configurations and environment management.
Use Cases
- Local Business Directories – Create listings for restaurants, shops, and services in specific geographic areas.
- Industry-Specific Portals – Build specialized directories for real estate agents, healthcare providers, or professional services.
- Restaurant Finder Applications – Develop food discovery platforms with ratings, reviews, and location-based search.
- Service Provider Marketplaces – Connect customers with local contractors, consultants, and service professionals.
- Tourism and Travel Guides – Create destination-specific business listings for hotels, attractions, and local services.
How to Use It
1. Run the git clone https://github.com/chamuditha4/BusinessDirectory.git command to download the entire project repository.
2. Navigate into the project folder and install all the required dependencies. Execute pnpm install in your terminal.
3. Create a local environment file to store your configuration secrets. Create a copy of it by running cp .env.example .env.local. You will edit this file in the next step to add your database credentials.
4. The application supports multiple databases, but PostgreSQL is the recommended choice for production environments due to its robustness. You can set up a free or paid PostgreSQL database using a service like Supabase, Neon, or Railway.
5. Open the .env.local file you created earlier. You will see several lines starting with POSTGRES_. Fill in the values for POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB, POSTGRES_USER, and POSTGRES_PASSWORD with the credentials from your database provider. Set POSTGRES_SSL to true if your provider requires an SSL connection, which is common.
6. The business listings for your directory are sourced from a JSON file. The recommended way to get this data is by using the Geoscraper service, which scrapes information from Google Maps. After running a task on Geoscraper, you can download a JSON file containing the business data.
7. Rename the downloaded file to data.json and place it inside the data/ directory in the project’s root, replacing the existing sample file.
8. With the data file in place and your database configured, you need to sync the data. Run the command pnpm run sync-postgresql. This script will automatically create the required tables in your database and populate them with the information from your data.json file. It handles updates, additions, and removals intelligently.
9. You can customize the core aspects of your directory by editing the lib/config.ts file. This file contains a configuration object where you can change the directory’s name, tagline, and contact information. You can also adjust the site’s color scheme and modify the main navigation links.
The configuration file also allows you to enable or disable features. For instance, you can toggle the search functionality, category browsing, or the user review system by changing the boolean values in the features object within the configuration file.
10. To test your setup, run the development server with the command pnpm dev. Open your web browser and go to http://localhost:3000 to see your directory in action.
11. For production, you have two deployment options.
Option A: Deploy to Cloudflare Workers
This option allows you to deploy your application to Cloudflare’s global edge network.
First, build the project specifically for Cloudflare by running pnpm build-cloudflare.
Next, you need to configure your wrangler.toml file. Change the name property to your desired application name.
Then, add your production database credentials as environment variables under the [env.production.vars] section.
Finally, deploy the application by running pnpm deploy. You will also need to add these same environment variables in your Cloudflare Workers dashboard.
Option B: Deploy with Docker
If you prefer using containers, the project includes Docker support.
First, build the Docker image with the command docker build -t business-directory ..
To run the container for production, use the docker run command. You must pass your database credentials as environment variables using the -e flag.
A complete command would look like this:docker run -d --name business-directory -p 80:3000 -e NODE_ENV=production -e POSTGRES_HOST=your-db-host ... business-directory:latest
This command runs the container in detached mode, maps port 80 to the container’s port 3000, and sets the necessary environment variables for production.
Related Resources
- Next.js Documentation – Complete guide for the React framework powering BusinessDirectory with app router, server components, and deployment strategies.
- Tailwind CSS – Utility-first CSS framework documentation covering the styling system used throughout the platform.
- Cloudflare Workers – Edge computing platform documentation for deploying and scaling your business directory globally.
- Geoscraper – Google Maps scraping service for obtaining business data to populate your directory with real business listings.
FAQs
Q: How do I get business data for the directory?
A: The primary method for obtaining business data is through Geoscraper, a Google Maps scraping service. You can create a scraping task on their website, download the resulting JSON file, and use the provided scripts to sync it with your database.
Q: How do I update business listings after initial deployment?
A: Replace the data/data.json file with updated business information, then run the sync command pnpm run sync-postgresql. The system automatically processes changes, updates existing businesses, adds new entries, and removes outdated listings without manual database modifications.
Q: How does the search and filtering system work?
A: The platform provides location-based search with category filtering, business name searches, and geographical radius options. Search results include business ratings, contact information, and detailed profiles with automatic SEO optimization for better search engine visibility.






