Skip to content

How do you structure your routes folder with new RR7 routes file #12632

Answered by sergiodxa
samadadi asked this question in Q&A
Discussion options

You must be logged in to vote

I either keep using the file route convention from Remix v2 or I like to organize route files like this:

First app/resources for all resource routes (routes without UI) like API routes, webhooks, or other things. that are inside app/resources directly or inside other folders as needed.

app/resources          # Resource Routes
app/resources/api/     # API Routes
app/resources/webhooks # Webhook Routes

Then app/views for all routes with a UI where I organize it like

app/views                      # UI Routes
app/views/layouts              # Layout Routes
app/views/[resource]/index.tsx # The list routes of a resource
app/views/[resource]/show.tsx  # The detail route
app/views/[resource]/new…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by samadadi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants