How divya-elsa/chapterly works
1. Overall shape
Chapterly is split into two deployable subsystems: a React frontend in frontend/ and a Spring Boot backend in readingtracker/. The main architecture is client → REST API → relational database.
2. User-facing client
The frontend is a single-page React app. It has a small page-based structure under src/pages/ with Landing, Dashboard, AddBook, and EditBook. App.js is the main composition point, and index.js bootstraps the app.
3. Frontend responsibilities
The React app owns the UI for browsing the reading list, creating new books, editing existing books, and deleting books. The dashboard is the central screen where the book collection is viewed and managed.
4. Frontend runtime and delivery
In development it runs with Node/npm, and in production it is packaged behind Nginx. The presence of frontend/Dockerfile and nginx.conf indicates the built static assets are served as a containerized web frontend rather than through the React dev server.
5. Backend service boundary
The backend is a standalone Spring Boot service rooted at com.example.readingtracker. It exposes JSON REST endpoints and runs on port 8081 according to the repository documentation and configuration.
6. Backend layering
The backend is organized into the usual three layers: controller/ for HTTP endpoints, model/ for the Book domain object, and repository/ for data access. BookController is the API entry point, BookRepository is the persistence abstraction, and Book is the entity being managed.
7. Core data flow
A typical request path is: browser action in React → HTTP request to /api/books endpoints → BookController → BookRepository → database. The primary operations are list, create, update, retrieve by id, and delete for books.
8. Persistence and data setup
The repository is designed around a relational database accessed via Spring Data/JPA. dump.sql provides schema/sample data, and application.properties holds the datasource and JPA settings. The README indicates MySQL or PostgreSQL is expected.
9. Containerization and orchestration
Both frontend and backend have their own Dockerfiles, and docker-compose.yml ties them together for local or deployment use. This makes the application a multi-container system with a separate web client, API service, and backing database.
10. Build and test boundaries
The frontend uses npm-based tooling and includes React test scaffolding. The backend uses Maven and has a Spring Boot test class under src/test. The target/ directory shows backend build artifacts, which are generated output and not part of the source architecture.
11. Important architectural dependency
The frontend depends on the backend API URL being configured externally, so the UI is not self-contained. Its behavior is shaped by the backend’s REST contract and the database-backed book lifecycle exposed there.
Main entry points: BookController.java Book API · App.js App shell · docker-compose.yml Compose · ReadingtrackerApplication.java Spring app
Components 16
Frontend
React single-page client and static web delivery
- App shell · Main React application composition and route wiring
frontend/src/App.js - Bootstrap · Client startup and render bootstrap
frontend/src/index.js - Landing · Public entry page
frontend/src/pages/Landing.js - Dashboard · Primary book list and management screen
frontend/src/pages/Dashboard.js - Add book · Create-book form and flow
frontend/src/pages/AddBook.js - Edit book · Edit-book form and flow
frontend/src/pages/EditBook.js
Backend
Spring Boot API and persistence layer
- Book API · HTTP entry point for book CRUD endpoints
readingtracker/src/main/java/com/example/readingtracker/controller/BookController.java - Book · Core book domain object
readingtracker/src/main/java/com/example/readingtracker/model/Book.java - Repository · Persistence abstraction for books
readingtracker/src/main/java/com/example/readingtracker/repository/BookRepository.java - Spring app · Backend service bootstrap
readingtracker/src/main/java/com/example/readingtracker/ReadingtrackerApplication.java - Config · Datasource and JPA settings
readingtracker/src/main/resources/application.properties - Seed data · Schema and sample data initialization
dump.sql
Delivery
Container and compose orchestration
- Frontend image · Builds the static client for Nginx delivery
frontend/Dockerfile - Nginx config · Serves the built frontend assets
frontend/nginx.conf - Backend image · Packages the Spring Boot service
readingtracker/Dockerfile - Compose · Runs frontend, backend, and database together
docker-compose.yml
Connections 18
- Bootstrap → App shell: starts · Bootstraps the React application
- App shell → Landing: routes to · Displays the landing page
- App shell → Dashboard: routes to · Displays the main book dashboard
- App shell → Add book: routes to · Opens add-book flow
- App shell → Edit book: routes to · Opens edit-book flow
- Dashboard → Book API: CRUD calls · Lists and manages books through the API
- Add book → Book API: create · Submits new books to the REST API
- Edit book → Book API: update · Sends book edits to the REST API
- Book API → Repository: uses · Delegates persistence operations
- Book API → Book: maps · Reads and writes book representations
- Repository → Seed data: persists to · Backed by relational schema and seeded data
- Spring app → Book API: hosts · Starts the HTTP API layer
- Spring app → Config: loads · Applies runtime datasource and JPA settings
- Compose → Frontend image: builds · Creates the client container
- Compose → Backend image: builds · Creates the API container
- Compose → Seed data: initializes · Provides database initialization input
- Frontend image → Nginx config: serves with · Static client is delivered by Nginx
- App shell → Book API: depends on · UI behavior relies on the REST contract