A comprehensive student portal application built with Next.js, Express, TypeScript, and PostgreSQL. This platform provides centralized access to courses, clubs, events, achievements, announcements, and assignment submissions.
- JWT-based authentication
- OAuth2 Google login integration
- Role-based access control (Student, Instructor, Admin)
- Secure password hashing with bcrypt
- Browse and enroll in courses
- View course details and schedules
- Track enrolled courses
- Instructor course creation and management
- Student enrollment tracking with capacity limits
- Discover and join clubs
- View club details and membership
- Track club activities
- Role-based club memberships (Member, Officer, President)
- Campus-wide event calendar
- Course and club-specific events
- Event registration and attendance tracking
- Virtual and in-person event support
- Mandatory event flagging
- Multi-level announcements (Campus, Course, Club, Emergency)
- Priority-based announcement system
- Pinned announcements
- Expiration dates for time-sensitive announcements
- Assignment creation and distribution
- File attachment support
- Submission tracking
- Grading system with feedback
- Late submission handling with penalties
- Support for multiple assignment types (Homework, Project, Quiz, Exam, Lab)
- Achievement system with categories
- Points-based reward system
- Student leaderboard
- Automatic achievement tracking
- Achievement categories: Academic, Participation, Leadership, Special
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: PostgreSQL with pg driver
- Authentication: JWT + Google OAuth2
- Security: Helmet, CORS, Rate Limiting
- Validation: express-validator
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- HTTP Client: Axios
- Forms: React Hook Form
- Notifications: React Toastify
- Icons: Lucide React
Student-Portal-Fullstack/
├── backend/
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── database/ # Database connection and migrations
│ │ ├── middleware/ # Auth, validation, error handling
│ │ ├── routes/ # API routes
│ │ ├── utils/ # Utility functions
│ │ ├── app.ts # Express app configuration
│ │ └── server.ts # Server entry point
│ ├── package.json
│ └── tsconfig.json
├── frontend/
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # React components
│ │ ├── lib/ # API client and utilities
│ │ ├── stores/ # Zustand stores
│ │ └── types/ # TypeScript types
│ ├── package.json
│ └── tsconfig.json
└── docker-compose.yml
- Node.js 18+ and npm/yarn
- PostgreSQL 14+
- Git
git clone <repository-url>
cd Student-Portal-Fullstackcd backend
npm install
# Copy environment file
cp .env.example .env
# Edit .env with your configuration
# Update database credentials, JWT secret, Google OAuth credentialsEnvironment Variables (backend/.env):
NODE_ENV=development
PORT=5000
DB_HOST=localhost
DB_PORT=5432
DB_NAME=student_portal
DB_USER=postgres
DB_PASSWORD=your_password
JWT_SECRET=your-super-secret-jwt-key-change-this
JWT_EXPIRES_IN=7d
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=http://localhost:3000/auth/google/callback
FRONTEND_URL=http://localhost:3000# Create PostgreSQL database
createdb student_portal
# Run migrations
npm run migrate
# (Optional) Seed with sample data
npm run seedcd ../frontend
npm install
# Copy environment file
cp .env.example .env.local
# Edit .env.localEnvironment Variables (frontend/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:5000/api
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-idTerminal 1 - Backend:
cd backend
npm run devTerminal 2 - Frontend:
cd frontend
npm run devAccess the application at: http://localhost:3000
Backend:
cd backend
npm run build
npm startFrontend:
cd frontend
npm run build
npm start# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
POST /api/auth/register - Register new user
POST /api/auth/login - Login with email/password
POST /api/auth/google - Login with Google OAuth2
GET /api/auth/profile - Get current user profile
GET /api/courses - Get all courses
GET /api/courses/:id - Get course by ID
POST /api/courses - Create course (Instructor/Admin)
POST /api/courses/enroll - Enroll in course
GET /api/courses/my-enrollments - Get user's enrollments
GET /api/clubs - Get all clubs
GET /api/clubs/:id - Get club by ID
POST /api/clubs - Create club
POST /api/clubs/join - Join club
GET /api/clubs/my-memberships - Get user's memberships
GET /api/events - Get all events
GET /api/events/:id - Get event by ID
POST /api/events - Create event (Instructor/Admin)
POST /api/events/register - Register for event
GET /api/events/my-events - Get user's events
GET /api/announcements - Get all announcements
GET /api/announcements/:id - Get announcement by ID
POST /api/announcements - Create announcement (Instructor/Admin)
PUT /api/announcements/:id - Update announcement (Instructor/Admin)
DELETE /api/announcements/:id - Delete announcement (Instructor/Admin)
GET /api/submissions/my-submissions - Get user's submissions
GET /api/submissions/assignments/:courseId - Get course assignments
POST /api/submissions/assignments - Create assignment (Instructor/Admin)
POST /api/submissions/submit/:assignmentId - Submit assignment
PUT /api/submissions/grade/:submissionId - Grade submission (Instructor/Admin)
GET /api/achievements - Get all achievements
GET /api/achievements/my-achievements - Get user's achievements
GET /api/achievements/leaderboard - Get leaderboard
POST /api/achievements/award - Award achievement (Admin)
Admin:
- Email: admin@university.edu
- Password: admin123
Instructor:
- Email: instructor@university.edu
- Password: instructor123
Students:
- Email: student1@university.edu
- Password: student123
- users - User accounts and profiles
- courses - Course information
- course_enrollments - Student course enrollments
- clubs - Club/organization information
- club_memberships - Club memberships
- events - Event information
- event_attendance - Event registrations and attendance
- announcements - Announcements
- assignments - Course assignments
- submissions - Student submissions
- achievements - Achievement definitions
- user_achievements - Earned achievements
- notifications - User notifications
- JWT-based authentication with secure token storage
- Password hashing using bcrypt
- CORS protection
- Helmet security headers
- Rate limiting on API endpoints
- SQL injection protection via parameterized queries
- Input validation on all endpoints
- Role-based access control
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License
For issues and questions, please open an issue on GitHub or contact the development team.
- Real-time notifications with WebSockets
- Mobile app (React Native)
- Advanced analytics dashboard
- Integration with Learning Management Systems
- Calendar sync (Google Calendar, Outlook)
- Document collaboration
- Video conferencing integration
- Advanced search and filtering
- Export features (PDF reports, transcripts)
- Multi-language support