{"id":21700008,"url":"https://github.com/anandpiyush1521/reactspring","last_synced_at":"2026-02-21T11:31:03.665Z","repository":{"id":244197284,"uuid":"812031080","full_name":"anandpiyush1521/ReactSpring","owner":"anandpiyush1521","description":"VicharStream - VicharStream is a dynamic blog management application that allows users to publish and manage blog content with ease. ","archived":false,"fork":false,"pushed_at":"2024-12-05T07:30:04.000Z","size":6148,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T21:49:32.599Z","etag":null,"topics":["java","jpa-hibernate","postgresql","reactjs","spring-boot","spring-security","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anandpiyush1521.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-06-07T20:06:35.000Z","updated_at":"2024-12-05T07:30:07.000Z","dependencies_parsed_at":"2024-07-29T15:44:30.165Z","dependency_job_id":"dda748d3-e1d8-4d13-a52c-21337225e316","html_url":"https://github.com/anandpiyush1521/ReactSpring","commit_stats":null,"previous_names":["anandpiyush1521/reactspring"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anandpiyush1521/ReactSpring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anandpiyush1521%2FReactSpring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anandpiyush1521%2FReactSpring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anandpiyush1521%2FReactSpring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anandpiyush1521%2FReactSpring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anandpiyush1521","download_url":"https://codeload.github.com/anandpiyush1521/ReactSpring/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anandpiyush1521%2FReactSpring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T11:29:27.227Z","status":"ssl_error","status_checked_at":"2026-02-21T11:29:20.292Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["java","jpa-hibernate","postgresql","reactjs","spring-boot","spring-security","tailwindcss"],"created_at":"2024-11-25T20:12:27.300Z","updated_at":"2026-02-21T11:31:03.629Z","avatar_url":"https://github.com/anandpiyush1521.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VicharStream\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Powered_by-Spring_Boot-green?style=for-the-badge\u0026logo=spring-boot\" alt=\"Powered by Spring Boot\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Powered_by-React-blue?style=for-the-badge\u0026logo=react\" alt=\"Powered by React\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Powered_by-Tailwind_CSS-06B6D4?style=for-the-badge\u0026logo=tailwind-css\" alt=\"Powered by Tailwind CSS\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Powered_by-PostgreSQL-316192?style=for-the-badge\u0026logo=postgresql\" alt=\"Powered by PostgreSQL\"\u003e\n\u003c/p\u003e\n\n## Overview\n\nVicharStream is a web application that provides user registration, OTP verification, and other functionalities. It is built using Spring Boot for the backend and React for the frontend, with Tailwind CSS for styling.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/demo/home.png\" width=\"1000\" alt=\"Home Image\" style=\"border: 2px solid beige;\"\u003e\n\u003c/p\u003e\n\n\n## Features\n\n- User Registration and Login\n- OTP Verification for Password Recovery\n- Protected Routes for Authenticated Users\n- User Management\n- Email Notifications\n\n\n## Backend\n\nThe backend is built using Spring Boot and provides RESTful APIs for user management, OTP verification, and email notifications.\n\n### 3-Layer Security System\n\nThis project implements a **3-layer security system** to ensure secure and validated user registration and authentication. It leverages temporary data storage, OTP verification, and secure data handling mechanisms for robust protection.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/demo/ThreeLayerRegistration.png\" width=\"1000\" alt=\"ThreeLayer Image\"\u003e\n\u003c/p\u003e\n\n---\n\n### Layer 1: Temporary Data Storage and Validation\n\n#### Temporary User Storage\n- User data is temporarily stored in a `ConcurrentHashMap` as `TempUser`.\n- Prevents database pollution by keeping unverified users out of the main database.\n\n#### Basic Validations\n- Checks for duplicate emails and usernames.\n- Ensures all fields are valid and non-empty.\n\n---\n\n### Layer 2: OTP Verification\n\n#### One-Time Password (OTP)\n- A **randomly generated OTP** is sent to the user's email.\n- The OTP is **valid for 2 minutes**.\n- Ensures the provided email belongs to the user.\n\n#### Temporary Session Management\n- Unverified user data is stored temporarily in a `ConcurrentHashMap`.\n- No interaction with the database occurs until OTP verification succeeds.\n\n---\n\n### Layer 3: Secure Data Handling and Authentication\n\n#### Password Security\n- Passwords are hashed using **bcrypt** before storage.\n- Protects against password leaks, even in case of database compromise.\n\n#### Email Verification Status\n- The `isEmailVerified` flag ensures only verified users can access their accounts.\n- Guards sensitive operations against unverified accounts.\n\n#### Database Storage\n- Upon successful OTP verification:\n  - Validated user data is securely saved in the database.\n  - Hashed passwords and necessary flags are stored.\n\n---\n\n### Features\n\n1. **Temporary Storage for Validation**:  \n   Users are temporarily stored in memory until verification, saving database resources.\n   \n2. **OTP-Based Verification**:  \n   A two-minute, time-sensitive OTP ensures identity validation.\n\n3. **Secure Password Management**:  \n   Passwords are hashed using bcrypt for maximum security.\n\n4. **Verified Access Only**:  \n   Prevents unverified users from accessing system resources.\n\n---\n\n### How It Works\n\n1. **User Registration**:  \n   - User provides email, username, and password.\n   - Data is stored temporarily in `ConcurrentHashMap`.\n\n2. **Send OTP**:  \n   - An OTP is sent to the user’s email.\n   - The user enters the OTP to verify their email.\n\n3. **Verification**:  \n   - If the OTP is correct and within the time limit, the user is moved to the main database.\n   - Passwords are hashed before storage.\n\n4. **Post-Verification**:  \n   - Verified users can log in and access the application.\n\n---\n\n### Potential Enhancements\n\n- **Add CAPTCHA**: Prevent automated registrations.\n- **Multi-Factor Authentication (MFA)**: Add an additional security layer during login.\n- **Rate Limiting**: Prevent brute-force OTP attempts.\n- **Email Verification Links**: Provide an alternative to OTP verification.\n\n\n\nThis 3-layer security system ensures a robust, reliable, and scalable user authentication workflow.\n\n---\n\n\n### Key Files and Directories\n\n- [`server/src/main/java/com/application/server/controller/ForgotPasswordController.java`](server/src/main/java/com/application/server/controller/ForgotPasswordController.java): Handles password recovery requests.\n- [`server/src/main/java/com/application/server/controller/UserController.java`](server/src/main/java/com/application/server/controller/UserController.java): Manages user registration, verification, and login.\n- [`server/src/main/java/com/application/server/service/Impl/UserServiceImpl.java`](server/src/main/java/com/application/server/service/Impl/UserServiceImpl.java): Implements user-related services.\n- [`server/src/main/java/com/application/server/service/Impl/EmailService.java`](server/src/main/java/com/application/server/service/Impl/EmailService.java): Sends email notifications.\n- [`server/src/test/java/com/application/server/service/EmailServiceTest.java`](server/src/test/java/com/application/server/service/EmailServiceTest.java): Unit tests for the email service.\n\n### User Registration and OTP Verification\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/demo/authentication-system.png\" width=\"700\" alt=\"system\"\u003e\n\u003c/p\u003e\n\n\n## Frontend\n\nThe frontend is built using React and styled with Tailwind CSS. It provides a user-friendly interface for registration, login, and other functionalities.\n\n### Key Files and Directories\n\n- [`client/src/App.js`](client/src/App.js): Main application component that sets up routing.\n- [`client/src/components/ForgotPassword.js`](client/src/components/ForgotPassword.js): Component for password recovery.\n- [`client/src/components/Footer.js`](client/src/components/Footer.js): Footer component.\n- [`client/src/pages/Home.js`](client/src/pages/Home.js): Home page component.\n- [`client/src/index.css`](client/src/index.css): Tailwind CSS configuration.\n\n## Getting Started\n\n### Blog Add Page\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/demo/AddBlog.jpeg\" width=\"600\" alt=\"BlogAdd\"\u003e\n\u003c/p\u003e\n\n\n### Prerequisites\n\n- Node.js\n- npm\n- Java\n- Maven\n\n### Installation\n\n1. Clone the repository:\n\n```sh\ngit clone https://github.com/your-repo/vicharstream.git\ncd vicharstream\n```\n\n2. Install frontend dependencies:\n\n```sh\ncd client\nnpm install\n```\n\n3. Install backend dependencies:\n\n```sh\ncd ../server\n./mvnw install\n```\n\n### Running the Application\n\n1. Start the backend server:\n\n```sh\ncd server\n./mvnw spring-boot:run\n```\n\n2. Start the frontend development server:\n\n```sh\ncd client\nnpm start\n```\n\n### Running Tests\n\n#### Backend Tests\nTo run backend tests, use the following command:\n```sh\ncd server\n./mvnw clean package\n```\n\n#### Frontend Tests\nTo build the frontend for production, use the following command:\n```sh\ncd client\nnpm run build\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanandpiyush1521%2Freactspring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanandpiyush1521%2Freactspring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanandpiyush1521%2Freactspring/lists"}