Skip to content
tejamp3Public

About

will edit later

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“– ReadIt

A full-stack community platform for students and developers to share interview experiences, career advice, and study notes.


๐Ÿš€ Tech Stack

Backend

  • Java 21
  • Spring Boot 3
  • Spring Security + JWT Authentication
  • JPA / Hibernate
  • MySQL

Frontend

  • React 18 (Create React App)
  • React Router v6
  • Axios
  • CSS Modules

โœจ Features

  • ๐Ÿ” User registration and login with JWT
  • ๐Ÿ“ Create, view, and delete career posts
  • ๐Ÿ“š Upload and download study notes (PDF, DOC, PPT, etc.)
  • ๐Ÿ‘ Upvote and downvote posts and notes
  • ๐Ÿ’ฌ Comments with threaded replies on posts and notes
  • ๐Ÿ—‚๏ธ Filter posts by category (Interview Experience, Career Advice, General)
  • ๐Ÿ” Search notes by title or subject
  • ๐Ÿ“„ Paginated feed and notes list

๐Ÿ“ Project Structure

readit/
โ”œโ”€โ”€ readit-backend/          # Spring Boot backend
โ”‚   โ””โ”€โ”€ src/main/java/com/readit/
โ”‚       โ”œโ”€โ”€ config/          # SecurityConfig
โ”‚       โ”œโ”€โ”€ controller/      # REST controllers
โ”‚       โ”œโ”€โ”€ dto/
โ”‚       โ”‚   โ”œโ”€โ”€ request/     # Request DTOs
โ”‚       โ”‚   โ””โ”€โ”€ response/    # Response DTOs
โ”‚       โ”œโ”€โ”€ entity/          # JPA entities
โ”‚       โ”œโ”€โ”€ exception/       # Global exception handling
โ”‚       โ”œโ”€โ”€ repository/      # Spring Data JPA repositories
โ”‚       โ”œโ”€โ”€ security/        # JWT filter, JwtUtil, UserDetailsService
โ”‚       โ””โ”€โ”€ service/         # Business logic
โ”‚
โ””โ”€โ”€ readit-frontend/
    โ””โ”€โ”€ frontend/            # React app
        โ””โ”€โ”€ src/
            โ”œโ”€โ”€ api/         # Axios instance
            โ”œโ”€โ”€ context/     # AuthContext (global auth state)
            โ”œโ”€โ”€ components/  # Reusable components
            โ”‚   โ”œโ”€โ”€ Navbar/
            โ”‚   โ”œโ”€โ”€ PostCard/
            โ”‚   โ”œโ”€โ”€ NoteCard/
            โ”‚   โ”œโ”€โ”€ VoteButtons/
            โ”‚   โ””โ”€โ”€ CommentSection/
            โ””โ”€โ”€ pages/       # Page components
                โ”œโ”€โ”€ Home/
                โ”œโ”€โ”€ Login/
                โ”œโ”€โ”€ Register/
                โ”œโ”€โ”€ CreatePost/
                โ”œโ”€โ”€ PostDetail/
                โ”œโ”€โ”€ Notes/
                โ”œโ”€โ”€ UploadNote/
                โ””โ”€โ”€ NoteDetail/

โš™๏ธ Backend Setup

Prerequisites

  • Java 21
  • Maven
  • MySQL

1. Create the database

CREATE DATABASE readit_db;

2. Configure application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/readit_db
spring.datasource.username=your_mysql_username
spring.datasource.password=your_mysql_password

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

app.jwt.secret=your_super_secret_key_minimum_32_characters
app.jwt.expiration=86400000

spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

3. Run the backend

cd readit-backend
./mvnw spring-boot:run

Backend starts at: http://localhost:8080


๐Ÿ–ฅ๏ธ Frontend Setup

Prerequisites

  • Node.js 18+
  • npm

1. Install dependencies

cd readit-frontend/frontend
npm install

2. Start the development server

npm start

Frontend starts at: http://localhost:3000

โš ๏ธ Make sure the backend is running before starting the frontend.


๐Ÿ”Œ API Endpoints

Auth โ€” /api/auth (public)

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login and get JWT token

Posts โ€” /api/posts (๐Ÿ”’ JWT required)

Method Endpoint Description
GET /api/posts Get paginated feed
GET /api/posts/{id} Get single post
GET /api/posts/category/{category} Filter by category
POST /api/posts Create a post
PUT /api/posts/{id} Update a post (owner only)
DELETE /api/posts/{id} Delete a post (owner only)
POST /api/posts/{id}/vote Upvote or downvote

Notes โ€” /api/notes (๐Ÿ”’ JWT required)

Method Endpoint Description
GET /api/notes Get paginated notes list
GET /api/notes/{id} Get single note
POST /api/notes Upload a note (multipart/form-data)
DELETE /api/notes/{id} Delete a note (owner only)
POST /api/notes/{id}/vote Upvote or downvote

Comments โ€” (๐Ÿ”’ JWT required)

Method Endpoint Description
GET /api/posts/{id}/comments Get comments for a post
POST /api/posts/{id}/comments Add comment to a post
GET /api/notes/{id}/comments Get comments for a note
POST /api/notes/{id}/comments Add comment to a note
DELETE /api/comments/{id} Delete a comment (owner only)

Post Categories

INTERVIEW_EXPERIENCE
CAREER_ADVICE
GENERAL

Vote Types

UPVOTE
DOWNVOTE

๐Ÿ” Authentication

All protected endpoints require a Bearer token in the request header:

Authorization: Bearer <your_jwt_token>

The token is returned on login and register, stored in localStorage, and automatically attached to every request via the Axios interceptor.


๐Ÿ“ฌ Postman Quick Test

1. Register

POST http://localhost:8080/api/auth/register
{
  "username": "testuser",
  "email": "test@example.com",
  "password": "123456"
}

2. Login

POST http://localhost:8080/api/auth/login
{
  "email": "test@example.com",
  "password": "123456"
}

3. Create Post

POST http://localhost:8080/api/posts
Authorization: Bearer <token>
{
  "title": "My Google Interview Experience",
  "content": "Here is how it went...",
  "category": "INTERVIEW_EXPERIENCE"
}

4. Upload Note (form-data)

POST http://localhost:8080/api/notes
Authorization: Bearer <token>
title      โ†’ My DSA Notes
subject    โ†’ Data Structures
descriptionโ†’ Complete revision notes
file       โ†’ [select file]

๐Ÿ—„๏ธ Database Schema Overview

Table Description
users Stores user accounts
posts Career posts and interview experiences
notes Uploaded study notes with file info
comments Threaded comments on posts and notes
votes Upvotes/downvotes on posts and notes

๐Ÿ›ฃ๏ธ Frontend Routes

Route Page Auth Required
/login Login page โŒ
/register Register page โŒ
/ Home feed โœ…
/posts/create Create post โœ…
/posts/:id Post detail + comments โœ…
/notes Notes list โœ…
/notes/upload Upload note โœ…
/notes/:id Note detail + comments โœ…

๐Ÿ”ฎ Future Plans

  • Excalidraw collaborative whiteboard integration
  • User profile pages
  • Edit posts and notes
  • Bookmark posts and notes
  • Email verification
  • File preview (PDF viewer in browser)
  • Dark mode

๐Ÿ‘จโ€๐Ÿ’ป Author

Built with โค๏ธ using Spring Boot + React.

About

will edit later

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages