A full-stack web application that helps users identify and avoid products based on geopolitical affiliations, with admin moderation capabilities.
- 🔍 Search products by name, brand, or category
- 🏷 View brand affiliation status (Israeli/Local/Neutral)
- 📝 Submit suggestions to update or delete products
- 📊 Browse products by category
- 🔎 View product details
- 🔒 Secure admin login system
- ✅ Approve/reject user suggestions
- ✏ Add admin comments to suggestions
- 🗑 Delete suggestions
- ➕ Add new products directly
- HTML5 with semantic markup
- CSS3 with responsive design
- Minimal JavaScript for basic interactions
- Jinja2 templating for dynamic content
- Python 3.x
- Flask web framework
- Flask-CORS for cross-origin support
- Werkzeug for security and authentication
- SQL Server (via pyodbc)
- Normalized relational schema
- Stored procedures (if applicable)
- Can be deployed with WSGI (like Gunicorn)
- Nginx reverse proxy (production)
- Docker compatible
- Python 3.7+
- SQL Server
- ODBC Driver 17 for SQL Server
- pip package manager
-
Clone the repository: bash git clone https://github.com/yourusername/Boycott-Detector-Website.git cd Boycott-Detector-Website
-
Create and activate virtual environment: bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies: bash pip install flask flask-cors pyodbc werkzeug
-
Database setup:
- Create database final_project on your SQL Server
- Execute the SQL scripts to create tables (see database/schema.sql)
- Configure the application: bash cp config.example.py config.py
- Run the application: bash python app.py
Access the application at http://localhost:5000
- products - Product information
- brands - Brand details and affiliation status
- categories - Product classification
- suggestions - User submissions for changes
- admins - Admin user accounts
- Products belong to Brands (many-to-one)
- Products belong to Categories (many-to-one)
- Suggestions reference Products (many-to-one)
- Suggestions are processed by Admins (many-to-one)
- GET /api/products - Search products
- GET /api/categories - List all categories
- GET /api/brands - List all brands
- POST /api/suggestions - Submit a suggestion
- POST /api/admin/login - Admin login
- POST /api/admin/logout - Admin logout
- POST /api/admin/suggestions//approve - Approve suggestion
- POST /api/admin/suggestions//reject - Reject suggestion
- DELETE /api/admin/suggestions/ - Delete suggestion
- POST /api/admin/products - Add new product
boycott-detector/ ├── app.py # Main Flask application ├── config.py # Configuration file ├── requirements.txt # Python dependencies ├── static/ # Static files (CSS, JS, images) │ ├── css/ │ └── images/ ├── templates/ # HTML templates │ ├── adminpanel.html # Admin interface │ ├── search.html # Search page │ ├── login.html # Login page │ └── splash.html # Home page └── database/ ├── setup.sql # Database schema └── sample_data.sql # Sample data
We welcome contributions! Please follow these steps:
- 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
Please ensure your code follows PEP 8 guidelines and includes appropriate tests.
Note: This application is developed for educational purposes. The maintainers do not endorse any particular political view. All data should be independently verified.