Initial commit

This commit is contained in:
Zzzz
2026-04-27 18:40:30 +08:00
commit 2120774b05
112 changed files with 12308 additions and 0 deletions
@@ -0,0 +1,13 @@
{"file": ".trellis/spec/backend/index.md", "reason": "Check implementation against backend architecture and expected core modules."}
{"file": ".trellis/spec/backend/directory-structure.md", "reason": "Verify backend file placement and layering."}
{"file": ".trellis/spec/backend/database-guidelines.md", "reason": "Verify schema/DAO choices for login and roles."}
{"file": ".trellis/spec/backend/error-handling.md", "reason": "Verify validation, authentication failure, and unauthorized access handling."}
{"file": ".trellis/spec/backend/logging-guidelines.md", "reason": "Verify logging/error tracing expectations where authentication code warrants it."}
{"file": ".trellis/spec/backend/quality-guidelines.md", "reason": "Verify backend quality and layer boundary constraints."}
{"file": ".trellis/spec/frontend/index.md", "reason": "Check JSP/CSS frontend stack alignment."}
{"file": ".trellis/spec/frontend/directory-structure.md", "reason": "Verify JSP/static asset placement."}
{"file": ".trellis/spec/frontend/component-guidelines.md", "reason": "Verify JSP form and fragment conventions."}
{"file": ".trellis/spec/frontend/hook-guidelines.md", "reason": "Ensure SPA/hook conventions were not introduced."}
{"file": ".trellis/spec/frontend/state-management.md", "reason": "Verify request/session/form-state handling."}
{"file": ".trellis/spec/frontend/type-safety.md", "reason": "Verify display contracts and validation boundaries."}
{"file": ".trellis/spec/frontend/quality-guidelines.md", "reason": "Verify frontend quality expectations."}
@@ -0,0 +1,13 @@
{"file": ".trellis/spec/backend/index.md", "reason": "Backend architecture overview and pre-development checklist for the JSP + Servlet + MySQL system."}
{"file": ".trellis/spec/backend/directory-structure.md", "reason": "Backend source layout conventions for Servlet, service, DAO, entity, and config files."}
{"file": ".trellis/spec/backend/database-guidelines.md", "reason": "MySQL schema, DAO CRUD, keys, and transaction guidance for login and role persistence."}
{"file": ".trellis/spec/backend/error-handling.md", "reason": "Validation, authentication failure, service failure, and safe Servlet response handling."}
{"file": ".trellis/spec/backend/logging-guidelines.md", "reason": "Guidance for operation logs and exception tracing in authentication-related code."}
{"file": ".trellis/spec/backend/quality-guidelines.md", "reason": "Layer boundary and backend quality constraints for implementation."}
{"file": ".trellis/spec/frontend/index.md", "reason": "Frontend overview for JSP/CSS presentation served by Servlet/Tomcat."}
{"file": ".trellis/spec/frontend/directory-structure.md", "reason": "JSP, include, static CSS/JS/image placement conventions."}
{"file": ".trellis/spec/frontend/component-guidelines.md", "reason": "JSP fragment, form, table, and reusable UI conventions for login views."}
{"file": ".trellis/spec/frontend/hook-guidelines.md", "reason": "Constraint that React/Vue hooks and SPA conventions should not be introduced."}
{"file": ".trellis/spec/frontend/state-management.md", "reason": "Server-rendered request/session/form state conventions for login flow."}
{"file": ".trellis/spec/frontend/type-safety.md", "reason": "JSP/Servlet validation and JavaBean display contract guidance."}
{"file": ".trellis/spec/frontend/quality-guidelines.md", "reason": "JSP/CSS quality and UI verification guidance."}
+70
View File
@@ -0,0 +1,70 @@
# brainstorm: start coding
## Goal
Build the initial Java Web project scaffold and a login/permission skeleton for this JSP + Servlet + MySQL library-management system.
## What I already know
* The user asked to start writing code.
* There is no active task before this one.
* The repository currently has Trellis project guidance but no application source code files.
* Existing project specs describe a B/S Java web application using JSP, Servlet, MySQL, Tomcat, and IDEA.
* Backend guidance expects a layered structure: JSP/CSS presentation -> Servlet controller -> Service/business -> DAO -> MySQL.
* Frontend guidance expects JSP/CSS pages, JSP includes or fragments, static assets, and small page scripts when needed.
* The user selected option A: build the Java Web foundation and login/permission skeleton first.
## Assumptions (temporary)
* The desired work is to start building the library-management system rather than editing an existing application.
* Maven is a reasonable default for Java web project scaffolding unless the user prefers plain IDEA/Tomcat project files.
* The first implementation should establish a compilable structure and a minimal login flow rather than complete every business module.
## Open Questions
* None currently blocking.
## Requirements (evolving)
* Follow the existing Trellis backend and frontend specs.
* Keep backend and frontend conventions aligned with JSP + Servlet + MySQL, not SPA frameworks.
* Create or update tests/checks where practical for the selected implementation scope.
* Create the base Java Web project structure for Tomcat deployment.
* Add a login/permission skeleton covering administrator, librarian, and reader roles.
* Add model/entity, DAO, service, servlet/controller, JSP, and static asset structure needed for the login slice.
* Include database initialization or schema notes for user/role data needed by the skeleton.
* Keep business logic layered: Servlet parameter/session handling, Service authentication and role checks, DAO persistence access.
* Include safe error handling for invalid credentials, missing parameters, and unauthorized access.
## Acceptance Criteria (evolving)
* [x] The selected first module or feature is explicitly confirmed.
* [ ] The implementation follows the documented JSP + Servlet + MySQL layered architecture.
* [ ] A fresh checkout has recognizable Java Web/Tomcat project structure and build configuration.
* [ ] Login page submits credentials to a Servlet controller and displays validation/authentication failures safely.
* [ ] Authentication logic is represented through service and DAO boundaries rather than embedded in JSP.
* [ ] Session state stores the authenticated user and role in a controlled way.
* [ ] Basic role/permission constants or helpers exist for administrator, librarian, and reader.
* [ ] SQL/schema guidance exists for the minimal account/role tables needed by login.
* [ ] Lint, type-check, compile, or equivalent project validation is run where available.
## Definition of Done (team quality bar)
* Tests added/updated where appropriate.
* Lint / typecheck / compile / CI-equivalent checks are green where available.
* Docs/notes updated if behavior changes.
* Rollout/rollback considered if risky.
## Out of Scope (explicit)
* Choosing React, Vue, TypeScript, SPA routing, or frontend hook/state-library conventions unless the user explicitly changes the stack.
* Implementing full book, reader, borrowing, statistics, backup, or logging modules beyond placeholders needed for navigation or role skeleton.
* Implementing production-grade password reset, remember-me, MFA, or external identity provider integration.
## Technical Notes
* Relevant spec indexes: `.trellis/spec/backend/index.md`, `.trellis/spec/frontend/index.md`.
* Backend pre-development checklist includes directory structure, database, error handling, logging, and quality guidelines.
* Frontend pre-development checklist includes directory structure, JSP component guidelines, state management, type safety, and quality guidelines.
* Codebase retrieval on 2026-04-27 found no application source code and surfaced the project specs as the main implementation context.
* Spec indexes reference `.trellis/tasks/00-bootstrap-guidelines/research/project-requirements.md`, but that file is absent in the current workspace, so context curation uses only present spec files.
@@ -0,0 +1,26 @@
{
"id": "start-coding",
"name": "start-coding",
"title": "brainstorm: start coding",
"description": "",
"status": "in_progress",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "Zzzz",
"assignee": "Zzzz",
"createdAt": "2026-04-27",
"completedAt": null,
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [],
"notes": "",
"meta": {}
}