A modern web application with a React frontend and Node.js/Express backend connected to MongoDB.
WebApp/
├── backend/ # Node.js + Express + MongoDB API server
├── frontend/ # React web application
├── README.md # This file
└── [Documentation files]
- Node.js (v18+)
- MongoDB (running as a service)
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Seed the database (populate with initial data):
node seedDatabase.js- Start the server:
npm startThe backend will run on http://localhost:5000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm startThe frontend will run on http://localhost:3000
Backend:
- Express.js REST API
- MongoDB database
- Mongoose for data modeling
- CORS enabled for frontend communication
Frontend:
- React SPA (Single Page Application)
- Component-based architecture
- Axios for API calls
GET /api/health- Server status
GET /api/content/home- All home page contentGET /api/content/featured-cards- Featured cards sectionGET /api/content/contributions- Contributions sectionGET /api/content/about- About section
GET /api/navigation- Navigation data
GET /api/partners- Partners data
MongoDB is used to store all application data. The database includes:
- HomeContent - Main content sections (hero, about, cards, etc.)
- Navigation data
- Partners information
Initial data is populated from backend/data/homeContent.js into MongoDB using seedDatabase.js.
To re-seed the database, run:
cd backend
node seedDatabase.js- Backend:
npm startin/backendfolder - Frontend:
npm startin/frontendfolder - Both can run simultaneously on different ports
MongoDB Connection Issues:
- Ensure MongoDB service is running:
Get-Service -Name MongoDB - Check connection string in
backend/server.js
Port Already in Use:
- Backend uses port 5000
- Frontend uses port 3000
- Kill existing processes if needed
- Frontend: React, CSS, Axios
- Backend: Node.js, Express, Mongoose
- Database: MongoDB
- Other: CORS, Body-Parser, dotenv
- See
backend/README.mdfor backend-specific documentation - See
frontend/README.mdfor frontend-specific documentation