Skip to content

Laksopan23/SkillZone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SkillZone

A modern, full-stack skill-sharing and learning community platform built with Spring Boot and React. SkillZone empowers users to share their learning journey, showcase skills, engage with peers through posts and comments, and build a professional network.


πŸš€ Features

User Management

  • Registration & Authentication

    • Email-based user registration with secure password handling
    • Email/password login
    • Google OAuth2 integration for seamless sign-up
    • User profile management with bio and personal information
  • Social Networking

    • Follow/unfollow users
    • User discovery and profile viewing
    • User activity tracking

Post Management

  • Full CRUD Operations

    • Create, read, update, and delete posts
    • Rich content support with titles and descriptions
    • Media attachments (images, files up to 50MB)
  • Engagement Features

    • Like system with user tracking
    • Comment functionality with nested support
    • Post filtering (all posts, personal posts)

Learning Progress Tracking

  • Skill Documentation

    • Track learning progress by skill with detailed descriptions
    • Document start and end dates for learning goals
    • Categorize skills by field/domain
    • Attach supporting materials (images, PDFs)
  • Progress Management

    • View all community learning progress
    • Track personal learning journey
    • Update and monitor skill development

Notification System

  • Real-time Alerts
    • Activity-based notifications (likes, comments, follows)
    • Read/unread status tracking
    • Notification badge in navigation bar
    • Instant notification updates

πŸ› οΈ Tech Stack

Backend

Technology Version Purpose
Spring Boot 3.4.4 Web framework & API
Java 24 Programming language
MongoDB Latest Primary document database
MySQL Latest Relational data support
Spring Security 3.x Authentication & authorization
Spring OAuth2 3.x OAuth2 client integration
Maven 3.x Build & dependency management

Frontend

Technology Version Purpose
React 19.1.0 UI framework
React Router DOM 7.4.1 Client-side routing
Axios 1.8.4 HTTP client
React Icons 5.5.0 Icon library
React Modal 3.16.3 Modal components
Jest & React Testing Library Latest Testing framework

πŸ“ Project Structure

SkillZone/
β”œβ”€β”€ backend/                          # Spring Boot application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/backend/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SkillZoneApplication.java
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CorsConfig.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SecurityConfig.java
β”‚   β”‚   β”‚   β”‚   β”‚   └── WebConfig.java
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ controller/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserController.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostManagementController.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LearningProgressController.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NotificationController.java
β”‚   β”‚   β”‚   β”‚   β”‚   └── OAuthController.java
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ model/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserModel.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostManagementModel.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LearningProgressModel.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NotificationModel.java
β”‚   β”‚   β”‚   β”‚   β”‚   └── Comment.java
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ repository/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserRepository.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostManagementRepository.java
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LearningProgressRepository.java
β”‚   β”‚   β”‚   β”‚   β”‚   └── NotificationRepository.java
β”‚   β”‚   β”‚   β”‚   └── exception/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ UserNotFoundException.java
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ PostManagementNotFoundException.java
β”‚   β”‚   β”‚   β”‚       └── LearningProgressNotFoundException.java
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   β”‚       └── application.properties
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/backend/
β”‚   β”œβ”€β”€ pom.xml
β”‚   └── mvnw / mvnw.cmd
β”‚
β”œβ”€β”€ frontend/                         # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ Pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ UserManagement/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserLogin.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserRegister.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserProfile.js
β”‚   β”‚   β”‚   β”‚   └── UpdateUserProfile.js
β”‚   β”‚   β”‚   β”œβ”€β”€ PostManagement/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AllPost.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddNewPost.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MyPost.js
β”‚   β”‚   β”‚   β”‚   └── UpdatePost.js
β”‚   β”‚   β”‚   β”œβ”€β”€ LearningProgress/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AllLearningProgress.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddLearningProgress.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MyLearningProgress.js
β”‚   β”‚   β”‚   β”‚   └── UpdateLearningProgress.js
β”‚   β”‚   β”‚   └── NotificationManagement/
β”‚   β”‚   β”‚       └── NotificationsPage.js
β”‚   β”‚   β”œβ”€β”€ Components/
β”‚   β”‚   β”‚   └── NavBar/
β”‚   β”‚   β”‚       β”œβ”€β”€ NavBar.js
β”‚   β”‚   β”‚       └── NavBar.css
β”‚   β”‚   β”œβ”€β”€ App.js
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   └── App.css
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── index.html
β”‚   └── package.json
β”‚
└── README.md

πŸ”§ Installation & Setup

Prerequisites

  • Java 24+ (JDK)
  • Node.js 18+ & npm
  • MongoDB Atlas account (or local MongoDB)
  • MySQL (optional, for secondary database)
  • Git (for version control)

Backend Setup

  1. Navigate to backend directory:

    cd backend
  2. Create Environment Configuration:

    • Copy the example environment file:
    cp .env.example .env
    • Edit .env with your actual credentials:
    MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/
    MONGODB_DATABASE=<your_database_name>
    GOOGLE_CLIENT_ID=<your_google_client_id>
    GOOGLE_CLIENT_SECRET=<your_google_client_secret>
  3. Configure Application Properties:

    • Environment variables are now automatically loaded via Spring Boot
    • The application.properties file uses ${VARIABLE_NAME} syntax
    • No need to edit application.properties - just set environment variables
  4. Set Environment Variables (Windows PowerShell):

    $env:MONGODB_URI="mongodb+srv://<username>:<password>@<cluster>.mongodb.net/"
    $env:MONGODB_DATABASE="your_database_name"
    $env:GOOGLE_CLIENT_ID="your_client_id"
    $env:GOOGLE_CLIENT_SECRET="your_client_secret"
  5. Set Environment Variables (Linux/macOS):

    export MONGODB_URI="mongodb+srv://<username>:<password>@<cluster>.mongodb.net/"
    export MONGODB_DATABASE="your_database_name"
    export GOOGLE_CLIENT_ID="your_client_id"
    export GOOGLE_CLIENT_SECRET="your_client_secret"
  6. Build the project:

    mvn clean install
  7. Run the application:

    mvn spring-boot:run

    Backend runs on http://localhost:8080

Frontend Setup

  1. Navigate to frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start

    Frontend runs on http://localhost:3000

  4. Build for production:

    npm run build

πŸ“‘ API Endpoints

Base URL: http://localhost:8080

User Management

Method Endpoint Description
POST /user Register new user
POST /login User login (email & password)
GET /user/{id} Get user profile
PUT /user/{id} Update user profile
GET /user/follow/{userId} Follow a user
GET /user/unfollow/{userId} Unfollow a user

Post Management

Method Endpoint Description
GET /posts Get all posts
POST /posts Create new post
GET /posts/{id} Get post details
PUT /posts/{id} Update post
DELETE /posts/{id} Delete post
GET /posts/user/{userId} Get user's posts
POST /posts/{id}/like Like a post
POST /posts/{id}/comment Add comment to post

Learning Progress

Method Endpoint Description
GET /learningProgress Get all learning progress
POST /learningProgress Create learning progress
GET /learningProgress/{id} Get progress details
PUT /learningProgress/{id} Update progress
DELETE /learningProgress/{id} Delete progress
GET /learningProgress/user/{userId} Get user's progress

Notifications

Method Endpoint Description
GET /notifications/{userId} Get user notifications
PUT /notifications/{id}/read Mark notification as read
DELETE /notifications/{id} Delete notification

OAuth

Method Endpoint Description
GET /oauth2/success OAuth2 callback handler

βš™οΈ Configuration

Application Properties (backend/src/main/resources/application.properties)

# Application Name
spring.application.name=backend

# MongoDB Configuration
spring.data.mongodb.uri=mongodb+srv://<user>:<pass>@cluster.mongodb.net/
spring.data.mongodb.database=test

# File Upload Configuration
media.upload.dir=uploads/media
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB

# Google OAuth2 Configuration
spring.security.oauth2.client.registration.google.client-id=<your_id>
spring.security.oauth2.client.registration.google.client-secret=<your_secret>
spring.security.oauth2.client.registration.google.scope=email,profile

# Security
spring.main.allow-bean-definition-overriding=true

CORS Configuration

CORS is configured to allow requests from http://localhost:3000 in SkillZoneApplication.java:

registry.addMapping("/**")
    .allowedOrigins("http://localhost:3000")
    .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
    .allowedHeaders("*")
    .allowCredentials(true);

For production, update the allowedOrigins value accordingly.


πŸ” Security Considerations

⚠️ Important Security Notes:

Environment Variables (CRITICAL)

  • NEVER commit .env files to Git - They are automatically gitignored
  • Always use environment variables for sensitive data:
    • Database credentials
    • API keys
    • OAuth secrets
    • API tokens
    • JWT secrets

Password Security

  • Implement password hashing using bcrypt:
    import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
    
    new BCryptPasswordEncoder().encode(password)

Exposed Credentials Handling

If credentials are accidentally committed:

  1. Immediately rotate the credentials in your service provider
  2. Force push corrected history (only if not yet public):
    git filter-branch --tree-filter 'rm -f <sensitive_file>' HEAD
    git push origin main --force
  3. Monitor access logs for unauthorized activity
  4. Update all dependent systems with new credentials

HTTPS & TLS

  • Enable HTTPS in production
  • Use valid SSL certificates
  • Enforce HTTPS redirects

CORS Configuration

  • Update SkillZoneApplication.java for production:
    .allowedOrigins("https://yourdomain.com")  // Not localhost in production

JWT Authentication

  • Implement JWT tokens instead of sessions
  • Use secure token signing
  • Set appropriate token expiration times

Input Validation

  • Add @Valid annotations to request parameters
  • Use validation annotations:
    @NotNull, @NotBlank, @Email, @Size, etc.

Database Security

  • Use MongoDB Atlas IP Whitelist
  • Enable MongoDB authentication
  • Use read-only roles where appropriate
  • Enable audit logging

API Security

  • Implement rate limiting
  • Add request validation
  • Use API keys for sensitive endpoints
  • Log security events

OAuth2 Security

  • Keep client secrets secret (use environment variables)
  • Implement PKCE for mobile apps
  • Validate redirect URIs
  • Use secure state parameter handling

Dependency Management

  • Regularly update dependencies:
    mvn dependency:update-check
    npm audit
  • Monitor for CVEs
  • Use dependency scanning tools

πŸš€ Deployment Security Checklist

  • All credentials are environment variables
  • No secrets in version control
  • HTTPS enabled
  • CORS properly configured
  • Input validation implemented
  • Database backups configured
  • Monitoring and logging enabled
  • Security headers configured
  • Rate limiting implemented
  • Regular security audits scheduled

πŸ“ Usage Examples

User Registration

curl -X POST http://localhost:8080/user \
  -H "Content-Type: application/json" \
  -d '{
    "fullname": "John Doe",
    "email": "john@example.com",
    "password": "password123",
    "phone": "1234567890"
  }'

Create a Post

curl -X POST http://localhost:8080/posts \
  -H "Content-Type: application/json" \
  -d '{
    "userID": "user_id",
    "title": "My First Post",
    "description": "This is my first post on SkillZone",
    "media": ["image1.jpg"]
  }'

Add Learning Progress

curl -X POST http://localhost:8080/learningProgress \
  -H "Content-Type: application/json" \
  -d '{
    "postOwnerID": "user_id",
    "skillTitle": "React.js",
    "description": "Learning React fundamentals",
    "field": "Web Development",
    "startDate": "2026-01-01",
    "endDate": "2026-03-31"
  }'

πŸ§ͺ Testing

Backend Tests

cd backend
mvn test

Frontend Tests

cd frontend
npm test

πŸš€ Deployment

Backend Deployment (Spring Boot)

  1. Build JAR: mvn clean package
  2. Deploy to cloud platforms (AWS, Azure, Heroku, etc.)
  3. Set environment variables for database and OAuth credentials

Frontend Deployment (React)

  1. Build: npm run build
  2. Deploy to:
    • Vercel: Push to GitHub and connect
    • Netlify: Drag & drop build folder or Git integration
    • AWS S3 + CloudFront: Manual upload
    • GitHub Pages: Configure for production build

πŸ“š Additional Resources


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘€ Author

SkillZone Development Team

For questions, feedback, or collaboration opportunities, please reach out through the project repository.


πŸ› Troubleshooting

MongoDB Connection Error

  • Verify MongoDB URI in application.properties
  • Check network access in MongoDB Atlas (whitelist IP)
  • Ensure cluster is running

CORS Errors

  • Verify frontend URL in SkillZoneApplication.java
  • Ensure backend is running on port 8080

OAuth Issues

  • Verify Google OAuth2 credentials are correct
  • Check redirect URI configuration in Google Console
  • Ensure credentials are set in application.properties

Frontend Build Issues

  • Delete node_modules and package-lock.json
  • Run npm install again
  • Clear npm cache: npm cache clean --force

πŸ“ˆ Future Enhancements

  • Real-time notifications using WebSockets
  • Advanced search and filtering
  • User messaging/chat feature
  • Gamification (badges, points)
  • Mobile app (React Native)
  • API documentation (Swagger/OpenAPI)
  • Advanced analytics dashboard
  • User recommendation system
  • Video content support
  • AI-powered skill suggestions

About

Collaborative social learning platform for real-time skill-sharing and peer-to-peer knowledge exchange.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors