Skip to content

tanmayythakare/secondBrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  Life OS โ€” Personal Productivity & Knowledge Management

A full-stack web application to manage your tasks, notes, and ideas โ€” with an interactive knowledge graph to visualize connections between your thoughts.


๐Ÿ“– Description

Life OS is a personal productivity platform designed to help you organize your work, capture ideas, and discover connections between them. Whether you're tracking daily tasks, writing notes, or mapping how your ideas relate to each other, Life OS keeps everything in one place.

The app is built for developers and knowledge workers who want a system that's fast, clean, and actually useful โ€” without the bloat of traditional note-taking tools.

Why does it exist? Most productivity apps treat tasks and notes as isolated silos. Life OS connects them โ€” you can link any note to another, and the knowledge graph shows you the bigger picture of your thinking. It's a second brain you can actually navigate.


โœจ Features

  • ๐Ÿ” User Authentication โ€” Secure registration and login with JWT tokens
  • โœ… Task Management โ€” Create, edit, and delete tasks with inline editing and delete confirmation
  • ๐Ÿ“ Notes System โ€” Write and manage notes with full-text search across title and content
  • ๐Ÿ”— Note Linking โ€” Link notes to each other and explore backlinks
  • ๐Ÿ•ธ๏ธ Knowledge Graph โ€” An interactive force-directed graph to visually explore how your notes connect
  • ๐Ÿ‘ฅ Multi-User Support โ€” Each user's data is fully isolated from others
  • ๐Ÿ” Search โ€” Filter notes instantly by title or content
  • ๐Ÿ“ฑ Responsive Design โ€” Works on desktop and mobile

๐Ÿ› ๏ธ Tech Stack

Backend

Technology Purpose
Java 17 Programming language
Spring Boot 4.0.2 Backend framework
Spring Security Authentication & authorization
Spring Data JPA Database access layer
PostgreSQL Primary database
JWT (jjwt 0.11.5) Secure token-based authentication
SpringDoc OpenAPI 2.3.0 API documentation (Swagger UI)
Lombok Boilerplate reduction
Maven Build tool

Frontend

Technology Purpose
Angular 12 Frontend framework
TypeScript Programming language
Custom CSS Styling (CSS variables, responsive)
force-graph Interactive knowledge graph visualization

๐Ÿ“‹ Prerequisites

Before you begin, make sure you have the following installed on your computer:

  • Java 17+ โ€” Download and install JDK 17 or higher
  • Node.js 16+ โ€” Includes npm (needed for Angular)
  • PostgreSQL 14+ โ€” The database
  • Git โ€” To clone the project
  • A code editor like VS Code (recommended)

๐Ÿš€ Installation & Setup

Step 1 โ€” Clone the Repository

git clone https://github.com/justTanmay/secondbrain.git
cd secondbrain

Step 2 โ€” Set Up the Database

  1. Open your PostgreSQL client (e.g., pgAdmin or the terminal).
  2. Create a new database and user:
CREATE DATABASE secondbrain_db;
CREATE USER secondbrain_user WITH PASSWORD 'secondbrain';
GRANT ALL PRIVILEGES ON DATABASE secondbrain_db TO secondbrain_user;

Spring Boot with ddl-auto=update will automatically create all tables when the backend starts โ€” you don't need to create them manually!


Step 3 โ€” Configure the Backend

  1. Navigate to the backend folder:
cd backend
  1. Open the configuration file:
src/main/resources/application.properties
  1. The default values are already set to match the database you created above:
spring.datasource.url=jdbc:postgresql://localhost:5432/secondbrain_db
spring.datasource.username=secondbrain_user
spring.datasource.password=secondbrain
spring.jpa.hibernate.ddl-auto=update
jwt.secret=secondbrain-secret-key-which-is-very-secure

โš ๏ธ For production, never use these default values. Override them with environment variables and activate the prod profile.


Step 4 โ€” Run the Backend

From inside the backend folder, run:

# On Mac/Linux
./mvnw spring-boot:run

# On Windows
mvnw.cmd spring-boot:run

You should see the server start on http://localhost:8080

Swagger UI (interactive API docs): http://localhost:8080/swagger-ui.html

The first run will take a few minutes as Maven downloads all dependencies.


Step 5 โ€” Run the Frontend

Open a new terminal and navigate to the frontend folder:

cd frontend/secondbrain-frontend

Install dependencies (first time only):

npm install

Start the development server:

npm start

The app will open at http://localhost:4200 ๐ŸŽ‰


๐Ÿ–ฅ๏ธ Usage

  1. Login โ€” Go to http://localhost:4200 and sign in. (Registration is handled directly via the API for now โ€” see the API section below.)

  2. Manage Tasks โ€” Click Tasks in the top nav to create, edit, and delete your tasks.

  3. Write Notes โ€” Click Notes in the top nav to create notes. Use the search bar to find notes by title or content.

  4. Link Notes โ€” On any note card, click Link to connect it to another note using its ID.

  5. Explore the Graph โ€” Click Graph in the top nav to open the knowledge graph. Each node is a note; arrows show connections. Click a node to open that note.


๐Ÿ“ Folder Structure

