A React-based web application that helps researchers, journalists, and educators understand internet censorship by providing side-by-side search comparisons between Google and Baidu with geographic visualization and analytics.
- Dual Search Engine Comparison: Compare Google and Baidu image search results side-by-side
- Multilingual Support: Full English/Chinese localization powered by Sanity CMS
- Search Archive: Browse and filter historical search queries with advanced filtering
- Geographic Analytics: Visualize search patterns across countries and regions
- Community Voting: Assess search result quality with 7 vote categories
- Interactive Dashboard: Data visualization with Chart.js and geographic heatmaps
- Event & Partner Pages: CMS-managed content with localization support
- React 18.2 with functional components and hooks
- React Router v6 for client-side routing
- Tailwind CSS for styling
- Vercel Serverless Functions for API integration
- Sanity CMS: Headless CMS for content management and localization
- Backend API: Node.js/Express API with PostgreSQL (separate repository)
- External APIs: Serper.dev (Google), Baidu scraping, Google Translate
- Vercel: Serverless hosting and automatic deployments
- Sanity Studio: Hosted CMS interface for content editing
- Node.js v20.x.x (specified in package.json)
- nvm for Node version management
- Yarn package manager
- Vercel CLI for local development and deployment
-
Install Node.js version manager (nvm)
# Follow installation guide at https://github.com/nvm-sh/nvm -
Clone the repository
git clone https://github.com/FIREWALL-cafe/firewall-web-app.git cd firewall-web-app -
Use correct Node version
nvm use # If Node 20 is not installed, run: nvm install 20 -
Install dependencies
yarn install
-
Set up environment variables
cp .env.local.example .env.local # Edit .env.local with your API keys and configurationRequired environment variables:
REACT_APP_SANITY_PROJECT_ID: Sanity project IDREACT_APP_SANITY_DATASET: Sanity dataset (usually "production")SERPER_API_KEY: Serper.dev API key for Google searchesBACKEND_API_URL: Backend API endpointAPI_SECRET: Backend API authentication secretSHARED_SECRET: Translation service shared secret
-
Start development server
vercel dev
Visit http://localhost:3000/
Note: Use
vercel dev(notyarn devornpm start) to ensure serverless functions run correctly.
# Start Vercel development environment with serverless functions
vercel dev
# Build for production
yarn build
# Run tests
yarn test # Watch mode
yarn test:ci # Single run for CI
yarn test:minimal # Run minimal test suite
# Code quality
yarn lint # Check for linting errors
yarn lint:fix # Auto-fix linting issues
yarn format # Format code with Prettier
yarn format:check # Check formatting without changes
# Deployment preparation
yarn predeploy # Runs format, lint, and buildfirewall-web-app/
├── api/ # Vercel serverless functions
│ ├── images.js # Image search endpoint
│ ├── proxy.js # Backend API proxy
│ ├── proxy-image.js # Image CORS proxy
│ ├── searches.js # Search filtering
│ └── search-locations.js # Location data
├── src/
│ ├── components/ # React components
│ │ ├── Dashboard/ # Dashboard modules
│ │ ├── Events.jsx # Events page (localized)
│ │ ├── Partners.jsx # Partners page (localized)
│ │ ├── Navigation.jsx # Site navigation with language switcher
│ │ └── ...
│ ├── context/ # React contexts
│ │ ├── ApiContext.js # API integration context
│ │ └── LanguageContext.jsx # Localization context
│ ├── lib/
│ │ └── sanity.js # Sanity CMS client and queries
│ ├── assets/ # Images, icons, static files
│ └── index.js # App entry point
├── studio/ # Sanity Studio configuration
│ ├── schemas/ # CMS schemas
│ │ ├── eventLocalized.js # Localized events schema
│ │ ├── partnerLocalized.js # Localized partners schema
│ │ ├── navigationSettings.js # Navigation menu schema
│ │ └── localeTypes.js # Localization utilities
│ └── sanity.config.js # Sanity configuration
├── .claude/ # Development session documentation
└── docs/ # Additional documentation
cd studio
npx sanity devVisit http://localhost:3333/ to access the CMS interface.
The app supports English and Chinese through Sanity CMS:
- Navigation Menu: Fully managed through CMS (labels, order, visibility)
- Events & Partners: Content with field-level localization
- Language Switcher: Site-wide toggle in navigation bar
- Open Sanity Studio (http://localhost:3333)
- Create a new document in a localized schema (e.g., "Event (Localized)")
- Fill in English and Chinese fields side-by-side
- Publish the document
- Changes appear on the website within ~60 seconds (CDN cache)
See docs/sanity-cms/ for detailed CMS documentation.
- Create component in
src/components/ - Add route in
src/index.js - (Optional) Add to navigation menu via Sanity Studio
Via Sanity Studio (Recommended):
- Open "Navigation Menu" document
- Edit labels, reorder items, or toggle visibility
- Publish changes
Via Code (For structure changes):
- Edit
studio/schemas/navigationSettings.js - Update
src/components/Navigation.jsx
Filter logic is in src/components/FilterControls.jsx:
- Geographic filters: countries, US states, search locations
- Temporal filters: date ranges
- Content filters: vote categories, search terms
The app is deployed on Vercel with automatic deployments from the main branch.
Production URL: https://firewall-frontend-kvfqd8qds-firewall-cafe.vercel.app
-
Automatic Deployment (Recommended)
git push origin main # Vercel automatically builds and deploys -
Manual Deployment
yarn predeploy # Run checks and build vercel --prod # Deploy to production
Set environment variables in Vercel dashboard:
- Visit https://vercel.com/dashboard
- Select project "firewall-frontend"
- Settings → Environment Variables
- Add/update variables
- Redeploy for changes to take effect
Note: The app was previously deployed to Google App Engine but has migrated to Vercel.
Legacy URL: https://fwc-2023.ue.r.appspot.com/
If you need to deploy to GAE:
- Install Cloud SDK
- Set GCP project:
gcloud config set project [PROJECT_ID] - Deploy:
gcloud app deploy
Contact the code owner for GAE access permissions.
The web app connects to a separate backend API service for data persistence.
Repository: /Users/ummonai/dev/firewall/server/api
Production URL: https://api.firewallcafe.com
Local Port: 11458
- PostgreSQL database
- Search data and analytics
- Image storage and retrieval
- Vote management
- Geographic enrichment (IP → location)
See backend repository for setup and API documentation.
# Run tests in watch mode
yarn test
# Run tests once (for CI)
yarn test:ci
# Run minimal test suite
yarn test:minimalTests use:
- Jest
- React Testing Library
- Mock data in
spec/mocks/
- Create a feature branch:
git checkout -b feature/my-feature - Make changes and commit:
git commit -m "description" - Run checks:
yarn predeploy - Push and create pull request
- Wait for CI checks to pass
- Request code review
- Use functional React components with hooks
- Follow existing naming conventions
- Run
yarn lint:fixandyarn formatbefore committing - Write tests for new features
- Update documentation for significant changes
- Ensure all new files are committed to git
- Run
git statusto check for untracked files - Vercel builds from git repository, not local filesystem
- Use
vercel devinstead ofreact-scripts start - Serverless functions in
/apidirectory require Vercel dev server
- Clear browser cache
- Check Sanity Studio for published (not draft) content
- Verify
REACT_APP_SANITY_PROJECT_IDin.env.local
- Create "Navigation Menu" document in Sanity Studio
- Ensure document is published
- Check browser console for fetch errors
- Project Architecture - Detailed technical documentation
- Sanity CMS Guide - CMS integration and localization
- Session Notes - Development session history
- Serper.dev - Google search API
- Vercel Functions - Serverless functions
[Add license information]
For questions or access requests, please contact the code owner.
Last Updated: October 2025
Node Version: 20.x.x
React Version: 18.2
Deployment Platform: Vercel