EcoFinds is a full-stack marketplace app with:
- Frontend: Next.js app in
h-care - Backend: Express + MongoDB API in
backend - Database: MongoDB (containerized in Docker Compose)
h-care: Next.js frontendbackend: Node.js/Express backend APIdocker-compose.yml: Multi-container setup (frontend + backend + mongo).github/workflows/ci-cd.yml: GitHub Actions CI workflow
Install these tools:
- Node.js 18+
- npm
- Docker Desktop (or Docker Engine + Compose)
Create/update backend/.env:
PORT=8000
MONGODB_URI=mongodb://mongo:27017
JWT_SECRET=your_secret_hereNotes:
- In Docker Compose,
MONGODB_URIis also set by compose for the backend service. - For local non-docker backend development, you can point
MONGODB_URIto your own Mongo URI.
Create/update h-care/.env:
NEXT_PUBLIC_API_URL=http://localhost:8000Open two terminals from repo root.
cd backend
npm ci
npm run serverBackend default URL:
cd h-care
npm ci
npm run devFrontend default URL:
Run from repo root (ODDO_X_NMIT).
docker-compose down -v --remove-orphansdocker-compose build --no-cachedocker-compose up --builddocker-compose psdocker-compose logs -f frontend
docker-compose logs -f backend
docker-compose logs -f mongodocker-compose downWhen Docker stack is running:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- MongoDB: mongodb://localhost:27017
Workflow file:
.github/workflows/ci-cd.yml
Runs on:
- Push to
mainormaster - Pull requests
- Frontend CI
- Installs dependencies in
h-care - Runs frontend build (
npm run build)
- Backend CI
- Installs dependencies in
backend - Runs syntax validation (
node --check server.js)
- Docker Build Validation
- Builds frontend Docker image (
h-care/Dockerfile) - Builds backend Docker image (
backend/Dockerfile) - Validates that images build successfully (no push)
Ensure h-care/next.config.js includes:
output: 'standalone'Do not keep React Router pages under src/pages in Next.js projects.
Use a non-reserved folder such as src/screens.
- Confirm backend container is running on port
8000 - Confirm frontend can proxy auth requests to backend
- Check backend logs for auth route errors
Logs such as Bugsnag blocked by client, ad-finder, filler scripts, and web-bridge are often browser extension messages and not app runtime failures.
From repo root:
# Rebuild and restart everything
docker-compose down -v --remove-orphans
docker-compose up --build
# Rebuild only frontend
docker-compose build --no-cache frontend
# Rebuild only backend
docker-compose build --no-cache backend