secondbrain/
โ”‚
โ”œโ”€โ”€ backend/                         # Spring Boot backend
โ”‚   โ”œโ”€โ”€ Dockerfile                   # Multi-stage production Docker build
โ”‚   โ”œโ”€โ”€ pom.xml                      # Maven dependencies
โ”‚   โ””โ”€โ”€ src/main/java/com/example/backend/
โ”‚       โ”œโ”€โ”€ controller/              # REST API endpoints
โ”‚       โ”‚   โ”œโ”€โ”€ AuthController.java
โ”‚       โ”‚   โ”œโ”€โ”€ TaskController.java
โ”‚       โ”‚   โ”œโ”€โ”€ NoteController.java
โ”‚       โ”‚   โ””โ”€โ”€ NoteLinkController.java
โ”‚       โ”œโ”€โ”€ service/                 # Business logic
โ”‚       โ”œโ”€โ”€ repository/              # Database queries (JPA)
โ”‚       โ”œโ”€โ”€ model/                   # Database entity models
โ”‚       โ”œโ”€โ”€ dto/                     # Data transfer objects
โ”‚       โ”œโ”€โ”€ security/                # JWT filter, util, and SecurityConfig
โ”‚       โ”œโ”€โ”€ exception/               # Global error handling
โ”‚       โ””โ”€โ”€ config/                  # OpenAPI / Swagger configuration
โ”‚   โ””โ”€โ”€ src/main/resources/
โ”‚       โ”œโ”€โ”€ application.properties   # Default (local) configuration
โ”‚       โ””โ”€โ”€ application-prod.properties  # Production configuration
โ”‚
โ””โ”€โ”€ frontend/secondbrain-frontend/   # Angular frontend
    โ””โ”€โ”€ src/app/
        โ”œโ”€โ”€ core/                    # Guards and HTTP interceptors
        โ”‚   โ”œโ”€โ”€ guards/              # AuthGuard (route protection)
        โ”‚   โ””โ”€โ”€ interceptors/        # JwtInterceptor (auto-attach token)
        โ”œโ”€โ”€ features/                # Pages and feature modules
        โ”‚   โ”œโ”€โ”€ auth/                # Login component & AuthService
        โ”‚   โ”œโ”€โ”€ tasks/               # Task list component & TaskService
        โ”‚   โ””โ”€โ”€ notes/               # Note list, note graph & NoteService
        โ””โ”€โ”€ environments/            # API URL configuration (local / prod)

๐Ÿ“ธ Screenshots

Screenshots coming soon!

Page Preview
Login Login
Tasks Tasks
Notes Notes
Notes Notes
Knowledge Graph Graph

๐Ÿ”Œ API Overview

The backend exposes a REST API. All endpoints except auth require an Authorization: Bearer <token> header.

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login and receive a JWT token
GET /api/tasks Get all tasks for the current user
POST /api/tasks Create a new task
PUT /api/tasks/{id} Update a task
DELETE /api/tasks/{id} Delete a task
GET /api/notes Get all notes for the current user
POST /api/notes Create a new note
PUT /api/notes/{id} Update a note
DELETE /api/notes/{id} Delete a note
GET /api/notes/search?q={query} Full-text search across notes
POST /api/note-links?sourceId=X&targetId=Y Link two notes
GET /api/note-links/{noteId} Get notes linked from this note
GET /api/note-links/backlinks/{noteId} Get notes that link to this note

Full interactive docs available at: http://localhost:8080/swagger-ui.html


๐Ÿ”ฎ Future Improvements

Here are some features planned for future versions:

  • ๐Ÿ“ Registration page in the UI (currently API-only)
  • ๐ŸŒ™ Dark mode support
  • ๐Ÿท๏ธ Tags and categories for notes and tasks
  • ๐Ÿ“… Task due dates and priority levels in the UI
  • ๐Ÿ” Recurring tasks support
  • ๐Ÿ“ค Export notes as Markdown or PDF
  • ๐Ÿ”” Notifications and reminders
  • ๐Ÿ“Š Analytics dashboard (task completion trends, note activity)

๐Ÿค Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/your-username/secondbrain.git
  3. Create a new branch for your feature:
    git checkout -b feature/your-feature-name
  4. Make your changes and commit them:
    git commit -m "Add: description of your change"
  5. Push to your fork:
    git push origin feature/your-feature-name
  6. Open a Pull Request on GitHub

Guidelines

  • Follow the existing code style
  • Write clear commit messages
  • Test your changes before submitting
  • Keep pull requests focused on one feature or fix

๐Ÿ› Known Issues / Troubleshooting

"Cannot connect to server" on login โ†’ Make sure the backend is running on port 8080 and PostgreSQL is running.

"Access Denied" errors after a while โ†’ Your JWT token has expired (24-hour expiry). Log out and log back in.

Build fails with Java version error โ†’ Make sure you have Java 17 or higher installed. Run java -version to check.

npm install fails โ†’ Try deleting the node_modules folder and running npm install again.

Knowledge graph is empty โ†’ You need to create at least two notes and link them together before the graph will show connections.


๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

You are free to use, modify, and distribute this project for personal or commercial use.


๐Ÿ‘ค Author

Tanmay Thakare


Made with โค๏ธ and โ˜• | If you find this project useful, please โญ star the repository!

About

A full-stack productivity and knowledge management platform built with Spring Boot and Angular. Manage tasks, write notes, link ideas, and explore connections through an interactive knowledge graph.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors