MCG – Fast-Moving Consumer Goods Platform
(Working Title)
An application to collect, analyze, and present tenders / RFPs data with a React/Next.js frontend, a Python FastAPI backend, and a small model/database layer for data processing and experiments.
This README documents the repo layout, tech stack, setup and local development instructions, and where to find important files.
- Project overview
- Key features
- Tech stack
- Repository structure and important files
- Quick start (dev)
- Backend setup & run
- Frontend setup & run
- Model / data and database
- Environment variables
- Development notes & tips
- Contributing
- License & contact
This repository collects tools and a UI for working with government and marketplace tenders (RFPs). It contains:
frontend/— Next.js + TypeScript UI built with Tailwind and Radix components for browsing/searching tenders and viewing results.backend/— FastAPI-based API that provides endpoints for analysis and data operations.model/— scripts and helpers for data ingestion, pricing logic, and experiments (contains CSVs, DB initialization scripts, and agents/orchestrators).database/— database files (SQLite) used for quick local development.
This repo is suitable for local development and prototyping; production readiness (scaling, authentication, secure env management) requires additional work.
- Ingest tenders from CSV / scraped sources
- Store and query tenders in a local SQLite DB for dev
- Frontend for searching/filtering tenders and viewing analytics
- Backend analysis endpoints (see
backend/routes/) - Model code for pricing and workflow orchestration in
model/
- Frontend: Next.js 13 (React 18), TypeScript, Tailwind CSS, Radix UI components
- Backend: Python, FastAPI, Uvicorn
- Data: SQLite (local dev), CSV files for sample input
- Tools: Playwright (scraping/testing), BeautifulSoup, pandas
Dependencies (representative):
- frontend/package.json shows Next.js 13.5.1, React 18, Tailwind CSS 3.x, TypeScript
- backend/requirements.txt includes: fastapi, uvicorn, playwright, beautifulsoup4, pandas, groq, python-dotenv
Root
-
frontend/— Next.js app (UI)app/— Next.js app routes and pagescomponents/— reusable UI components and primitivespackage.json— frontend dependencies & scripts
-
backend/— FastAPI servermain.py— FastAPI app & CORS setuproutes/— router modules (analyze.py,tenders.py)requirements.txt— Python dependencies
-
model/— data/modeling scriptsinit_db_pricing.py,setup_database.py,run_workflow.py— DB init and experimentation scriptspricing_agent_logic.py,sales_agent_logic.py,technical_agent_logic.py— business/agent logic- CSVs:
product_database.csv,product_prices.csv,tenders.csv,test_prices.csv
-
database/— containsrfp_database.db(SQLite) used for local dev -
tenders.csv— sample tenders file
Prerequisites
- Node.js (≥16) and npm/yarn
- Python 3.9+ (recommended) and pip
- Optionally: SQLite client
-
Clone
git clone https://github.com/Yashbhu/fmcg.git cd fmcg -
Backend setup
python -m venv .venv source .venv/bin/activate # macOS / Linux (zsh) pip install --upgrade pip pip install -r backend/requirements.txt
Notes: Playwright requires an additional install step to download browser binaries:
playwright install
Run the backend (development):
# from repo root
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
By default the FastAPI app is configured in backend/main.py. The app includes CORS settings for localhost:3000.
-
Frontend setup
cd frontend npm install npm run dev
Open the frontend at http://localhost:3000. The frontend expects the backend API to be available at http://localhost:8000 unless configured otherwise.
-
The repo contains a sample SQLite DB at
database/rfp_database.dbfor quick testing. You can open it withsqlite3 database/rfp_database.dbor any DB browser. -
CSV files live under
model/and the repo root (tenders.csv). Use the scripts inmodel/to import or reinitialize the DB:# examples (edit/inspect scripts before running) python model/setup_database.py python model/init_db_pricing.py
Inspect the scripts to see exact behavior. Back up your DB before re-running initialization scripts.
Create a .env file in backend/ (or set env vars globally). Example entries:
DATABASE_URL=sqlite:///./database/rfp_database.db
SECRET_KEY=replace-with-a-secret
API_PORT=8000
Load these using python-dotenv or your deployment environment.
- The backend includes routers in
backend/routes/. - Example (development):
- Analyze:
GET http://localhost:8000/analyze/...(seebackend/routes/analyze.py)
- Analyze:
Open the automatic docs when backend runs: http://localhost:8000/docs (Swagger) and http://localhost:8000/redoc.
- Keep the backend running at port 8000 and the frontend at 3000 for the default CORS setup.
- When updating front/backend contracts, update types in the frontend (if you add API shapes).
- Use small virtual environments for Python work and commit
requirements.txtchanges when dependencies change.
- There are no formal tests checked into the repo by default. Add tests under
backend/tests/usingpytestand underfrontend/using your preferred test runner (Jest/React Testing Library).
Contributions welcome. Please:
- Fork the repo and create a feature branch
- Run linters and tests locally
- Open a PR describing your change and include screenshots or sample requests if relevant
If you plan to make breaking changes to the API, document them in this README and create a migration plan for the DB.
Add your chosen license (e.g., MIT). If this repo is private, specify internal usage rules instead.
Repo owner: Yashbhu (GitHub: Yashbhu)
Questions? Open issues or PRs in the repository.