A comprehensive full-stack web application for managing school registrations with payment processing, document uploads, and role-based dashboards.
Before you begin, ensure you have the following installed:
Youβll also need accounts for:
cd /Users/angelmerpioquinto/Desktop/School/school-registration-system
# Install backend dependencies
npm install
# Copy environment variables
cp .env.example .env
# Edit .env with your credentials
# DATABASE_URL, JWT_SECRET, CLOUDINARY_*, STRIPE_*, EMAIL_*
# Generate Prisma client
npm run prisma:generate
# Run database migrations
npm run prisma:migrate
# Start backend server
npm run dev
The backend will run on http://localhost:5000
# Navigate to frontend directory
cd frontend
# Install frontend dependencies
npm install
# Copy environment variables
cp .env.local.example .env.local
# Edit .env.local with your API URL and Stripe key
# NEXT_PUBLIC_API_URL=http://localhost:5000/api
# NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
# Start frontend development server
npm run dev
The frontend will run on http://localhost:3000
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/school_registration"
# JWT
JWT_SECRET="your-super-secret-jwt-key"
JWT_EXPIRES_IN="7d"
# Cloudinary
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
# Stripe
STRIPE_SECRET_KEY="sk_test_your-stripe-secret-key"
# Email
EMAIL_HOST="smtp.gmail.com"
EMAIL_PORT=587
EMAIL_USER="your-email@gmail.com"
EMAIL_PASSWORD="your-app-password"
EMAIL_FROM="School Registration <noreply@school.com>"
# Server
PORT=5000
FRONTEND_URL="http://localhost:3000"
NEXT_PUBLIC_API_URL=http://localhost:5000/api
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your-stripe-publishable-key
The application uses the following main tables:
Since registration creates student accounts by default, youβll need to manually create an admin account in the database:
# Access Prisma Studio
npm run prisma:studio
# Or use SQL
psql -d school_registration
INSERT INTO users (id, email, password_hash, role) VALUES
(gen_random_uuid(), 'admin@school.com', '$2b$10$...', 'ADMIN');
Note: Hash the password using bcrypt before inserting.
school-registration-system/
βββ prisma/
β βββ schema.prisma # Database schema
βββ routes/
β βββ auth.js # Authentication routes
β βββ students.js # Student management
β βββ documents.js # File uploads
β βββ payments.js # Payment processing
βββ middleware/
β βββ auth.js # JWT authentication
β βββ upload.js # File upload config
βββ utils/
β βββ cloudinary.js # File storage
β βββ email.js # Email notifications
β βββ pdf.js # Receipt generation
βββ frontend/
β βββ app/
β β βββ page.tsx # Landing page
β β βββ login/ # Login page
β β βββ register/ # Registration
β β βββ student/ # Student dashboard
β β βββ admin/ # Admin dashboard
β βββ components/ # Reusable components
β βββ context/ # Auth context
β βββ lib/ # API client
βββ server.js # Express server
See DEPLOYMENT.md for detailed deployment instructions for:
The system sends automated emails for:
Stripe is integrated for:
# Check PostgreSQL is running
pg_isready
# Verify DATABASE_URL in .env
# Reset database
npm run prisma:migrate reset
# Regenerate client
npm run prisma:generate
POST /api/auth/register - Register new studentPOST /api/auth/login - Login userGET /api/auth/me - Get current userGET /api/students - List all students (admin)GET /api/students/:id - Get student detailsPUT /api/students/:id - Update student infoPUT /api/students/:id/status - Update enrollment status (admin)POST /api/documents/upload - Upload documentGET /api/documents/student/:studentId - Get student documentsDELETE /api/documents/:id - Delete documentPOST /api/payments/create-intent - Create payment intentPOST /api/payments/confirm - Confirm paymentGET /api/payments/student/:studentId - Get payment historyGET /api/payments/:id/receipt - Download receiptGET /api/payments - List all payments (admin)MIT License - feel free to use this project for your school or organization.
For issues or questions:
Built with modern web technologies for educational institutions.