FDA

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

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

  1. Start the Admin Panel first (e.g. cd admin-panel-user-panel-instructor-panel-nextjs-reactjs && npm run dev on port 3000).
  2. Set NEXT_PUBLIC_API_BASE_URL=http://localhost:3000 in the marketing site’s .env.local.
  3. Start the marketing site (npm run dev); it will use port 3001 if 3000 is taken.
  4. 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

CommandDescription
npm run devStart dev server
npm run buildProduction build
npm run startStart production server
npm run lintRun ESLint
npm run test:dbRun 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_URL is 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.
Previous
Overview