A full‑stack university social platform for VIT students with posts, clubs, events, chat, and an admin dashboard.
- React + TypeScript (MUI, React Router)
- Spring Boot 3 + Java 21 (JWT, Spring Security, JPA)
- MySQL 8
- Deployed on AWS (EC2 + RDS + S3 + Amplify)
- Project Overview
- Features
- Tech Stack
- Repository Structure
- Prerequisites
- Local Setup and Run
- Environment Configuration
- Build and Test
- AWS Deployment Presentation Guide
- Security
- Cost and Optimization
- Challenges & Solutions
- .gitignore Recommendations
UniConnect is a university social platform for VIT students enabling social networking, club and event management, real‑time chat, and an admin dashboard.
- Authentication with VIT email + JWT
- User profiles (bio, avatar), feed with posts, likes, comments
- Clubs (create/join/manage with roles)
- Events (OD tracking)
- Real‑time chat
- Admin dashboard (moderation, analytics)
- Backend: Spring Boot 3.3.3, Java 21, Spring Security (JWT), Spring Data JPA, Maven, MySQL 8
- Frontend: React 19, TypeScript, CRA, React Router v7, Material UI, Axios
- Storage: Local filesystem (dev) or AWS S3 (prod)
- Deployment: AWS EC2 (backend), RDS (MySQL), S3 (media), Amplify (frontend)
UniConnect/
├─ unisocial-frontend/ # React app
│ ├─ src/
│ ├─ package.json
│ ├─ env.example # sample frontend env
│ └─ (build/, node_modules/ not committed)
├─ unisocial-backend/ # Spring Boot app
│ ├─ src/main/java/
│ ├─ src/main/resources/application.properties
│ ├─ pom.xml
│ └─ (target/ not committed)
├─ uploads/ # local uploads (dev only, not committed)
└─ README.md
- Node.js (LTS) and npm
- Java 21
- Maven 3.9+
- MySQL 8
- Create DB:
CREATE DATABASE IF NOT EXISTS unisocial;
- Configure credentials in
unisocial-backend/src/main/resources/application.properties:spring.datasource.url=jdbc:mysql://localhost:3306/unisocial?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC spring.datasource.username=<your_mysql_user> spring.datasource.password=<your_mysql_password> spring.jpa.hibernate.ddl-auto=update
- Ensure
file.upload-dirpoints to a valid local folder.
# from unisocial-backend
mvn spring-boot:run
# runs at http://localhost:8080# from unisocial-frontend
cp env.example .env # or create .env
# Ensure
# REACT_APP_API_URL=http://localhost:8080
npm install
npm start # http://localhost:3000- Frontend:
unisocial-frontend/.envREACT_APP_API_URL=http://localhost:8080
- Backend:
application.properties(avoid committing secrets). Prefer:- Environment variables:
${DB_USER},${DB_PASS} - Or
application-local.properties(gitignored) with--spring.profiles.active=local
- Environment variables:
npm run build
npm testmvn clean package
java -jar target/unisocial-backend-0.0.1-SNAPSHOT.jar
mvn test-
Services Used
- EC2: Hosts Spring Boot backend (HTTPS: 8443)
- RDS MySQL: Managed database
- S3: Media storage (images/videos/profile pictures)
- Amplify + CloudFront: Hosts the React frontend with HTTPS and CDN
- IAM: EC2 instance role for secure S3 access (no hardcoded keys)
-
Backend Deployment (EC2)
- Build jar:
mvn clean package -DskipTests - Copy jar to EC2 and run with AWS profile:
java -jar -Dspring.profiles.active=aws app.jar - Expose port 8443 in EC2 Security Group; allow EC2 SG to access RDS (3306)
- Use self‑signed SSL for demo or ACM + ALB for production
- Build jar:
-
Frontend Deployment (Amplify)
- Set
REACT_APP_API_URL=https://<backend-domain-or-ip>:8443 npm run buildand upload thebuild/folder to Amplify (manual deploy)
- Set
-
Notes
- Configure CORS on backend to allow the Amplify domain
- Store secrets in environment or AWS Parameter Store/Secrets Manager
- Prefer S3 for media in production; avoid storing uploads on EC2 disk
Screenshots are stored under docs/screenshots/:
- Do not commit secrets. Use env vars or local profiles.
- Frontend: commit
env.example, never commit.envwith secrets. - Backend: move real credentials to
application-local.properties(gitignored) or environment.
- Free tier friendly; ~ $26/month post‑free tier baseline.
- Use reserved instances, scale EC2/RDS as needed, S3 lifecycle policies.
- HTTPS mismatch → enable SSL on backend or put ALB/ACM
- S3 public access → use bucket policy, no ACLs
- DB connectivity → SG rules to allow EC2 → RDS
# Node/React
unisocial-frontend/node_modules/
unisocial-frontend/build/
unisocial-frontend/.env
# Java/Spring
unisocial-backend/target/
unisocial-backend/*.iml
unisocial-backend/.classpath
unisocial-backend/.project
unisocial-backend/.settings/
unisocial-backend/src/main/resources/application-local.properties
# Local uploads
uploads/
# IDE
.vscode/
.idea/
.metadata/
# OS junk
.DS_Store
Thumbs.db
=======