Skip to content

Trishanthsai/notesphere

Repository files navigation

<<<<<<< HEAD

NoteSphere - Collaborative Knowledge Platform

NoteSphere is a real-time collaborative workspace for teams, featuring rich-text editing, commenting, notifications, file attachments, version histories, productivity analytics dashboards, and Groq-powered AI operations.


Technical Architecture

Backend: Spring Boot 3

  • Framework: Spring Boot 3.2.4 (Java 17)
  • Security: Spring Security 6 with stateless JWT authentication filters, password hashing with BCrypt.
  • Real-time Engine: Spring WebSocket message broker with STOMP protocol.
  • AI Integrator: REST Client calling Groq API using the llama3-8b-8192 model.
  • Database Layer: Spring Data JPA / Hibernate mapped to PostgreSQL. Includes H2 profiles for local in-memory standalone testing.
  • File Management: Local file storage controller supporting documents, PDFs, and images.

Frontend: React.js (Vite)

  • CSS Framework: Tailwind CSS (Notion-style minimal design, soft grey backgrounds, borders, and premium custom stats charts).
  • Rich Editor: TipTap Rich Text Editor (custom toolbars, markdown syntax parsing, dynamic placeholder).
  • WebSocket connection: StompJS client layered over SockJS-client fallback.
  • State Management: AuthContext (token persistence) and SocketContext (notification routing, cursor typing indicators).

Project Structure

notesphere/
├── docker-compose.yml       # PostgreSQL database definition
├── README.md                # System documentation
├── run.bat                  # Instant double-click launcher
├── package-project.bat      # Bundle project into notesphere.zip
├── backend/                 # Spring Boot Maven application
│   ├── pom.xml
│   └── src/main/java/com/notesphere/
│       ├── NoteSphereApplication.java
│       ├── config/          # JWT, Security, WebSockets, Startup Seed Initializer
│       ├── controller/      # Auth, Workspace, Note, Comment, File, AI, Notifications, Admin
│       ├── service/         # Services containing business logic & Groq calls
│       ├── model/           # JPA entities (User, Note, Workspace, etc.)
│       ├── dto/             # Response & Request payloads
│       └── exception/       # GlobalExceptionHandler
└── frontend/                # React Vite web application
    ├── package.json
    ├── tailwind.config.js
    ├── index.html
    └── src/
        ├── main.jsx
        ├── index.css
        ├── context/         # AuthContext, SocketContext
        ├── components/      # Icon files, navigation elements
        ├── pages/           # Login, Signup, Workspace, Note Editor, AI, Stats, SuperAdmin
        └── services/        # api.js client

Configuration & Startup Instructions

1. Database Configuration

NoteSphere supports two database modes:

  1. PostgreSQL (Default): Requires PostgreSQL running. We provide a docker-compose.yml to spin it up automatically.
  2. H2 In-Memory (Fallback): Zero-config option that runs in-memory. Great for testing immediately.

2. Groq AI Integration

Get a free API key from console.groq.com. To add your key, either:

  • Set the environment variable GROQ_API_KEY on your system.
  • Or replace the placeholder in backend/src/main/resources/application.properties directly: groq.api.key=gsk_your_key_here

Running the Application

Option A: The Instant Launcher (Windows)

Double-click the run.bat script in the project root folder. It will:

  1. Spin up the PostgreSQL Docker container (if Docker is running).
  2. Install npm dependencies and launch the React Vite dev server on http://localhost:5173.
  3. Compile and start the Spring Boot backend on http://localhost:8080.

Option B: Manual Startup

Step 1: Start Database (PostgreSQL)

If using PostgreSQL, start it via Docker:

docker-compose up -d

Step 2: Start Backend

Navigate to the backend/ directory:

  • For PostgreSQL:
    mvnw spring-boot:run
  • For Fallback H2 (Standalone Mode):
    mvnw spring-boot:run -Dspring.profiles.active=dev-h2
    (H2 database console is available at http://localhost:8080/h2-console with JDBC URL jdbc:h2:mem:notespheredb, user sa, password password).

Step 3: Start Frontend

Navigate to the frontend/ directory:

npm install
npm run dev

Open your browser at http://localhost:5173.


Seed Accounts (Auto-generated on Startup)

When the application first boots, it populates the database with demo accounts for testing:

  • Super Admin account:
    • Email: admin@notesphere.com
    • Password: admin123
  • Workspace Owner account:
    • Email: owner@notesphere.com
    • Password: password123
  • Workspace Member account:
    • Email: member@notesphere.com
    • Password: password123
  • Workspace Viewer account:
    • Email: viewer@notesphere.com
    • Password: password123 =======

NoteSphere

A real-time collaborative notes platform that enables teams to create, organize, and manage notes within shared workspaces. NoteSphere combines collaboration, workspace management, AI-powered assistance, and analytics into a single platform.

Problem Statement

Teams often use multiple applications for note-taking, communication, task tracking, and knowledge sharing. This leads to scattered information, reduced productivity, and difficulty managing team knowledge.

NoteSphere provides a centralized workspace where users can collaborate on notes, discuss ideas, track activities, and leverage AI-powered features to improve productivity.

Features

Authentication & Authorization

  • User Registration and Login
  • JWT Authentication
  • Password Encryption using Spring Security
  • Role-Based Access Control (RBAC)

Workspace Management

  • Create and Join Workspaces
  • Invite Team Members
  • Role Assignment
  • Workspace Administration

Collaborative Notes

  • Real-Time Collaborative Editing
  • Rich Text and Markdown Support
  • Comments and Discussions
  • File Attachments

AI-Powered Features

  • AI Note Summarization
  • Automatic Task Extraction
  • Smart Semantic Search
  • Keyword Highlighting
  • AI Workspace Assistant

Analytics & Version History

  • User Contribution Tracking
  • Workspace Activity Insights
  • Edit History Tracking
  • Version Recovery

AI Workspace Assistant

Users can interact with workspace content using natural language.

Example Queries:

  • What tasks are pending?
  • Summarize today's discussions.
  • What decisions were made last week?
  • Who contributed the most?
  • What was discussed about authentication?

The assistant analyzes notes, comments, and discussions to provide intelligent responses.

Technology Stack

Layer Technology
Frontend React.js, Tailwind CSS, Axios
Backend Spring Boot
Security Spring Security, JWT
Database PostgreSQL
ORM Spring Data JPA, Hibernate
Real-Time Communication WebSocket
AI Integration OpenAI API
Version Control Git & GitHub

System Workflow

User Login / Register
        ↓
Create or Join Workspace
        ↓
Assign Workspace Roles
        ↓
Create Shared Notes
        ↓
Real-Time Collaboration
        ↓
Comments & Discussions
        ↓
AI Processing
(Summary, Search, Task Extraction)
        ↓
Version History
        ↓
Analytics Dashboard

Key Differentiators

  • AI Workspace Assistant
  • Automatic Task Extraction
  • Advanced Role-Based Access Control
  • Real-Time Collaborative Editing
  • Workspace Analytics Dashboard
  • Centralized Knowledge Management

License

This project is licensed under the MIT License.

bdab44973ede1d1ae3bb6f39d4523620e2463fa9

About

AI-powered real-time collaborative notes platform with workspace management, RBAC, smart search, task extraction, and analytics.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors