Skip to content

SahanChamara/Social-Learning-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Social Learning Platform

A collaborative platform where educators, students, and professionals share knowledge through courses, tutorials, and study materials. Users can create content, engage with others' materials, track their learning progress, and discover new topics based on their interests.

Think: Udemy (course structure) + Medium (content sharing) + Reddit (community engagement)


🌟 Key Features

For Learners

  • πŸ“š Browse and enroll in courses with structured learning paths
  • πŸ“Š Track progress with completion percentages and learning streaks
  • πŸ’¬ Engage through comments, ratings, and discussions
  • πŸ† Earn achievements and badges for milestones
  • πŸ”– Bookmark content for later reference
  • πŸ” Discover personalized recommendations
  • πŸ“± Clean, accessible UI with dark mode support

For Creators

  • ✍️ Create courses with modules and lessons
  • πŸ“ Publish tutorials and study materials
  • πŸ“ˆ View analytics (enrollments, completions, engagement)
  • πŸ’‘ Respond to learner questions
  • πŸ‘₯ Build a following and community

Platform Features

  • πŸ” Secure authentication with JWT
  • ⚑ Real-time updates for comments and notifications
  • 🎨 Beautiful UI with Radix UI and Tailwind CSS
  • πŸš€ GraphQL API for efficient data fetching
  • πŸ“± Responsive design for all devices
  • β™Ώ Accessibility-first with WCAG compliance

πŸ› οΈ Technology Stack

Backend

  • Framework: Spring Boot 3.2+ (Java 21)
  • API: GraphQL (Spring for GraphQL)
  • Database: PostgreSQL 15+
  • ORM: Spring Data JPA
  • Security: Spring Security + JWT
  • Build Tool: Maven

Frontend

  • Framework: React 19 with TypeScript
  • Build Tool: Vite 7+
  • GraphQL Client: Apollo Client 3.11+
  • UI Components: Radix UI (unstyled primitives)
  • Styling: Tailwind CSS 4+
  • Routing: React Router v6
  • Forms: React Hook Form + Zod
  • Icons: Lucide React

Database

  • Primary: PostgreSQL 15+
  • Features: Full-text search, JSONB, triggers, indexes

πŸ“ Project Structure

Social Learning Platform/
β”œβ”€β”€ .agent/                      # πŸ“š Comprehensive documentation
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   └── schema.md           # Complete database schema
β”‚   β”œβ”€β”€ graphql/
β”‚   β”‚   └── schema.graphql      # GraphQL API definition
β”‚   β”œβ”€β”€ backend/
β”‚   β”‚   └── architecture.md     # Backend architecture guide
β”‚   β”œβ”€β”€ frontend/
β”‚   β”‚   └── architecture.md     # Frontend architecture guide
β”‚   β”œβ”€β”€ learning/
β”‚   β”‚   └── comprehensive-guide.md  # Learning resources
β”‚   β”œβ”€β”€ implementation-plan.md  # Phase-by-phase roadmap
β”‚   β”œβ”€β”€ quick-reference.md      # Commands & snippets
β”‚   └── README.md               # Documentation index
β”‚
β”œβ”€β”€ backend/                     # Spring Boot application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/com/sociallearning/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ entity/          # JPA entities
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ repository/      # Data access layer
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ service/         # Business logic
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ graphql/         # GraphQL resolvers
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ security/        # Authentication & authorization
β”‚   β”‚   β”‚   β”‚   └── config/          # Configuration classes
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   β”‚       β”œβ”€β”€ application.yml
β”‚   β”‚   β”‚       └── graphql/schema.graphqls
β”‚   β”‚   └── test/
β”‚   └── pom.xml
β”‚
β”œβ”€β”€ frontend/                    # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/              # Radix UI base components
β”‚   β”‚   β”‚   β”œβ”€β”€ features/        # Feature-specific components
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/          # Layout components
β”‚   β”‚   β”‚   └── common/          # Common utilities
β”‚   β”‚   β”œβ”€β”€ pages/               # Page components (routes)
β”‚   β”‚   β”œβ”€β”€ graphql/             # GraphQL queries/mutations
β”‚   β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ context/             # React Context providers
β”‚   β”‚   β”œβ”€β”€ types/               # TypeScript types
β”‚   β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   └── styles/              # Global styles
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── tailwind.config.js
β”‚
└── README.md                    # This file

πŸš€ Quick Start

Prerequisites

  • Java 21+ (JDK)
  • Node.js 18+ and npm
  • PostgreSQL 15+
  • Maven 3.8+
  • Git

1. Clone the Repository

git clone <repository-url>
cd "Social Learning Platform"

2. Set Up Database

# Create PostgreSQL database
psql -U postgres
CREATE DATABASE sociallearning;
\q

3. Configure Backend

cd backend

# Copy example config
cp src/main/resources/application-example.yml src/main/resources/application.yml

# Update database credentials in application.yml
# Update JWT secret key

# Run backend
./mvnw spring-boot:run

Backend will start at: http://localhost:8080

4. Set Up Frontend

cd frontend

# Install dependencies
npm install

# Copy example env
cp .env.example .env.local

# Update API endpoints in .env.local

# Start dev server
npm run dev

Frontend will start at: http://localhost:5173



πŸ§ͺ Testing

Backend Tests

cd backend
./mvnw test                    # Run all tests
./mvnw test -Dtest=CourseServiceTest  # Run specific test

Frontend Tests

cd frontend
npm test                       # Run tests
npm test -- --coverage         # With coverage

πŸ—οΈ Build for Production

Backend

cd backend
./mvnw clean package
java -jar target/social-learning-platform-0.0.1-SNAPSHOT.jar

Frontend

cd frontend
npm run build
# Output in dist/ folder


🀝 Contributing

This is a learning project. Contributions, issues, and feature requests are welcome!

Development Workflow

  1. Create a feature branch
  2. Follow the architecture documented in .agent/
  3. Write tests for new features
  4. Submit a pull request

πŸ” Security

  • JWT-based authentication
  • Password hashing with BCrypt
  • Input validation and sanitization
  • SQL injection prevention
  • XSS protection
  • CORS configuration
  • Rate limiting (production)

Quick fixes:

# Backend: Port already in use
netstat -ano | findstr :8080
taskkill /PID <PID> /F

# Frontend: Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

# Database: Reset database
psql -U postgres
DROP DATABASE sociallearning;
CREATE DATABASE sociallearning;

πŸ™ Acknowledgments

  • Spring Boot team for excellent framework
  • GraphQL Foundation for the query language
  • Radix UI for accessible primitives
  • Tailwind Labs for amazing CSS framework
  • Apollo team for GraphQL client
  • React team for the UI library

πŸ“¬ Contact

For questions or feedback about this project, please open an issue on GitHub.


Happy Learning! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages