Skip to content

IRK-23/algeo2-67

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Digital Library Application Design

This repository contains the complete code bundle for the Digital Library Application Design project.

Original Figma design:
👉 https://www.figma.com/design/IA3py2BHJiDELwxbwc8S29/Digital-Library-Application-Design


🚀 Running the Application

1. Install frontend dependencies

From the project root:

npm i

2. Launch

From the project root, you can launch both the backend (Spring Boot) and the frontend (Vite) simultaneously using:

npm start

This command will run:

  • mvn spring-boot:run (backend)
  • npm run dev (frontend)

via the concurrently tool.

This allows the entire application to start with a single command.


⚙️ How the Backend Works

Dataset Loading

The dataset is loaded from:

data/mapper.json
data/txt/
data/covers/

Process:

  1. DatasetLoader.init() reads the dataset from: data/mapper.json (resolved dynamically using ProjectPaths)

  2. The JSON is parsed into:

    Map<String, Book> books
  3. Each Book contains:

    id, title, cover, contentPath
    
  4. Raw files (covers & txt content) are served via:

    /api/files/{type}/{filename}
    

    Examples:

    • /api/files/covers/123.jpg
    • /api/files/txt/62.txt
  5. Services such as LSAService and PCAService will use dataset paths using ProjectPaths, ensuring compatibility across operating systems. to perform:

    • Text preprocessing
    • TF–IDF
    • SVD (LSA)
    • PCA (cover embeddings)

📂 API Endpoints

Accessible at:

http://localhost:8080/api/...

📘 List book previews

GET /api/books?page=1&size=20

Handled by: listBooks() (BookController)


📖 Get book by ID

GET /api/books/{id}

Example:

GET /api/books/45634

Handled by: getBook() (BookController)


🔎 Search books by title

GET /api/books/search?title=alice&page=1&size=5

Handled by: searchBooks()(BookController)


🖼️ Search books by cover image (future implementation)

POST /api/books/search/cover

Pipeline (planned):

  • Convert uploaded cover → grayscale / feature vector
  • PCA dimensionality reduction
  • Similarity search

Related classes:

  • searchCover() (BookController)
  • search() (PCAService)

🤝 Content-based Recommendation (future implementation)

GET /api/books/{id}/recommendations

Pipeline (planned):

  • Load book's content using contentPath
  • Preprocess text
  • TF–IDF
  • Apply SVD
  • Compute cosine similarity

Related classes:

  • recommend() (BookController)
  • recommend() (LSAService)

🖼️ Show cover image

GET /api/files/covers/{filename}

Example:

GET /api/files/covers/38427.jpg

Handled by: getFile() (FileController)


📄 Show raw text content

GET /api/files/txt/{filename}

Example:

GET /api/files/txt/62.txt

Handled by: getFile() (FileController)

Used for:

  • Debugging dataset
  • LSA preprocessing
  • Checking text integrity

About

algeo25-algeo2-tb2-template created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors