Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f28fd0e
feat: initial angular scaffold
Semilore317 Apr 20, 2026
0ad285d
chore: removed defunct logs
Semilore317 Apr 20, 2026
6a98bbd
feat: configure tailwind v4 and environment variables
Semilore317 Apr 20, 2026
3494989
feat: implement minimalist neobrutalist UI and core services
Semilore317 Apr 20, 2026
107bca1
feat(core): implement book, member, and loan domain services
Semilore317 Apr 20, 2026
62b71f6
feat(routing): update application routes for domain features
Semilore317 Apr 20, 2026
7ac8d3b
feat(ui): implement book catalog, detail, member management, and loan…
Semilore317 Apr 20, 2026
a6862c7
fix(styling): downgrade to Tailwind CSS v3 to resolve rendering issue…
Semilore317 Apr 20, 2026
f25d19a
feat(integration): finalize auth interceptor and wire up live dashboa…
Semilore317 Apr 20, 2026
41c443d
feat(auth): implement member self-registration backend endpoint and f…
Semilore317 Apr 20, 2026
6ea2680
fix(infra): standardize ports and fix build context for IntelliJ comp…
Semilore317 Apr 20, 2026
3d37c02
fix(auth): fix missing RouterLink in login and sync database sequences
Semilore317 Apr 20, 2026
7152244
style(ui): overhaul dashboard and sidebar for better visual hierarchy…
Semilore317 Apr 20, 2026
c64c224
chore(infra): cleanup old Dockerfile after relocation
Semilore317 Apr 20, 2026
75b9f05
feat: stabilize circulation workflows, resolve db constraints, and ad…
Semilore317 Apr 23, 2026
12f8451
feat: bug fixes, missing features, and book cover scaffold
Semilore317 Apr 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 73 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,110 @@
# Libris

Libris is a Library Management System built with Java and Spring Boot. It provides a RESTful API for managing library operations, including book inventory, user management, and lending processes.
Libris is a full-stack Library Management System built with Spring Boot and Angular. It provides a RESTful API and a modern web interface for managing library operations including book inventory, member management, and lending workflows.

## Program Logic

The application is designed around the following:
The application is designed around the following core domains:

* **Authentication & Authorization**: The system uses **JWT (JSON Web Tokens)** for secure stateless authentication. Access is controlled via Role-Based Access Control (RBAC) with predefined roles such as `LIBRARIAN` and `MEMBER`.
* **Authentication & Authorization**: Stateless JWT-based auth with Role-Based Access Control (RBAC). Two roles: `ROLE_LIBRARIAN` and `ROLE_MEMBER`.
* **User Management**:
* **Users**: Detailed login credentials and role assignment.
* **Members**: Extended profile information linked to Users `(One-to-One)`, allowing library-specific data (like membership status) to be kept separate from authentication data.
* **Users**: Authentication credentials + role assignment.
* **Members**: Extended profile linked to a User `(One-to-One)` — separates auth data from library-specific member data.
* **Inventory System**:
* **Book**: Represents a bibliography entry (Title, Author, ISBN, etc.).
* **BookInstance**: Represents a physical copy of a book. This distinction allows the library to track multiple copies of the same title independently (e.g., for availability or lost status).
* **Book**: A bibliographic entry (Title, Author, ISBN, Genre, Publication Year, Cover Image URL).
* **BookInstance**: A physical copy of a book. Tracks individual copy status (`AVAILABLE`, `ON_LOAN`).
* **Lending Operations**:
* **Loan**: Connects a `Member` to a `BookInstance`. It tracks the issue date, due date, and return date.
* **Reservations**: Allows a `Member` to reserve a `Book` when all instances are currently borrowed.
* **Loan**: Links a `Member` to a `BookInstance`. Tracks borrow date, due date, return date, and derived status (`ACTIVE`, `OVERDUE`, `RETURNED`).
* **Reservation**: Allows a `Member` to place a hold on a `Book` when all copies are on loan.

## Prerequisites
---

Before running the application, ensure you have the following installed:
## Tech Stack

