Skip to content
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

Start adding case routes #125

Merged
merged 1 commit into from
Dec 26, 2023
Merged

Start adding case routes #125

merged 1 commit into from
Dec 26, 2023

Conversation

thadk
Copy link
Member

@thadk thadk commented Dec 25, 2023

This PR it keeps the root.tsx as we had it but adds an <Outlet/> so it shows:

  • the index.tsx from _marketing/index.tsx on the / page (since the _ prefix indicates it’s not a real routing folder),
  • a static page on /cases/,
  • and the case number 123 on /cases/123 , that is literally it just prints 123 or whatever variable is in the route for now.

Because <CaseSummary/> was retained on root.tsx for now, it always displays. I believe @jkoren has a revision that moves that to a subroute which will be done after this one.

See also:

remix-flat-routes File system routing conventions (full doc link)

  • (Note these filenames are examples from the conventions document, not this project)
  • If you're familiar with the Remix routing convention, just think of it this way, remix-flat-routes converts +/ (that is, folder ending in plus sign) to ..
  • "Layout" refers to how the parent layouts should apply.
filename convention behavior
privacy.jsx filename normal route
pages.tos.jsx dot with no layout normal route, "." -> "/"
about.jsx filename with children parent layout route
about.contact.jsx dot child route of layout
about.index.jsx index filename index route of layout
about_.company.jsx trailing underscore url segment, no layout
_auth.jsx leading underscore layout nesting, no url segment
_auth.login.jsx leading underscore child of pathless layout route
users.$userId.jsx leading $ URL param
docs.$.jsx bare $ splat route
dashboard.route.jsx route suffix optional, ignored completely
investors/[index].jsx brackets escapes conventional characters

Routes folder in this early PR version:

➜ tree heat-stack/app/routes
heat-stack/app/routes
├── $.tsx # splat route: if no other routes match, this one will
├── _auth+ #route as /...   ; leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│   ├── auth.$provider.callback.test.ts
│   ├── auth.$provider.callback.ts
│   ├── auth.$provider.ts
│   ├── forgot-password.tsx
│   ├── login.tsx # route as /login
│   ├── logout.tsx
│   ├── onboarding.tsx
│   ├── onboarding_.$provider.tsx
│   ├── reset-password.tsx
│   ├── signup.tsx # route as /signup
│   └── verify.tsx
├── _heat+  #route as /...   ; leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to . 
│   ├── CaseSummary.tsx # route as /casesummary
│   └── index.tsx # show in <Outlet/> for /
├── _marketing+ #route as /...  ; leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│   ├── about.tsx # route as /about components appear in <outlet/> on root.tsx
│   ├── index.tsx # this appears in <outlet/> on root.tsx when at /
│   ├── logos # svg's, no code
│   ├── privacy.tsx
│   ├── support.tsx
│   └── tos.tsx
├── _seo+ #leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│   ├── robots[.]txt.ts
│   └── sitemap[.]xml.ts
├── admin+ #route all like /admin/... because remix-flat-routes converts +/ to .
│   ├── cache.tsx
│   ├── cache_.lru.$cacheKey.ts
│   ├── cache_.sqlite.$cacheKey.ts
│   └── cache_.sqlite.tsx
├── cases+ # routes as /cases/... because remix-flat-routes converts +/ to .
│   ├── $analysisid.tsx # routes as /cases/123
│   ├── case_summaries+ 
│   │   └── $summaryid_+
│   │       └── index.tsx # routes as /cases/case_summaries/123/ (not sure?)
│   └── index.tsx
├── me.tsx # routes like `/me` and code does redirect(`/users/${user.username}`)
├── resources+ #route contents like /resources/...  because remix-flat-routes converts +/ to .
│   ├── download-user-data.tsx
│   ├── healthcheck.tsx
│   ├── note-images.$imageId.tsx
│   └── user-images.$imageId.tsx
├── settings+ #route contents like /settings/... because remix-flat-routes converts +/ to .
│   ├── profile.change-email.tsx # routes like /settings/profile/change-email
│   ├── profile.connections.tsx
│   ├── profile.index.tsx # /settings/profile (we can call this profile's index route—will be surrounded by profile.tsx layout)
│   ├── profile.password.tsx
│   ├── profile.password_.create.tsx
│   ├── profile.photo.tsx
│   ├── profile.tsx # /settings/profile (we can call this a layout—it has <Outlet/>
│   ├── profile.two-factor.disable.tsx # routes like /settings/two-factor/disable
│   ├── profile.two-factor.index.tsx
│   ├── profile.two-factor.tsx
│   └── profile.two-factor.verify.tsx
└── users+ #route contents like /users/
    ├── $username.test.tsx # is a test, not routed?
    ├── $username.tsx 
    ├── $username_+ #routes like /users/kody/...
    │   ├── __note-editor.tsx
    │   ├── notes.$noteId.tsx
    │   ├── notes.$noteId_.edit.tsx # routes like /users/kody/notes/123/edit
    │   ├── notes.index.tsx # routes like /users/kody/notes
    │   ├── notes.new.tsx
    │   └── notes.tsx # routes like /users/kody/notes
    └── index.tsx

