A modern, scalable learning platform built with microservices architecture, featuring Google OAuth authentication, real-time analytics, and comprehensive course management.
π Quick Start β’ β¨ Features β’ ποΈ Architecture β’ π Documentation
- Quick Start
- Features
- Architecture
- Tech Stack
- Project Structure
- API Documentation
- Database Schema
- Deployment
- CI/CD Pipeline
- Environment Configuration
- Documentation
- Contributing
- Docker Desktop - Download & Install
- Google OAuth Credentials - Setup Guide
- Git - For cloning the repository
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services β Credentials
- Click Create Credentials β OAuth 2.0 Client ID
- Configure OAuth consent screen
- Set application type to Web application
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/google - Copy your Client ID and Client Secret
# Clone the repository
git clone https://github.com/heyitsgautham/AcademiaSync.git
cd AcademiaSync
# Copy environment files
cp .env.example .env
cp frontend/.env.example frontend/.env.local
# Edit .env and frontend/.env.local with your Google OAuth credentialsRequired Environment Variables:
# .env (root)
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=academiasync
DB_PORT=5432
USER_SERVICE_PORT=5000
COURSE_SERVICE_PORT=5001
JWT_SECRET=<your-jwt-secret>
JWT_REFRESH_SECRET=<your-jwt-refresh-secret>
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
NEXTAUTH_SECRET=<generate-with-openssl-rand-base64-32>
NEXTAUTH_URL=http://localhost:3000
NEXT_PUBLIC_BACKEND_URL=http://localhost:5000
NEXT_PUBLIC_COURSE_SERVICE_URL=http://localhost:5001
INTERNAL_BACKEND_URL=http://user-service:5000
INTERNAL_COURSE_SERVICE_URL=http://course-service:5001π‘ Generate NEXTAUTH_SECRET: Run
openssl rand -base64 32in terminal
# Start all services
docker-compose up -d
# Check service health
docker-compose ps
# View logs
docker-compose logs -f| Service | URL | Description |
|---|---|---|
| π Frontend | http://localhost:3000 | Main application |
| π§ User Service | http://localhost:5000/health | Auth & user management |
| π§ Course Service | http://localhost:5001/health | Courses & assignments |
| π API Docs | http://localhost:5000/api-docs | Swagger documentation |
After first login with Google:
# Access the database
docker exec -it academiasync-db psql -U postgres -d academiasync
# Promote your user to admin (replace with your email)
UPDATE users SET role = 'Admin' WHERE email = 'your-email@gmail.com';
\q# Stop all services
docker-compose down
# Stop and remove volumes (reset database)
docker-compose down -v- Google OAuth 2.0 integration via NextAuth.js
- JWT-based authentication with access & refresh tokens
- Role-based access control (Student, Teacher, Admin)
- Secure httpOnly cookies for token storage
- Automatic session management and token refresh
- Dashboard with personalized stats and progress tracking
- Course enrollment and management
- Assignment submissions with deadline tracking
- Analytics dashboard with performance charts
- Grade tracking across all courses
- Course creation and management
- Assignment creation with due dates
- Student management by course
- Submission grading with feedback
- Analytics for student performance tracking
- Recent activity monitoring
- User management (Students & Teachers)
- Role promotion/demotion
- Platform-wide analytics
- Course oversight
- System health monitoring
- Interactive charts using Recharts
- Student performance metrics
- Course completion rates
- Enrollment statistics
- Age demographics visualization
- Dark/Light theme toggle with persistence
- Responsive design for all devices
- Toast notifications for user feedback
- Confirmation modals for critical actions
- Loading states and skeleton screens
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND β
β Next.js 14 (App Router) β
β React + TypeScript + TailwindCSS + shadcn/ui β
β Port: 3000 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββ΄ββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β USER SERVICE β β COURSE SERVICE β
β Express.js + Node.js β β Express.js + Node.js β
β Port: 5000 β β Port: 5001 β
β β β β
β β’ Authentication (OAuth) β β β’ Course Management β
β β’ User Management β β β’ Assignment Management β
β β’ Admin Operations β β β’ Enrollment Management β
β β’ JWT Token Management β β β’ Submission Management β
β β’ Profile Management β β β’ Student/Teacher Routes β
ββββββββββββββββ¬βββββββββββββββ ββββββββββββββββ¬βββββββββββββββ
β β
ββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β PostgreSQL 16 β
β Port: 5432 β
β β
β β’ Users & Roles β
β β’ Courses & Enrollments β
β β’ Assignments β
β β’ Submissions β
β β’ Refresh Tokens β
βββββββββββββββββββββββββββββββ
ββββββββββββ ββββββββββββ βββββββββββββββ ββββββββββββββββ
β User ββββββΆβ Frontend ββββββΆβ NextAuth ββββββΆβ Google β
β β β :3000 β β OAuth β β OAuth 2.0 β
ββββββββββββ ββββββββββββ βββββββββββββββ ββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β User Service β
β POST /auth/ β
β google-signin β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β JWT Tokens β
β (Access + β
β Refresh) β
βββββββββββββββββββ
All services communicate via the academiasync-network bridge network:
| Container | Internal Hostname | External Port |
|---|---|---|
| Frontend | frontend |
3000 |
| User Service | user-service |
5000 |
| Course Service | course-service |
5001 |
| PostgreSQL | db |
5432 |
| Technology | Purpose | Version |
|---|---|---|
| Runtime Environment | 20.x | |
| Web Framework | 4.x | |
| Database | 16.x | |
| Token Authentication | 9.x | |
| OAuth 2.0 | 9.x | |
| HTTP Logging | 1.10.x | |
| API Documentation | 5.x |
| Technology | Purpose | Version |
|---|---|---|
| Containerization | 24.x | |
| Orchestration | 2.x | |
| Infrastructure as Code | 1.5.x | |
| Container Orchestration | Latest | |
| Container Registry | Latest | |
| CI/CD Pipeline | Latest | |
| Testing Framework | 29.x |
AcademiaSync/
βββ π frontend/ # Next.js Application
β βββ π app/ # App Router pages
β β βββ layout.tsx # Root layout with providers
β β βββ page.tsx # Landing page
β β βββ π api/ # API route handlers
β β β βββ π auth/[...nextauth] # OAuth configuration
β β β βββ π student/ # Student API routes
β β β βββ π teacher/ # Teacher API routes
β β β βββ π admin/ # Admin API routes
β β βββ π student/ # Student dashboard pages
β β βββ π teacher/ # Teacher dashboard pages
β β βββ π admin/ # Admin dashboard pages
β βββ π components/ # React components (60+)
β β βββ π ui/ # shadcn/ui base components
β β βββ student-*.tsx # Student-specific components
β β βββ teacher-*.tsx # Teacher-specific components
β β βββ admin-*.tsx # Admin-specific components
β βββ π lib/ # Utilities & API client
β βββ π types/ # TypeScript definitions
β βββ middleware.ts # Route protection
β βββ Dockerfile # Multi-stage build
β
βββ π backend/
β βββ π user-service/ # Auth & User Management
β β βββ π src/
β β β βββ π routes/ # API endpoints
β β β β βββ auth.js # OAuth & JWT
β β β β βββ admin.js # Admin operations
β β β β βββ dashboard.js # Dashboard data
β β β β βββ users.js # User CRUD
β β β βββ π middleware/ # Auth & authorization
β β β βββ π utils/ # HATEOAS, logging
β β βββ π tests/ # Jest test suites
β β βββ Dockerfile
β β
β βββ π course-service/ # Courses & Assignments
β β βββ π src/
β β β βββ π routes/
β β β β βββ courses.js # Course CRUD
β β β β βββ assignments.js # Assignment CRUD
β β β β βββ student.js # Student operations
β β β β βββ teacher.js # Teacher operations
β β β β βββ analytics.js # Analytics data
β β β βββ π middleware/
β β βββ π tests/
β β βββ Dockerfile
β β
β βββ π database/
β βββ init.sql # Schema initialization
β βββ seed-demo-data.sql # Demo data
β
βββ π terraform/ # AWS Infrastructure
β βββ main.tf # Root module
β βββ variables.tf # Variable definitions
β βββ outputs.tf # Output values
β βββ π modules/
β β βββ vpc/ # VPC & networking
β β βββ ecr/ # Container registry
β β βββ ecs/ # ECS cluster & services
β β βββ cloudwatch/ # Monitoring
β β βββ sns/ # Notifications
β βββ deploy.sh # Deployment script
β
βββ π .github/workflows/ # CI/CD Pipelines
β βββ ci.yml # Test suite
β βββ docker-build-push.yml # Build & push to ECR
β βββ terraform-deploy.yml # Infrastructure deployment
β
βββ π deployment/ # Deployment scripts
β βββ deploy.sh
β βββ init-db.sh
β βββ setup-supabase.sql
β
βββ π docs/ # Additional documentation
β βββ AWS_CONSOLE_GUIDE.md
β βββ AWS_OAUTH_FIX_EXPLAINED.md
β
βββ docker-compose.yml # Local development
βββ .env.example # Environment template
βββ README.md # This file
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/auth/google-signin |
Google OAuth sign-in | Public |
POST |
/auth/refresh |
Refresh access token | Cookie |
POST |
/auth/logout |
Logout user | JWT |
GET |
/profile |
Get user profile | JWT |
PUT |
/profile |
Update profile | JWT |
GET |
/admin/teachers |
List all teachers | Admin |
POST |
/admin/teachers |
Create teacher | Admin |
PUT |
/admin/teachers/:id |
Update teacher | Admin |
DELETE |
/admin/teachers/:id |
Delete teacher | Admin |
GET |
/admin/students |
List all students | Admin |
PUT |
/admin/promote-role |
Change user role | Admin |
GET |
/dashboard/stats |
Dashboard statistics | JWT |
GET |
/health |
Service health check | Public |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| Courses | |||
GET |
/courses |
List all courses | JWT |
POST |
/courses |
Create course | Teacher |
PUT |
/courses/:id |
Update course | Teacher |
DELETE |
/courses/:id |
Delete course | Teacher |
| Assignments | |||
GET |
/assignments/course/:id |
Get course assignments | JWT |
POST |
/assignments |
Create assignment | Teacher |
PUT |
/assignments/:id |
Update assignment | Teacher |
DELETE |
/assignments/:id |
Delete assignment | Teacher |
| Student Routes | |||
GET |
/student/courses |
Get enrolled courses | Student |
POST |
/student/enroll |
Enroll in course | Student |
GET |
/student/assignments |
Get assignments | Student |
POST |
/student/submit |
Submit assignment | Student |
| Teacher Routes | |||
GET |
/teacher/courses |
Get teacher's courses | Teacher |
GET |
/teacher/students/:courseId |
Get course students | Teacher |
GET |
/teacher/submissions |
Get submissions | Teacher |
PUT |
/teacher/grade/:submissionId |
Grade submission | Teacher |
| Analytics | |||
GET |
/analytics/student |
Student analytics | Student |
GET |
/analytics/teacher |
Teacher analytics | Teacher |
GET |
/analytics/admin |
Platform analytics | Admin |
GET |
/health |
Service health check | Public |
Access interactive API documentation at: http://localhost:5000/api-docs
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β users β β courses β β assignments β
βββββββββββββββββββ€ βββββββββββββββββββ€ βββββββββββββββββββ€
β id (PK) β β id (PK) β β id (PK) β
β email βββββββββ teacher_id (FK) β β course_id (FK) ββββ
β google_id β β title βββββββββ title β β
β password_hash β β description β β description β β
β role β β weeks β β due_date β β
β first_name β β created_at β β created_at β β
β last_name β β updated_at β β updated_at β β
β age β βββββββββββββββββββ βββββββββββββββββββ β
β specialization β β β
β profile_picture β βββββββββββββββββββ βββββββββ΄ββββββββββββ΄βββ
β created_at β β enrollments β β submissions β
β updated_at β βββββββββββββββββββ€ ββββββββββββββββββββββββ€
ββββββββββ¬βββββββββ β id (PK) β β id (PK) β
β β student_id (FK) ββββ β assignment_id (FK) β
β β course_id (FK) β β β student_id (FK) ββββ
β β enrolled_at β β β submission_text β β
β βββββββββββββββββββ β β submitted_at β β
β β² β β grade β β
β β β β feedback β β
ββββββββββββββββββββββββββ΄βββββββββββββ΄βββββ΄βββββββββββββββββββββββ
β
βββββββββββββββββββ β
β refresh_tokens β β
βββββββββββββββββββ€ β
β id (PK) β β
β user_id (FK) βββββββββββββββββββββββββββββββββββ
β token β
β expires_at β
β created_at β
βββββββββββββββββββ
| Table | Description | Key Fields |
|---|---|---|
users |
All platform users | role: Student/Teacher/Admin |
courses |
Course catalog | teacher_id links to creator |
enrollments |
Student-course mapping | Unique constraint on student+course |
assignments |
Course assignments | course_id links to parent course |
submissions |
Student submissions | grade & feedback fields |
refresh_tokens |
JWT refresh tokens | Auto-expires |
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downThe application is deployable to AWS ECS Fargate using Terraform:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AWS Cloud β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β VPC β β
β β βββββββββββββββββββ βββββββββββββββββββ β β
β β β Public Subnet β β Public Subnet β β β
β β β (AZ-1) β β (AZ-2) β β β
β β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ β β
β β β β β β
β β ββββββββββββ¬ββββββββββββ β β
β β β β β
β β βββββββββΌββββββββ β β
β β β ALB β β β
β β β (Load Balancer)β β β
β β βββββββββ¬ββββββββ β β
β β β β β
β β βββββββββββββββββββΌββββββββββββββββββ β β
β β β β β β β
β β βΌ βΌ βΌ β β
β β ββββββββ ββββββββββββ βββββββββββββ β β
β β β ECS β β ECS β β ECS β β β
β β βFront β β User β β Course β β β
β β β end β β Service β β Service β β β
β β ββββββββ ββββββββββββ βββββββββββββ β β
β β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β ECR β βCloudWatchβ β SNS β β Secrets β β
β β Registry β β Logs β β Alerts β β Manager β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cd terraform
# Initialize Terraform
terraform init
# Preview changes
terraform plan
# Deploy infrastructure
terraform apply
# Destroy infrastructure
terraform destroySee terraform/README.md for detailed deployment instructions.
- Triggers: Push to main/develop, Pull requests
- Jobs:
- Test User Service
- Test Course Service
- Build Frontend
- Triggers: Changes to
app-deployment/** - Jobs:
- Detect changed services
- Build Docker images
- Run security scans (Trivy)
- Push to AWS ECR
- Triggers: Changes to
terraform/** - Jobs:
- Validate Terraform
- Plan infrastructure changes
- Apply changes (manual approval)
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Push to ββββββΆβ Run CI ββββββΆβ Build & β
β main β β Tests β β Push ECR β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β
βΌ
ββββββββββββββββ ββββββββββββββββ
β Deploy βββββββ Terraform β
β to ECS β β Apply β
ββββββββββββββββ ββββββββββββββββ
# Database
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=academiasync
DB_PORT=5432
# Services
USER_SERVICE_PORT=5000
COURSE_SERVICE_PORT=5001
# JWT
JWT_SECRET=<your-jwt-secret>
JWT_REFRESH_SECRET=<your-jwt-refresh-secret>
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_EXPIRY=7d
# OAuth
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
# NextAuth
NEXTAUTH_SECRET=<generate-with-openssl>
NEXTAUTH_URL=http://localhost:3000
# Service URLs (external)
NEXT_PUBLIC_BACKEND_URL=http://localhost:5000
NEXT_PUBLIC_COURSE_SERVICE_URL=http://localhost:5001
# Service URLs (internal Docker network)
INTERNAL_BACKEND_URL=http://user-service:5000
INTERNAL_COURSE_SERVICE_URL=http://course-service:5001For production deployment, store secrets in AWS Secrets Manager and reference them in terraform.tfvars:
# terraform/terraform.tfvars
nextauth_secret = "aws-secrets-manager-arn"
google_client_id = "your-client-id"
google_client_secret = "aws-secrets-manager-arn"
jwt_secret = "aws-secrets-manager-arn"
database_url = "postgresql://..."| Document | Description |
|---|---|
| AWS Console Guide | AWS setup walkthrough |
| AWS OAuth Fix | OAuth troubleshooting |
| Terraform README | Infrastructure deployment |
| Copilot Instructions | Development conventions |
- Microservices Architecture: Separation of user management and course management for independent scaling
- JWT + OAuth: Hybrid authentication for security and user convenience
- Docker Compose for Dev: Consistent local development environment
- Terraform for Prod: Infrastructure as Code for reproducible deployments
- Next.js App Router: Modern React patterns with server components
- shadcn/ui: Accessible, customizable UI components
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the Copilot Instructions for coding conventions
- Always use Docker for running services
- Write tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
AcademiaSync - Empowering Teachers, Inspiring Students
Made with β and π» | Β© 2025 AcademiaSync