* **Java 21 JDK**
* **PostgreSQL** (running locally or accessible via network)
| Layer | Technology | Purpose |
|---|---|---|
| **Backend** | Spring Boot 3.x (Java 21) | REST API, business logic, security |
| **Backend** | Spring Security + JJWT | Stateless JWT auth, RBAC |
| **Backend** | Spring Data JPA + Hibernate | ORM, repository layer |
| **Backend** | PostgreSQL 16 | Primary relational database |
| **Backend** | Lombok | Reduces Java boilerplate |
| **Frontend** | Angular 19 (standalone) | SPA with signals-based reactivity |
| **Frontend** | TailwindCSS | Utility-first styling |
| **Frontend** | RxJS | Reactive HTTP client streams |
| **Infra** | Docker + Docker Compose | Containerised local development |
| **Storage** | Supabase Storage *(planned)* | Book cover image hosting |

## Setup & Running
---

### 1. Database Configuration
## Getting Started

The application is configured to connect to a PostgreSQL database. By default, it expects the following configuration (as defined in `src/main/resources/application.properties`):
### With Docker (Recommended)

* **Host**: `localhost`
* **Port**: `5432`
* **Database**: `libris_db`
* **Username**: `libris_dev`
* **Password**: `shhhh`
> **Prerequisites:** Docker + Docker Compose

You must create this database and user before starting the application:
```bash
git clone https://github.com/youruser/libris.git
cd libris/infra
docker compose up --build
```

| Service | URL |
|---|---|
| API | http://localhost:8080/api/v1 |
| Client | http://localhost:4200 |

---

### Manual Setup

> **Prerequisites:** Java 21, Node 20+, PostgreSQL 16

**1. Database**

```sql
CREATE DATABASE libris_db;
CREATE USER libris_dev WITH PASSWORD 'shhhh';
GRANT ALL PRIVILEGES ON DATABASE libris_db TO libris_dev;
```

### 2. Running the Application

Use the included Maven Wrapper to run the application directly from the command line:
**2. Backend**

```bash
# Ensure the wrapper is executable
cd server
chmod +x mvnw

# Run the application
./mvnw spring-boot:run
```

The application will start on port `8080`.

### 3. Application Access
API available at `http://localhost:8080/api/v1`

Once running, the API is accessible at:
**3. Frontend**

```
http://localhost:8080/api/v1
```bash
cd client
npm install
npm run dev # or: ng serve
```

## API Documentation
Client available at `http://localhost:4200`

---

### Default Accounts

Postman documentation is available to help you test and explore the API.
All accounts use password: **`password`**

| Role | Username | Notes |
|---|---|---|
| Librarian | `sarah.connor` | Full admin access |
| Librarian | `gandalf.grey` | Full admin access |
| Member | `frodo.baggins` | MEM-001 |
| Member | `hermione.granger` | MEM-002 |
| Member | `tony.stark` | MEM-003 |

---

## API Documentation

* **[Postman Collection](./postman_collection.json)**: You can import this JSON file into Postman to see all available endpoints and example requests.
A Postman collection is included for exploring all endpoints.

* **[Postman Collection](./postman_collection.json)** — import into Postman to test all available endpoints with example requests.
17 changes: 17 additions & 0 deletions client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single
ij_typescript_use_double_quotes = false

[*.md]
max_line_length = off
trim_trailing_whitespace = false
44 changes: 44 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/mcp.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
__screenshots__/

# System files
.DS_Store
Thumbs.db
12 changes: 12 additions & 0 deletions client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 100,
"singleQuote": true,
"overrides": [
{
"files": "*.html",
"options": {
"parser": "angular"
}
}
]
}
59 changes: 59 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Client

This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.7.

## Development server

To start a local development server, run:

```bash
ng serve
```

Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.

## Code scaffolding

Angular CLI includes powerful code scaffolding tools. To generate a new component, run:

```bash
ng generate component component-name
```

For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:

```bash
ng generate --help
```

## Building

To build the project run:

```bash
ng build
```

This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.

## Running unit tests

To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command:

```bash
ng test
```

## Running end-to-end tests

For end-to-end (e2e) testing, run:

```bash
ng e2e
```

Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.

## Additional Resources

For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
77 changes: 77 additions & 0 deletions client/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "npm"
},
"newProjectRoot": "projects",
"projects": {
"client": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"browser": "src/main.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": ["src/styles.css"]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "4kB",
"maximumError": "8kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "client:build:production"
},
"development": {
"buildTarget": "client:build:development"
}
},
"defaultConfiguration": "development"
},
"test": {
"builder": "@angular/build:unit-test"
}
}
}
}
}
Loading