- Installed
tsxfor better TypeScript execution - Updated dev script in
lms/backend/package.json - Created
.envfile with all necessary configurations
- Created
.env.localinlms/directory - Configured API URL to connect with backend
- Root
package.jsonupdated withconcurrently - Now
npm run devruns BOTH backend and frontend together!
# Root directory se (jahan aap abhi hain)
npm run dev# Backend only
npm run dev:backend
# Frontend only
npm run dev:frontendCheck if PostgreSQL is running:
docker psIf container name is lms-postgres, it's already running! ✅
Edit lms/backend/.env and update PostgreSQL password:
POSTGRES_URL=postgresql://postgres:YOUR_ACTUAL_PASSWORD@localhost:5432/lmsdbReplace YOUR_ACTUAL_PASSWORD with the password you used when creating the container.
Before running the project, initialize the database:
cd lms/backend
npx prisma generate
npx prisma db pushThis will create all tables in your databases.
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Backend Health Check: http://localhost:5000/api/health
- ✅ Created with default values
⚠️ Update PostgreSQL password⚠️ Change JWT_SECRET in production- Optional: Add Cloudinary, Stripe, Email configs
- ✅ Created with default values
- Optional: Add NEXTAUTH_SECRET, Uploadthing configs
- Update PostgreSQL password in
lms/backend/.env - Run database migrations:
cd lms/backend && npx prisma db push - Start development:
npm run dev(from root) - Create admin user: Backend will auto-seed on first run
# Check what's using port 5000 or 3000
netstat -ano | findstr :5000
netstat -ano | findstr :3000
# Kill process by PID
taskkill /PID <PID_NUMBER> /FMake sure MongoDB is running or set USE_POSTGRES=false in backend .env
Verify Docker PostgreSQL container is running:
docker ps
docker logs lms-postgresLMS-main/
├── package.json # Root - runs both frontend & backend
├── lms/
│ ├── package.json # Frontend (Next.js)
│ ├── .env.local # Frontend environment variables
│ └── backend/
│ ├── package.json # Backend (Express)
│ └── .env # Backend environment variables
# Install all dependencies (if not done)
npm run install:all
# Run everything
npm run dev
# Build frontend
npm run build
# Start production
npm startHappy Coding! 🚀