{"id":50840027,"url":"https://github.com/vimalyad/studi.io_backend","last_synced_at":"2026-06-14T06:06:27.169Z","repository":{"id":323729862,"uuid":"1093651454","full_name":"vimalyad/studi.io_backend","owner":"vimalyad","description":"A comprehensive Spring Boot backend for Studi.io - a collaborative study platform with real-time chat, room management, and secure authentication.","archived":false,"fork":false,"pushed_at":"2025-11-19T08:07:47.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T18:38:02.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vimalyad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T16:51:02.000Z","updated_at":"2025-11-19T08:07:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vimalyad/studi.io_backend","commit_stats":null,"previous_names":["yamisukehiro2907/studi.io_backend","vimalyad/studi.io_backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vimalyad/studi.io_backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalyad%2Fstudi.io_backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalyad%2Fstudi.io_backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalyad%2Fstudi.io_backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalyad%2Fstudi.io_backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vimalyad","download_url":"https://codeload.github.com/vimalyad/studi.io_backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalyad%2Fstudi.io_backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34310810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-14T06:06:26.048Z","updated_at":"2026-06-14T06:06:27.162Z","avatar_url":"https://github.com/vimalyad.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Studi.io Backend\n\nA comprehensive Spring Boot backend for Studi.io - a collaborative study platform with real-time chat, room management, and secure authentication.\n\n## ✨ Features\n\n### 🎯 Core Features\n\n* 🚪 **Create \u0026 Join Rooms** – Easily create or join public/private study rooms\n* 💬 **Real-time Chat** – Instant messaging with WebSocket (STOMP) for seamless communication\n* 🔒 **Privacy Control** – Public or private rooms with customizable access\n* 🖼️ **Room Customization** – Set custom names, descriptions, and room images\n* ☁️ **Cloud Image Uploads** – Profile and room images hosted on Cloudinary\n* ⚙️ **Room Management** – Full CRUD operations for room owners and admins\n* 👥 **Member Management** – Admin controls and member permissions\n* 🔐 **Secure Authentication** – JWT-based auth with access/refresh tokens stored in HTTP-only cookies\n* 📧 **Email Service** – OTP verification and email notifications via SendGrid\n* 🛡️ **Rate Limiting** – Bucket4j-based rate limiting for API endpoints (general, login, signup, user-specific)\n* 📊 **Message Pagination** – Efficient message retrieval with pagination support\n* 📝 **Collaborative Whiteboard** – Real-time drawing and note-taking\n* 🗂️ **ResourceHub** – Centralized document and link management\n\n### 🚀 Upcoming Features\n\n* 🎥 **Video Chat** – Built-in video conferencing\n* 📊 **Study Analytics** – Track study time and productivity\n* 🔔 **Push Notifications** – Browser push notifications for updates\n\n## 🛠️ Tech Stack\n\n### Backend\n- **Framework:** Spring Boot 3.x\n- **Language:** Java 17+\n- **Database:** MongoDB (via Spring Data MongoDB)\n- **Authentication:** JWT (JJWT)\n- **Real-time:** WebSocket (STOMP protocol)\n- **File Upload:** Cloudinary\n- **Email:** SendGrid (JavaMail)\n- **Rate Limiting:** Bucket4j + Caffeine Cache\n- **Security:** Spring Security 6\n- **Validation:** Jakarta Validation\n\n### Dependencies\n```xml\n- spring-boot-starter-web\n- spring-boot-starter-data-mongodb\n- spring-boot-starter-security\n- spring-boot-starter-websocket\n- spring-boot-starter-mail\n- jjwt-api / jjwt-impl / jjwt-jackson\n- cloudinary-http44\n- bucket4j-core\n- caffeine\n- dotenv-java\n- lombok\n```\n\n## 📁 Project Structure\n\n```\nsrc/main/java/io/studi/backend/\n├── config/\n│   ├── websocket/          # WebSocket configuration \u0026 session management\n│   ├── AppInfoConfig.java\n│   ├── CloudinaryConfig.java\n│   ├── CorsConfig.java\n│   ├── DotenvProcessor.java\n│   ├── MongoConfig.java\n│   ├── RateLimitFilter.java\n│   └── SecurityConfig.java\n├── controllers/            # REST API endpoints\n├── dtos/                   # Data Transfer Objects\n│   ├── Requests/\n│   ├── common/\n│   ├── messages/\n│   ├── rooms/\n│   └── users/\n├── exceptions/             # Custom exceptions \u0026 global handler\n├── helpers/                # Utility classes\n├── models/                 # MongoDB entities\n├── repositories/           # Data access layer\n├── security/               # Authentication \u0026 authorization\n├── services/               # Business logic\n└── utils/                  # JWT utilities\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Java 17 or higher\n- Maven 3.6+\n- MongoDB instance (local or cloud)\n- Cloudinary account\n- SendGrid account\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/yamiSukehiro2907/studi.io_backend\n   cd studi-backend\n   ```\n\n2. **Configure environment variables**\n   \n   Create a `.env` file in the root directory:\n   ```env\n   MONGODB_URI=mongodb://localhost:27017/studiodb\n   MONGODB_DB=studiodb\n   \n   ACCESS_TOKEN_SECRET=your_access_token_secret_min_32_chars\n   REFRESH_TOKEN_SECRET=your_refresh_token_secret_min_32_chars\n   ACCESS_TOKEN_EXPIRATION=3600000\n   REFRESH_TOKEN_EXPIRATION=604800000\n   \n   EMAIL=your-email@example.com\n   SENDGRID_APIKEY=your_sendgrid_api_key\n   \n   CLOUDINARY_CLOUDNAME=your_cloud_name\n   CLOUDINARY_APISECRET=your_api_secret\n   CLOUDINARY_APIKEY=your_api_key\n   ```\n\n3. **Build the project**\n   ```bash\n   mvn clean install\n   ```\n\n4. **Run the application**\n   ```bash\n   mvn spring-boot:run\n   ```\n\nThe server will start on `http://localhost:8081`\n\n## 📚 API Documentation\n\n### Authentication Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | `/auth/register` | Register a new user |\n| POST | `/auth/login` | Login and receive JWT tokens |\n| POST | `/auth/logout` | Logout and clear tokens |\n| POST | `/auth/refresh` | Refresh access token |\n\n### User Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/user/profile` | Get current user profile |\n| PUT | `/user/update` | Update user profile (multipart) |\n| PUT | `/user/change-password` | Change password (authenticated) |\n| PUT | `/user/change-password-with-current` | Change password with current verification |\n\n### Study Room Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | `/rooms/create` | Create a new study room |\n| GET | `/rooms/` | Get all rooms for current user |\n| GET | `/rooms/{id}` | Get room details by ID |\n| POST | `/rooms/{id}/join` | Join a public room |\n| PUT | `/rooms/{id}/update` | Update room info (multipart) |\n| DELETE | `/rooms/{id}` | Delete a room (owner only) |\n\n### Message Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/messages/{id}?page=1` | Get paginated messages for a room |\n\n### OTP Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | `/otp/send-otp` | Send OTP to email |\n| POST | `/otp/verify-otp` | Verify OTP |\n\n### WebSocket Endpoints\n\n| Endpoint | Description |\n|----------|-------------|\n| `/ws` | WebSocket connection endpoint |\n| `/server/sendMessage` | Client sends message |\n| `/server/room/{roomId}` | Subscribe to room updates |\n\n## 🔒 Security Features\n\n- **JWT Authentication** with access and refresh tokens\n- **HTTP-only cookies** for secure token storage\n- **CORS configuration** with allowed origins\n- **Rate limiting** at multiple levels:\n  - General: 100 requests/minute per IP\n  - Login: 5 attempts/minute per IP\n  - Signup: 2 attempts/minute per IP\n  - User-specific: 100 requests/minute per user\n- **Password encryption** with BCrypt\n- **Email verification** with OTP\n\n## 🌐 WebSocket Architecture\n\nThe application uses STOMP over WebSocket for real-time communication:\n\n- **Connection:** `/ws` with JWT authentication via handshake interceptor\n- **Message Broker:** Simple in-memory broker on `/client` prefix\n- **Application Prefix:** `/server` for client-to-server messages\n- **Session Management:** Custom session registry tracks user-room mappings\n- **Events:** Automatic user-joined/user-left notifications\n\n## 📦 Rate Limiting\n\nRate limits are enforced using Bucket4j with Caffeine cache:\n\n```java\n- Global: 100 requests/min per IP\n- Login: 5 attempts/min per IP\n- Signup: 2 attempts/min per IP\n- Authenticated: 100 requests/min per user\n```\n\n## 🗄️ Database Schema\n\n### Collections\n\n- **users** - User accounts and profiles\n- **studyrooms** - Study room information and settings\n- **messages** - Chat messages with sender and room references\n- **otps** - Time-limited OTP codes (10 min expiry via TTL index)\n\n## 🔧 Configuration\n\nKey configuration files:\n\n- `application.yaml` - Main application configuration\n- `.env` - Environment variables (not committed)\n- `src/main/resources/META-INF/spring.factories` - Environment post-processor registration\n\n## 🧪 Testing\n\nRun tests with:\n```bash\nmvn test\n```\n\n## 👥 Author\n\n**Vimal Kumar Yadav**\n- Email: vimalyadavkr001@gmail.com\n- GitHub: [@yamiSukehiro2907](https://github.com/yamiSukehiro2907)\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimalyad%2Fstudi.io_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimalyad%2Fstudi.io_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimalyad%2Fstudi.io_backend/lists"}