Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EcoFinds (ODDO_X_NMIT)

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)

Project Structure

  • h-care: Next.js frontend
  • backend: Node.js/Express backend API
  • docker-compose.yml: Multi-container setup (frontend + backend + mongo)
  • .github/workflows/ci-cd.yml: GitHub Actions CI workflow

Prerequisites

Install these tools:

  • Node.js 18+
  • npm
  • Docker Desktop (or Docker Engine + Compose)

Environment Variables

Backend

Create/update backend/.env:

PORT=8000
MONGODB_URI=mongodb://mongo:27017
JWT_SECRET=your_secret_here

Notes:

  • In Docker Compose, MONGODB_URI is also set by compose for the backend service.
  • For local non-docker backend development, you can point MONGODB_URI to your own Mongo URI.

Frontend

Create/update h-care/.env:

NEXT_PUBLIC_API_URL=http://localhost:8000

Run Locally (Without Docker)

Open two terminals from repo root.

1) Backend

cd backend
npm ci
npm run server

Backend default URL:

2) Frontend

cd h-care
npm ci
npm run dev

Frontend default URL:

Docker: Build and Run (Recommended)

Run from repo root (ODDO_X_NMIT).

Clean previous containers/volumes

docker-compose down -v --remove-orphans

Build all services

docker-compose build --no-cache

Start stack

docker-compose up --build

Check status

docker-compose ps

Follow logs

docker-compose logs -f frontend
docker-compose logs -f backend
docker-compose logs -f mongo

Stop stack

docker-compose down

Service Endpoints

When Docker stack is running:

CI/CD (GitHub Actions)

Workflow file:

  • .github/workflows/ci-cd.yml

Trigger

Runs on:

  • Push to main or master
  • Pull requests

Jobs

  1. Frontend CI
  • Installs dependencies in h-care
  • Runs frontend build (npm run build)
  1. Backend CI
  • Installs dependencies in backend
  • Runs syntax validation (node --check server.js)
  1. Docker Build Validation
  • Builds frontend Docker image (h-care/Dockerfile)
  • Builds backend Docker image (backend/Dockerfile)
  • Validates that images build successfully (no push)

Common Troubleshooting

1) Frontend Docker build fails with .next/standalone not found

Ensure h-care/next.config.js includes:

output: 'standalone'

2) Next.js build error related to useNavigate during prerender

Do not keep React Router pages under src/pages in Next.js projects. Use a non-reserved folder such as src/screens.

3) Failed to fetch on login

  • Confirm backend container is running on port 8000
  • Confirm frontend can proxy auth requests to backend
  • Check backend logs for auth route errors

4) Browser console noise from extensions

Logs such as Bugsnag blocked by client, ad-finder, filler scripts, and web-bridge are often browser extension messages and not app runtime failures.

Useful Commands

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

About

EcoFinds is a full-stack marketplace platform designed for students to buy and sell used items at affordable prices.Supported with CI/CD pipeline ,Docker contanerisation and github actions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages