FDA

Project 1 - Admin Panel

Admin Panel - Installation

This guide covers installing and running the Admin Panel project locally.

Prerequisites

  • Node.js v18 or higher
  • PostgreSQL (local or cloud: Neon, Supabase, Railway, etc.)
  • npm (or yarn/pnpm)

Steps

1. Clone and enter the project

cd admin-panel-user-panel-instructor-panel-nextjs-reactjs

2. Install dependencies

npm install

3. Environment variables

Create .env.local in the project root:

# Database (required)
DATABASE_URL=postgresql://username:password@localhost:5432/fda_db

# JWT (required)
JWT_SECRET=your-super-secret-jwt-key-change-in-production
JWT_EXPIRES_IN=7d

# Optional - for external clients
NEXT_PUBLIC_API_URL=http://localhost:3000

# Optional - Node environment
NODE_ENV=development

Generate a strong JWT secret for production:

openssl rand -base64 32

4. Database setup

Create the database and run the schema. Example for local PostgreSQL:

# Create DB (if needed)
createdb fda_db

# Run main schema
psql -d fda_db -f supabase/schema-standalone.sql

Then run any migrations in supabase/migrations/ (e.g. add-chat-system.sql, add-payments-invoices-accounting.sql, add-blogs.sql, add-course-marketing-fields.sql) in order. See Database Setup for full options (local, Neon, Docker).

5. Run development server

npm run dev

Open http://localhost:3000.

First-time access

  1. Go to Register and create an account (phone + PIN; in dev, PIN 1234 is accepted).
  2. Optionally promote your user to admin or instructor in the database or via admin role management.
  3. See Login & Credentials for test credentials and mock PIN behavior.

Optional: Razorpay (payments)

For real payments, add to .env.local:

RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
RAZORPAY_WEBHOOK_SECRET=your_webhook_secret
NEXT_PUBLIC_RAZORPAY_KEY_ID=your_razorpay_key_id

Without these, the app runs in dummy payment mode. See Payments & Razorpay.

Scripts

CommandDescription
npm run devStart dev server (default port 3000)
npm run buildProduction build
npm run startStart production server
npm run lintRun ESLint

Troubleshooting

  • Database connection errors: Check DATABASE_URL, ensure PostgreSQL is running and the database exists.
  • JWT errors: Ensure JWT_SECRET is set in .env.local.
  • Port in use: Run on another port: npm run dev -- -p 3001.
Previous
Overview