Skip to content

Latest commit

 

History

History
22 lines (20 loc) · 1.98 KB

File metadata and controls

22 lines (20 loc) · 1.98 KB

Codebase layout

This is an explanation of how the files in the codebase are (intended to) be laid out.

  • / contains the typical mess of configuration files and documentation.
  • /public contains static assets for the website
  • /contents contains wiki markdown (contents/markdown/) and wiki media (contents/media/); see WIKI_MEDIA.md
  • /.github contains the yaml files which define our CI/CD pipeline on GitHub Actions
  • /docs contains documentation files (like this one!)
  • /src contains all of the source code! Let's dig into it:
    • /src/api contains client API code for querying the Toronto city council API. Needs a better name.
    • /src/app contains the Next app router, i.e. all the pages of the website.
    • src/backend contains code that is specifically meant to run on a server. so, logic for SSR pages, Route Handlers, or Server Actions
    • src/components contains all of our UI components. we try to keep pages themselves lean, mainly just to connect some data to a component. So you might find e.g. the AgendaItemList component which is basically an entire page of the app defined here.
      • src/components/ui is specifically for components that are just concerned with UI/UX (styling/interaction) and not the underlying data model. e.g., a button. or a navigation bar. components generated by shadcn/ui ends up in this folder (in fact I think that is the source of all of the code in that folder)
    • src/constants: what it says on the tin.
    • src/contexts contains our React contexts.
    • src/database: what it says on the tin.
    • src/hooks contains our custom React hooks.
    • src/logic contains business logic: code that is neither concerned with the client, the server, nor the database! just wranglin' some data models
    • src/migrations contains our database migrations
    • src/scripts contains code that is meant to be run in cron jobs or by developers. Currently this is code to update the database.