Understanding HAI Website Codebase & Website Repo Structure
Rushali explains how she built a mental map of the Humanitarians AI website codebase in her first week, tracing routes, components, API handlers, and support folders before editing any live code.
Rushali spent her first week on the Humanitarians AI website project not shipping a feature, but reading the codebase closely enough to know where changes belong before touching anything. She walks through the mental map she built of the repository's layers, and the exercise she recommends to any new contributor.
Building a mental map before making changes
Most of the first week went into reading the repo: tracing how pages and components connect, understanding the branch-based workflow, and forming a clear picture of the codebase's layers. The goal was not speed, it was safety. Knowing where an edit belongs before making it prevents a lot of the confusion and breakage that comes from guessing.
The four layers of the repository
At a high level, the repository breaks into a handful of layers. The app folder defines routes and pages. components holds reusable interface pieces that pages assemble together. app/api and lib handle server-side logic and shared data code. Folders like public and assets support what the site actually serves to visitors, static files and media. Thinking about the project in these layers made it much easier to navigate without getting lost in individual files.
Where a new contributor should start: the app folder
For onboarding a new contributor, the recommended starting point is the app folder. In Next.js, many folders inside app map directly to URL routes, and a page.tsx file inside a folder is what creates the actual page at that route. From there, layout.tsx files define shared wrappers around those pages, and components holds the reusable pieces that the pages assemble.
How API routes differ from page routes
The API side of the codebase works differently from page routes. Files under app/api are server handlers, code that returns data or performs actions rather than rendering a page, and they often pull shared logic from lib. Recognizing this distinction, page routes render UI while API routes handle server logic, matters for knowing which folder to open depending on what kind of change is needed.
Support folders worth tracking
Beyond the core app and API layers, a few support folders matter whenever a task touches static files, automation, or database work: public and assets for static content, and scripts and SQL for automation and database-related tasks. Keeping track of where these live means not having to rediscover them each time a task calls for them.
The tracing exercise for new contributors
The recommended way to internalize this structure is hands-on: pick one real page on the site, and trace it from its URL into the app folder, then to its layout.tsx, then to the components it assembles, and finally to any API calls behind it. Running through that single exercise surfaces where most future changes will actually belong, faster than reading documentation alone.
Key takeaways
- The Humanitarians AI website repo breaks into four practical layers:
appfor routes and pages,componentsfor reusable UI,app/apiandlibfor server logic, andpublic/assetsfor static content. page.tsxfiles create the actual page at a route;layout.tsxfiles define the shared wrapper around those pages.- API routes under
app/apiare server handlers that return data or perform actions, distinct from the page routes that render UI. - Support folders like
scriptsandSQLmatter for automation and database-related tasks. - Tracing one real page from its URL through layout, components, and API calls is a fast way to learn where changes belong in an unfamiliar codebase.
Who this is for
New contributors joining the Humanitarians AI website project, or any developer onboarding onto an unfamiliar Next.js app-router codebase, will find this a practical starting map before making their first edit.
Chapters
- 0:00Introduction and building a codebase mental map
- 0:15High-level layers: App, Components, APIs, and Assets
- 0:30Navigating routes, pages, and layouts in next.js
- 0:45Reusable interface pieces in the components directory
- 1:00Server-side handlers and database support folders (scripts, SQL)
- 1:15Actionable exercise: Tracing a page from URL to component
Full transcript(auto-generated, with timestamps)
Introduction and building a codebase mental map
[0:00]Hi, I am Rashali. And the video is about how the Humanitarian's AI website repository is structured. In week one, my main progress was understanding the code base well enough to make future changes safely. Most of my first week was not about shipping a big feature. It
High-level layers: App, Components, APIs, and Assets
[0:17]Was about reading the repo, tracing how pages and components connect, understanding branch-based workflow, and building a mental map so I would know where edits belong before changing anything. At a high level, I now think
Navigating routes, pages, and layouts in next.js
[0:30]About the repository in layers. The app folder defines routes and pages, components holds reusable interface pieces, app/api and lib handle server-side logic and shared data code, and folders like public and assets support what the site
Reusable interface pieces in the components directory
[0:46]Serves. That structure made the project much easier to navigate. If I were onboarding a new contributor, I would start with app. In Next.js, many folders inside app map directly to URLs, and page.tsx creates the page.
Server-side handlers and database support folders (scripts, SQL)
[1:03]Then I would look at layout.tsx for shared wrappers and components for the reusable pieces that those pages assemble. The API side works differently from page routes. Files under app/api
Actionable exercise: Tracing a page from URL to component
[1:16]Are server handlers that return data or perform actions, often with shared logic coming from lib. I also kept track of support folders like public, assets, scripts, and SQL because they matter whenever the task involves static files, automation, or database-related work. The main takeaway from this week is that understanding the repo first is real progress. The strength was building a reliable mental model before editing live code. The next step is to use that map to make targeted changes, debug issues faster, and help future contributors ramp up more quickly. Your turn. If you are new to this repository, start by tracing one real page from its URL to app, then to layout, then to the components and any API calls behind it. That one exercise will quickly show you where most future changes belong. Follow Humanitarians AI for more project progress videos and research explainers.
More from AI+1
3:34Git Branch Workflow & Core Website Fixes | Humanitarians AI
2:45Diagnose Before You Design: Website Restructure Week 1 Audit by Muskan Agrawal
1:20Claude, Deal Tracker.
1:17Claude, Earnings Analysis — What One Skill File Actually Does
1:14Claude, Earnings Preview — What a Preview Skill Actually Previews
2:10