Project 2 - Marketing Homepage
Marketing Homepage - Installation
This guide covers installing and running the Marketing Homepage project.
Prerequisites
- Node.js v18 or higher
- npm (or yarn/pnpm)
- Optional: Admin Panel running (for live course/category/blog data via API)
Steps
1. Enter the project
cd fda-website-marketing-homepage
2. Install dependencies
npm install
3. Environment variables (optional but recommended)
Create .env.local in the project root if you want to use the Admin Panel API:
# Base URL of the Admin Panel (for courses, categories, blogs)
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
For production, set this to your Admin Panel URL (e.g. https://learn.fda.org.in). If unset, the app may use static/fallback data from src/data/.
4. Run development server
npm run dev
Open http://localhost:3000 (or the port shown in the terminal, e.g. 3001 if 3000 is in use).
Running with the Admin Panel
- Start the Admin Panel first (e.g.
cd admin-panel-user-panel-instructor-panel-nextjs-reactjs && npm run devon port 3000). - Set
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000in the marketing site’s.env.local. - Start the marketing site (
npm run dev); it will use port 3001 if 3000 is taken. - Use the marketing site for browsing; courses/categories/blogs will come from the Admin Panel API when using the API-based data modules. See API Integration.
Scripts
| Command | Description |
|---|---|
npm run dev | Start dev server |
npm run build | Production build |
npm run start | Start production server |
npm run lint | Run ESLint |
npm run test:db | Run DB connection test script (if used) |
Troubleshooting
- Port in use: Next.js will offer the next available port (e.g. 3001).
- No courses/categories: If using API, ensure Admin Panel is running and
NEXT_PUBLIC_API_BASE_URLis correct; check that courses/categories are Published in the admin. The app may fall back to static data on API errors. - CORS: If the API is on a different origin, CORS must be enabled for the marketing origin on the Admin Panel’s
/api/public/*routes. See Admin Panel - Marketing API.