As a Rust web service grows, organize database access, handlers, and models into folders instead of letting each area remain a single file. This shortens individual files and makes code quicker to find, at the cost of added structural complexity. section 6.1
One layout for the evolving service keeps application concerns distinct:
- `src/bin/iter5.rs` contains `main()`; `src/iter5/routes.rs` holds routes, and `state.rs` and `errors.rs` hold application state and error handling. section 6.1
- Group course and tutor database access under `dbaccess`, and organize handlers and models into their own folders. section 6.1
- Keep supporting artifacts in view too: database scripts live under `src/iter5/dbscripts`, while `.env` holds database credentials and should not be checked into the repository. section 6.1
Compare the earlier project layout with the reorganized structure. section 6.1