➜ tree heat-stack/app/routes
heat-stack/app/routes
├── $.tsx # splat route: if no other routes match, this one will
├── _auth+ #route as /...   ; leading _ means layout nesting, no url segment; converts +/ to .
│   ├── auth.$provider.callback.test.ts
│   ├── auth.$provider.callback.ts
│   ├── auth.$provider.ts
│   ├── forgot-password.tsx
│   ├── login.tsx # route as /login
│   ├── logout.tsx
│   ├── onboarding.tsx
│   ├── onboarding_.$provider.tsx
│   ├── reset-password.tsx
│   ├── signup.tsx # route as /signup
│   └── verify.tsx # route as /verify
├── _heat+  #route as /...   ; leading _ means layout nesting, no url segment; converts +/ to . 
│   ├── CaseSummary.tsx # route as /casesummary
│   └── index.tsx # show in  for /
├── _marketing+ #route as /...  ; leading _ means layout nesting, no url segment; converts +/ to .
│   ├── about.tsx # route as /about components appear in  on root.tsx
│   ├── epicstack.tsx # this appears in  on root.tsx for /signup
│   ├── logos # svg's, no code
│   ├── privacy.tsx
│   ├── support.tsx
│   └── tos.tsx
├── _seo+ #leading _ means layout nesting, no url segment; converts +/ to .
│   ├── robots[.]txt.ts /robots.txt
│   └── sitemap[.]xml.ts /sitemap.xml
├── admin+ #route all like /admin/... because converts +/ to .
│   ├── cache.tsx /admin/cache
│   ├── cache_.lru.$cacheKey.ts
│   ├── cache_.sqlite.$cacheKey.ts
│   └── cache_.sqlite.tsx
├── cases+ # routes as /cases/... because converts +/ to . /cases
│   ├── $analysisid.tsx # routes as /cases/123 /cases/123
│   ├── case_summaries+  
│   │   └── $summaryid_+
│   │       └── index.tsx # routes as /cases/case_summaries/123/ (not sure?) /cases/case_summaries/123
│   └── index.tsx
├── me.tsx # routes like `/me` and code does redirect(`/users/${user.username}`) a href="https://heat-stack.fly.dev/me">/me
├── resources+ #route contents like /resources/...  because remix-flat-routes converts +/ to .
│   ├── download-user-data.tsx /resources/download-user-data
│   ├── healthcheck.tsx /resources/healthcheck
│   ├── note-images.$imageId.tsx
│   └── user-images.$imageId.tsx
├── settings+ #route contents like /settings/... because remix-flat-routes converts +/ to .
│   ├── profile.change-email.tsx # routes like /settings/profile/change-email
│   ├── profile.connections.tsx
│   ├── profile.index.tsx # /settings/profile/ (we can call this profile's index route—will be surrounded by profile.tsx layout)
│   ├── profile.password.tsx
│   ├── profile.password_.create.tsx
│   ├── profile.photo.tsx
│   ├── profile.tsx # /settings/profile/ (we can call this a layout—it has 
│   ├── profile.two-factor.disable.tsx # routes like /settings/two-factor/disable
│   ├── profile.two-factor.index.tsx
│   ├── profile.two-factor.tsx
│   └── profile.two-factor.verify.tsx
└── users+ #route contents like /users/
    ├── $username.test.tsx # is a test, not routed?
    ├── $username.tsx 
    ├── $username_+ #routes like /users/kody/....
    │   ├── __note-editor.tsx
    │   ├── notes.$noteId.tsx
    │   ├── notes.$noteId_.edit.tsx # routes like /users/kody/notes/123/edit
    │   ├── notes.index.tsx # routes like /users/kody/notes (we can call this profile's index route—will be surrounded by profile.tsx layout)
    │   ├── notes.new.tsx
    │   └── notes.tsx # routes like /users/kody/notes (we can call this a layout—it has 
    └── index.tsx

Co-authored-by: plocket <[email protected]>
Co-authored-by: Jeff Korenstein <[email protected]>
Co-authored-by: Tai Phuong <[email protected]>
Co-authored-by: Michael Hughes <[email protected]>
Co-authored-by: Justin Song <[email protected]>
@thadk thadk added the heat-app-js Issues related to the HEAT app frontend label Dec 26, 2023
@jkoren jkoren merged commit 25e70ee into main Dec 26, 2023
12 checks passed
AdamFinkle pushed a commit to AdamFinkle/home-energy-analysis-tool that referenced this pull request May 22, 2024
Co-authored-by: plocket <[email protected]>
Co-authored-by: Jeff Korenstein <[email protected]>
Co-authored-by: Tai Phuong <[email protected]>
Co-authored-by: Michael Hughes <[email protected]>
Co-authored-by: Justin Song <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heat-app-js Issues related to the HEAT app frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants