Overview

9 Searching and auditing

This chapter advances the ACH dashboard through an agile sprint focused on two capabilities users requested most: fast, flexible transaction search and reliable auditing of user interactions. It frames work with user stories and timelines to align stakeholders, then turns requirements into testable behavior and incremental deliverables. Throughout, the emphasis is on building production-minded features—thinking about scale, UX, security, and operability—while keeping developer workflow efficient and test-driven.

For searching, the team starts with BDD scenarios and a known sample file to anchor tests, then designs a single-criteria API that intelligently interprets input as an exact amount, an amount range, or an individual name. The backend uses targeted SQL (including BETWEEN for ranges and case-insensitive name matching) and a typed response model, while the React UI adds a dedicated page with a search box and a results grid that lets users jump straight to the file or batch. The chapter also weighs GET vs POST for sensitive queries, highlights regex-driven parsing, and closes the loop with Playwright integration tests that upload a file, execute a search, and validate UI results—flagging that larger, long-retained ACH datasets may require more scalable search mechanisms before production.

For auditing, it motivates audit log management as a security and operational necessity, then delivers it with a Postgres audit_log table (including INET for IPs), Pydantic models with strong validation, and unit tests. Rather than sprinkling logging calls across endpoints, the solution centralizes capture with FastAPI middleware that records request/response context and an optional decorator to attach human-readable messages. A new UI page lists audit entries in a grid with a details modal, including a small utility to display CIDR addresses cleanly, and an audit router exposes retrieval via API. The result is a cohesive, minimal-boilerplate approach to capturing, viewing, and evolving audit trails—ready to expand with broader observability as needs grow.

Gantt Chart showing timeframes.

Summary

  • Working through another iteration of our Program Increment, each successive iteration helps build out the functionality of our application. We look to address requests/concerns brought up by the end users, new functionality required by the business, and technical debt.
  • Being able to search is a necessity when it comes to our application. Transactions are loaded at various times through different files throughout the day. If a customer has a transaction about when a transaction was loaded, we need to be able to provide an answer quickly.
  • The importance of auditing for both security, compliance, and general analysis. Whether we are working towards protecting our application from intruders or disgruntled employees to gain deeper insight into the application, it starts with proper auditing.
  • We Touched on the importance of not just logging but how having a successful strategy for managing those logs will play a part in our success. There is a famous quote by W. Edwards Deming that “In God we trust. All others must bring data.” This applies to auditing and logging (as well as many other things). We should not trust that the application is working or not being attacked, instead we must have the data and analyze it.
  • We learned the importance of expanding exception handling and enhancing UI/UX based on user feedback to improve overall user satisfaction and system functionality.
  • Significance of enabling transaction search by multiple criteria was highlighted in addressing customer complaints effectively and ensuring better user experiences.
  • Stakeholder requests for audit capabilities emphasized the value of tracking dashboard interactions for understanding user engagement and planning future system improvements.
  • We focused on the importance of Agile sprint planning, including defining clear user stories and acceptance criteria to ensure alignment and successful delivery of sprint goals.
  • Gantt charts proved effective in visualizing project timelines, aiding in stakeholder communication and expectation management.
  • The requirement for robust search capabilities in large datasets underscored the need for an efficient search API, leading us to explore UI changes and real-time search methods.
  • Developing BDD tests taught us the critical role of testing in validating new search functionalities, ensuring they meet specified scenarios and user needs.
  • Implementing a search API involved understanding various approaches for criteria handling, highlighting the importance of flexible and user-friendly search functionalities.
  • The exploration of logging and auditing emphasized the significance of security practices in monitoring API usage and user interactions to ensure safe and accountable system behavior.
  • Designing a database for audit logs reinforced the need to capture detailed request information such as user agent and IP address for comprehensive security and analysis.
  • Using middleware in FastAPI demonstrated how we can streamline logging processes, reducing redundant code and enhancing code maintainability.
  • Integrating an audit log view into the application taught us the value of transparency and monitoring of system activities to support ongoing improvement and accountability.

FAQ

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build Financial Software with Generative AI (From Scratch) ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build Financial Software with Generative AI (From Scratch) ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build Financial Software with Generative AI (From Scratch) ebook for free