-
Notifications
You must be signed in to change notification settings - Fork 0
docs(architecture): add default web application stack guidance #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jdhoffa
wants to merge
2
commits into
main
Choose a base branch
from
docs/default-web-stack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Default Web Application Stack | ||
|
|
||
| This guidance applies to web applications built at RMI, that is: anything that serves a browser-based UI backed by a server-side API and database. | ||
|
|
||
| ## The Default Stack | ||
|
|
||
| New web applications **should** use: | ||
|
|
||
| - **Frontend:** [React](https://react.dev/) | ||
| - **Backend / API:** [FastAPI](https://fastapi.tiangolo.com/) (Python) | ||
| - **Database:** [PostgreSQL](https://www.postgresql.org/) | ||
|
|
||
| This is a default, not a mandate. But the default exists for a reason: shared tooling, transferable knowledge across teams, easier code review, and lower onboarding cost enable better engineer fungibility across repositories. | ||
|
|
||
| ## When to Deviate | ||
|
|
||
| Deviating from the default is allowed when there is a **strong, specific reason**, not a preference. | ||
|
|
||
| Examples of reasons that would justify a different choice: | ||
|
|
||
| - A hard technical constraint the default stack cannot meet (e.g., a data science workflow that fundamentally requires a different runtime, real-time requirements the default cannot satisfy, integration with a system that mandates a particular client library). | ||
| - An existing codebase or product being extended, where switching stacks would be more costly than living with the mismatch. | ||
| - A third-party or vendor requirement that dictates a particular framework or database. | ||
|
|
||
| Reasons that are **not** strong enough on their own: | ||
|
|
||
| - Personal familiarity or preference for a different framework. | ||
| - A newer framework being more exciting or trendy. | ||
| - Marginal performance differences at expected scale. | ||
|
|
||
| If you deviate, document the reason in the repository's `ARCHITECTURE.md` or equivalent so future maintainers understand the context. | ||
|
|
||
| ## Suggested Adjacent Choices | ||
|
|
||
| Everything below are helpful suggestions for adjacent tooling. **"If you have no idea where to start, start here"**. These are reasonable defaults that will not surprise anyone who has worked in another RMI web application. Deviate freely when you have a reason. | ||
|
|
||
| - **Python packaging & dependencies:** [`uv`](https://docs.astral.sh/uv/) — fast, lockfile-based, workspace support for monorepos. | ||
| - **Python lint & format:** [`ruff`](https://docs.astral.sh/ruff/). | ||
| - **Python test runner:** [`pytest`](https://docs.pytest.org/). | ||
| - **Database migrations:** [Alembic](https://alembic.sqlalchemy.org/). | ||
| - **Frontend build tool:** [Vite](https://vite.dev/). | ||
| - **Frontend test runner:** [Vitest](https://vitest.dev/). | ||
| - **Local development environment:** Docker Compose: one command brings up the database, API, and frontend together. | ||
|
|
||
| ## Reference Implementation | ||
|
|
||
| [RMI/stitch](https://github.com/RMI/stitch) is a working example of this stack and the adjacent suggestions above. When starting a new web application, it is often faster to skim stitch's `README.md`, `ARCHITECTURE.md`, and root configuration files than to assemble the pieces from scratch. | ||
| [RMI/pbtar](https://github.com/RMI/pbtar) is a static web application that *has no server-side API or DB*. It does however follow the stack in the sense that the front-end is written in [React](https://react.dev/). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting that this assumes python, rather than other languages that the project might want to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a feature, not a bug :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be targeting this stack (and Python) as a default for SPD. For both internal and contracted work.
A great counter-example of this is the PACTA web application built by Silicon Ally, which is written in Go (a language that precisely 0 of our engineers knows): https://github.com/RMI-PACTA/app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or any of the demos I wrote in Ruby. Definitely did not help me sell those ideas :-)