Follow these steps in order to set up Trinity Attend.
The npm install command should complete successfully. If you see errors:
# Try with legacy peer deps
npm install --legacy-peer-deps
# Or clean install
rm -rf node_modules package-lock.json
npm install --legacy-peer-depsOpen your terminal and run these commands one at a time:
# Generate AUTH_SECRET
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"Copy the output ↑
# Generate QR_CODE_SECRET
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Copy the output ↑
- Go to https://neon.tech
- Sign up or log in
- Click "Create Project"
- Give it a name: "trinity-attend"
- Select region closest to you
- Click "Create"
- On the dashboard, find "Connection String"
- Copy the Pooled Connection string
- Make sure it ends with
?sslmode=require
Example format:
postgresql://username:password@ep-xyz.region.aws.neon.tech/dbname?sslmode=require
In the project root (c:\Users\HP\Desktop\trinity-attend), create a file named .env.local:
# On Windows PowerShell
New-Item .env.local
# Or copy from example
copy .env.example .env.localOpen .env.local in your editor and paste:
# ===== REQUIRED =====
# Paste your Neon connection string here
DATABASE_URL="postgresql://[paste-here]"
# Paste the AUTH_SECRET you generated
AUTH_SECRET="[paste-generated-secret-here]"
# Paste the same or another generated secret
BETTER_AUTH_SECRET="[paste-generated-secret-here]"
# Paste the QR_CODE_SECRET you generated
QR_CODE_SECRET="[paste-generated-qr-secret-here]"
# App configuration (no changes needed for local dev)
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_APP_NAME="Trinity Attend"
# Geolocation (100m radius validation)
NEXT_PUBLIC_ENABLE_GEOLOCATION="true"
NEXT_PUBLIC_MAX_DISTANCE_METERS="100"
# ===== OPTIONAL (Add later when needed) =====
# Google OAuth (Step 7)
GOOGLE_CLIENT_ID="[paste-google-client-id-here]"
GOOGLE_CLIENT_SECRET="[paste-google-client-secret-here]"
# Email (Resend)
RESEND_API_KEY=""
FROM_EMAIL="noreply@trinityattend.com"
# Media (Cloudinary)
NEXT_PUBLIC_CLOUD_NAME=""
CLOUDINARY_API_KEY=""
CLOUDINARY_API_SECRET=""Save the file.
Now that you have DATABASE_URL configured:
# Push the schema to your database (creates all tables)
npm run db:pushExpected output:
Your database is now in sync with your Prisma schema.
✔ Generated Prisma Client
Then seed the database:
# Add sample data (faculties, departments, courses, demo users)
npm run db:seedExpected output:
🌱 Starting database seed...
Creating faculties...
✅ Faculties created
Creating departments...
✅ Departments created
Creating sample Computer Science courses...
✅ Sample courses created
Creating demo users...
✅ Demo users created
📝 Demo Credentials:
Teacher: teacher@demo.com / Demo@1234
Student: student@demo.com (or matric: 2022/1/12345) / Demo@1234
✅ Database seed completed!
Install all required UI components:
npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add input
npx shadcn@latest add label
npx shadcn@latest add form
npx shadcn@latest add select
npx shadcn@latest add dialog
npx shadcn@latest add dropdown-menu
npx shadcn@latest add table
npx shadcn@latest add tabs
npx shadcn@latest add switch
npx shadcn@latest add progress
npx shadcn@latest add avatar
npx shadcn@latest add badge
npx shadcn@latest add separator
npx shadcn@latest add skeleton
npx shadcn@latest add checkbox
npx shadcn@latest add popoverTip: You can install multiple at once:
npx shadcn@latest add button card input label form select dialog dropdown-menu table tabsThese will be added to src/components/ui/.
npm run devExpected output:
▲ Next.js 15.0.3
- Local: http://localhost:3000
- Environments: .env.local
✓ Ready in 2.5s
- Open your browser
- Go to http://localhost:3000
- You should see the Trinity Attend landing page
- Click "Get Started" or "Sign In"
Demo credentials (after seeding):
- Teacher:
teacher@demo.com/Demo@1234 - Student:
2022/1/12345/Demo@1234
Solution 1:
npm install --legacy-peer-depsSolution 2 (Clean install):
rm -rf node_modules package-lock.json
npm install --legacy-peer-depsCheck:
- Is
DATABASE_URLin.env.localcorrect? - Does it end with
?sslmode=require? - Can you access Neon dashboard?
- Is your database active (not suspended)?
Solution:
- Go to https://console.neon.tech
- Check your project status
- Copy connection string again
- Update
.env.local
npx prisma generate
npm run db:pushrm -rf .next
npm run dev# Find and kill the process on port 3000
# Windows:
netstat -ano | findstr :3000
taskkill /PID <process-id> /F
# Or use a different port:
npm run dev -- -p 3001Before proceeding to build features, verify:
-
npm installcompleted without errors -
.env.localfile exists and is filled -
npm run db:pushsucceeded -
npm run db:seedcreated demo users - Shadcn components installed to
src/components/ui/ -
npm run devstarts server - http://localhost:3000 shows landing page
- No errors in terminal
- No errors in browser console
Once all steps are complete, you're ready to build:
- Authentication pages (login/signup)
- Student dashboard
- Teacher dashboard
- QR code system
- Analytics and reports
See SETUP_GUIDE.md for detailed implementation steps.
- Check the error message carefully
- Read
README.mdfor more details - Review
SETUP_GUIDE.mdfor comprehensive instructions - Check
QUICK_REFERENCE.mdfor common commands
Once this checklist is complete, you're ready to start building! 🚀