Skip to content

About

Server-rendered Django coursework project with custom HTML/CSS, searchable catalogue, role-aware administration, and a bounded borrowing lifecycle.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SilentLibrary — Django Library Catalogue

SilentLibrary is a foundational server-rendered Django coursework project for searchable book discovery, member accounts, staff catalogue administration, and a bounded borrowing and return workflow. The original application was independently developed without AI assistance and later refined for safe portfolio publication.

Coursework and authorship context

Derek Wong independently designed and implemented the original coursework application without AI assistance. Later portfolio preparation used AI tools for selected hardening, testing, documentation, and UI refinement under Derek Wong's direction and review.

Portfolio status

Classification: Foundational coursework project. The repository demonstrates learning progression and core Django, semantic HTML and custom CSS skills; it is not presented as a production library service.

Problem and intended users

The project provides a small library catalogue where members can discover fictional books and follow one clear loan lifecycle. Staff maintain catalogue records and inspect borrowing activity.

Main workflow

  1. A visitor registers or logs in.
  2. A member searches the catalogue and opens a book detail page.
  3. An available book can be borrowed through a protected POST action.
  4. The member views active and returned loans and can return their own active item.
  5. Staff manage catalogue records and inspect all borrowing records.

Main features

  • Authentication, registration, password reset templates and editable profiles
  • Search by title, author or genre
  • Responsive catalogue cards and detailed fictional book records
  • An editorial homepage and visual hierarchy built with semantic Django templates and custom responsive CSS
  • One-active-loan-per-book workflow with transactional availability checks
  • Member loan history and return actions
  • Staff dashboard, catalogue CRUD and read-only loan management
  • Safe registration outcome when a welcome email cannot be sent
  • Controlled deterministic demonstration dataset and original SVG covers

Technology stack

  • Python 3.11
  • Django 4.2 LTS and Django Templates
  • Django ORM with MySQL as the documented main database
  • Semantic HTML and custom responsive CSS
  • Pillow for validated optional image uploads
  • Console email backend by default; SMTP is optional and unverified

Architecture

SilentLibrary server-rendered Django architecture

SilentLibrary remains a server-rendered monolith: URLs and views render Django templates, enforce authentication and staff permissions, and persist UserProfile, Book and BorrowRecord data through the ORM.

Role and permission boundaries

  • Public visitor: home, registration, login and password-reset entry points.
  • Authenticated member: catalogue, details, borrowing, own returns, loan history and profile.
  • Staff administrator: member access plus dashboard, catalogue creation/edit/delete, loan overview and Django Admin.
  • Borrow and return operations use POST. Returns are restricted to the owning borrower; staff pages require is_staff.

Borrowing lifecycle

One Book record represents one lendable demonstration item. A transaction locks that record before creating a loan, so an existing active BorrowRecord blocks every duplicate or competing borrow. A successful return marks the record returned and makes the book available again. Reservations, fines, waitlists, branches, due dates and physical-copy inventory are intentionally absent.

Controlled demo data

seed_demo_data creates 12 fictional books across multiple genres, 3 synthetic accounts, 2 active loans and 1 returned loan. It is deterministic, idempotent, makes no network or email request, and refuses any database whose name does not contain silentlibrary_portfolio_demo.

No SQL dump is published. Django migrations plus seed_demo_data create the controlled demonstration state; original, private or generated SQL exports must remain excluded.

python manage.py seed_demo_data --dry-run
python manage.py seed_demo_data

The command removes non-manifest records only inside the explicitly named controlled demonstration database. Never point it at personal or production-like data.

Local setup

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
Copy-Item .env.example .env
python manage.py migrate
python manage.py runserver

Create the MySQL database and least-privilege local account yourself, then update only the ignored .env. Rotate all values that existed in the pre-publication coursework configuration; they must be treated as compromised.

For a disposable local demonstration, set SILENTLIBRARY_USE_SQLITE=True and keep the default filename containing silentlibrary_portfolio_demo. This isolated convenience path does not change the documented MySQL architecture.

Environment variables

.env.example documents Django secret/debug/host settings, MySQL connection fields, an optional isolated SQLite switch, email configuration, logging level and media root. The safe default email backend writes to the console. No real SMTP delivery was verified.

Route overview

Route Purpose Access
/ Project home Public
/register/, /login/ Account access Public
/catalogue/ Searchable catalogue Member
/catalogue/<id>/ Book details and truthful status Member
/catalogue/<id>/borrow/ Borrow action Member, POST
/loans/ Own active/returned loans Member
/loans/<id>/return/ Own return action Owner, POST
/staff/ Staff dashboard Staff
/staff/books/... Catalogue management Staff
/staff/loans/ Loan overview Staff

Testing and verification

The focused Django suite covers registration and mocked email behavior, authentication boundaries, search/detail states, staff permissions and CRUD, borrowing/return ownership, history, uploads, and the seed safety guard. Tests use Django's temporary database; verification records the actual database engine used rather than claiming MySQL when an isolated SQLite engine is selected.

python -m pip check
python manage.py check
python manage.py makemigrations --check --dry-run
python manage.py test

Security and privacy boundaries

  • Secrets and environment-specific values are excluded from source.
  • The development email default cannot contact SMTP.
  • Uploads allow JPG, PNG or WebP images up to 2 MB.
  • Demonstration accounts, contact values, books and loan activity are synthetic.
  • Personal profile photos and rights-uncertain commercial covers were removed.
  • Media serving under Django is development-only when DEBUG=True.

Implemented and intentionally absent scope

Implemented: member accounts, catalogue search/detail, staff catalogue administration, one-item borrowing/return, history and safe demo data.

Intentionally absent: a REST API or SPA, multiple copies, reservations, fines, branches, payments, recommendations, AI features, background jobs and production deployment configuration.

Known limitations

  • The catalogue models one lendable item per book record rather than physical copies.
  • Return timestamps and due dates are not modelled; returned state is intentionally concise.
  • Profile and cover uploads use bounded validation but no malware scanning or cloud storage.
  • Password-reset templates are included, but real email delivery is not verified.
  • The project has no public deployment and should be run only in a controlled local environment.

Original development and later enhancement disclosure

The original SilentLibrary coursework application was independently designed and implemented by Derek Wong without AI assistance. Later publication preparation used a human-directed, AI-supported enhancement process for configuration safety, controlled data, tests, documentation and UI refinement. Derek Wong directed the changes, reviewed the outputs and verified the final results.

Screenshots

Editorial homepage for a server-rendered Django catalogue

SilentLibrary editorial homepage

Searchable fictional catalogue with availability states

SilentLibrary catalogue search results

Book detail with truthful borrowing action

SilentLibrary book detail and borrowing state

Staff dashboard for catalogue and loan oversight

SilentLibrary staff dashboard

Licence

Code is available under the MIT Licence. Project-owned assets are described in ASSET_PROVENANCE.md.

Contact

Portfolio and GitHub profile: github.com/derekwongha

About

Server-rendered Django coursework project with custom HTML/CSS, searchable catalogue, role-aware administration, and a bounded borrowing lifecycle.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages