AI-powered local competitor analysis platform
Competitor Watcher helps businesses understand their competitive landscape by analyzing nearby competitors using Google Places data and AI-driven insights. Register your business, generate comprehensive reports, and make data-driven decisions to stay ahead of the competition.
- Real-time competitor discovery using Google Places API
- Detailed competitor profiles with ratings, reviews, and contact information
- Geographic visualization of competitors on interactive maps
- Advanced AI insights including SWOT Analysis, Market Trends, Target Audience Persona, and Marketing Strategy
- Beautiful, responsive UI with dark mode support
- Multi-language support (English, Portuguese, Spanish, French, German)
- Real-time updates and interactive dashboards
- High-fidelity Export (HTML with Tailwind CSS, PDF) for professional reports
- Email/Password authentication with secure bcrypt hashing
- Google OAuth integration for seamless sign-in
- Session management with PostgreSQL or in-memory storage
- User profiles with customizable settings
- Multiple business registration with location verification
- Report history tracking for trend analysis
- Business type categorization (restaurants, cafes, retail, etc.)
- Address validation using Google Geocoding API
- Node.js 18+ and npm
- PostgreSQL (optional - uses in-memory storage by default)
- Google Places API key (optional - uses mock data by default)
# Clone the repository
git clone https://github.com/ManuelCLopes/radar.git
cd radar
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
# Start development server
npm run devThe application will be available at http://127.0.0.1:5000
- Create an account at
/register - Register your business with name, type, and address
- Generate a report to see nearby competitors
- Explore insights and export your analysis
All environment variables are optional. The application works out-of-the-box with sensible defaults.
For real competitor data, configure Google Places API:
# .env
GOOGLE_PLACES_API_KEY=your_api_key_hereSee SETUP_GUIDE.md for detailed setup instructions.
# Google Places API (for real competitor data)
GOOGLE_PLACES_API_KEY=
# OpenAI API (for AI-powered analysis)
OPENAI_API_KEY=
# Database (for data persistence)
DATABASE_URL=postgresql://user:password@localhost:5432/competitor_watcher
# Google OAuth (for "Sign in with Google")
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=http://127.0.0.1:5000/api/auth/google/callback
# Session Secret (for secure sessions)
SESSION_SECRET=competitor-watcher/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utilities and helpers
β β βββ i18n/ # Internationalization
βββ server/ # Express backend
β βββ auth.ts # Authentication logic
β βββ routes.ts # API endpoints
β βββ storage.ts # Data persistence layer
β βββ ai.ts # AI analysis engine
β βββ index.ts # Server entry point
βββ shared/ # Shared types and schemas
β βββ schema.ts # Database schema (Drizzle ORM)
βββ db/ # Database migrations
POST /api/register- Create new accountPOST /api/login- Email/password loginGET /api/auth/google- Initiate Google OAuthGET /api/auth/google/callback- Google OAuth callbackPOST /api/logout- End sessionGET /api/auth/user- Get current user
GET /api/businesses- List user's businessesPOST /api/businesses- Register new businessDELETE /api/businesses/:id- Delete business
POST /api/run-report/:businessId- Generate competitor analysisGET /api/reports/business/:businessId- Get report history
- React 18 with TypeScript
- Vite for fast development and building
- TanStack Query for data fetching and caching
- Wouter for lightweight routing
- Tailwind CSS for styling
- shadcn/ui for UI components
- i18next for internationalization
- Node.js with Express
- TypeScript for type safety
- Drizzle ORM for database operations
- Passport.js for authentication
- PostgreSQL for data persistence
- OpenAI API for AI analysis
- Google Places API for competitor data
- ESLint for code linting
- Prettier for code formatting
- tsx for TypeScript execution
# Development mode with hot reload
npm run dev
# Build for production
npm run build
# Check TypeScript types
npm run check# Run all tests
npm test
# Run speicific test file
npm test client/src/components/__tests__/ReportView.test.tsx
### End-to-End (E2E) Tests
We use **Playwright** for E2E testing.
```bash
# Install Playwright browsers (first run only)
npx playwright install
# Run all E2E tests non-interactively
npx playwright test
# Run E2E tests with UI mode (great for debugging)
npx playwright test --ui
# Run specific E2E test file
npx playwright test e2e/seo-accessibility.spec.ts
### Database Setup
```bash
# Install PostgreSQL (Mac)
brew install postgresql@15
brew services start postgresql@15
# Create database
createdb competitor_watcher
# Add to .env
DATABASE_URL=postgresql://your_username@localhost:5432/competitor_watcher
The application adapts based on available configuration:
- Minimal (no config): In-memory storage, mock data, email/password auth
- Standard (Places API): Real competitor data, in-memory storage
- Full (all APIs + DB): Complete feature set with persistence
Competitor Watcher supports 5 languages:
- π¬π§ English (EN)
- π΅πΉ Portuguese (PT)
- πͺπΈ Spanish (ES)
- π«π· French (FR)
- π©πͺ German (DE)
Language files are located in client/src/i18n/locales/.
- SETUP_GUIDE.md - Detailed setup instructions
- .env.example - Environment variables reference
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Places API for competitor data
- OpenAI for AI-powered analysis
- shadcn/ui for beautiful UI components
- Drizzle ORM for type-safe database operations
For issues, questions, or suggestions:
- π§ Open an issue on GitHub
- π Check the SETUP_GUIDE.md
- π Review existing issues and discussions
