u/samirson

How to handle dynamic navigation with Expo Router? (Role-based menus)
▲ 2 r/expo

How to handle dynamic navigation with Expo Router? (Role-based menus)

Hi everyone, I need some help!!

I’m currently migrating my application from another framework to Expo, and I’m using Expo Router.

The app is fairly simple: after the user logs in, I retrieve a list of modules/screens assigned to that user. Then, I navigate to a main screen called MainMenu, which is shared by all users. On this screen, I display a list organized by module. Each module appears as a collapsible/expandable option, and when the user selects it, the corresponding screens assigned to that module are shown. Selecting one of those options should navigate to the respective screen.

My backend already returns this structure: a list of modules and screens. Each module has its own key and name, and each screen includes its title, icon, and route. This approach worked well for me in the past.

However, I’m not sure how to implement this kind of dynamic navigation with Expo Router.

If anyone has recommendations, useful articles, or perhaps an open-source project where a similar approach has been implemented, I would really appreciate it.

also, if you have a similar project please advice me with your folder structure, currently i'm trying to follow this: How to organize Expo app folder structure for clarity and scalability

u/samirson — 2 days ago

How to handle dynamic navigation with Expo Router? (Role-based menus)

Hi everyone, I need some help.

I’m currently migrating my application from another framework to Expo, and I’m using Expo Router.

The app is fairly simple: after the user logs in, I retrieve a list of modules/screens assigned to that user. Then, I navigate to a main screen called MainMenu, which is shared by all users. On this screen, I display a list organized by module. Each module appears as a collapsible/expandable option, and when the user selects it, the corresponding screens assigned to that module are shown. Selecting one of those options should navigate to the respective screen.

My backend already returns this structure: a list of modules and screens. Each module has its own key and name, and each screen includes its title, icon, and route. This approach worked well for me in the past.

However, I’m not sure how to implement this kind of dynamic navigation with Expo Router.

If anyone has recommendations, useful articles, or perhaps an open-source project where a similar approach has been implemented, I would really appreciate it.

Also, if you can share a folder structure for this type of modular project, thanks!!!!

reddit.com
u/samirson — 2 days ago

Frontend polling + heavy SQL joins = deadlocks. Looking for architecture advice

Hi everyone,

I’d like some advice on a scalability/database architecture issue.

At work, we built a truck management system. Trucks enter the factory, load products, and deliver them to different distribution centers.

The problem is that management now wants near real-time dashboards showing the full lifecycle of operations. Most of our dashboard queries rely on joins against large historical tables, and some queries take 10–15 seconds to complete.

Right now, the frontend polls the API on a timer to refresh dashboards. This is starting to cause issues:

  • Heavy read queries sometimes block write operations
  • Backend update processes occasionally deadlock with dashboard queries
  • Overall DB performance is degrading as data grows

My current idea is to create separate denormalized/reporting tables specifically for dashboards, populated every few minutes by background jobs, so dashboards stop querying historical transactional data directly.

Would this be the right approach?
How would you handle this architecture-wise?

reddit.com
u/samirson — 4 days ago
▲ 9 r/SQL

Frontend polling + heavy SQL joins = deadlocks. Looking for architecture advice

Hi everyone,

I’d like some advice on a scalability/database architecture issue.

At work, we built a truck management system. Trucks enter the factory, load products, and deliver them to different distribution centers.

The problem is that management now wants near real-time dashboards showing the full lifecycle of operations. Most of our dashboard queries rely on joins against large historical tables, and some queries take 10–15 seconds to complete.

Right now, the frontend polls the API on a timer to refresh dashboards. This is starting to cause issues:

  • Heavy read queries sometimes block write operations
  • Backend update processes occasionally deadlock with dashboard queries
  • Overall DB performance is degrading as data grows

My current idea is to create separate denormalized/reporting tables specifically for dashboards, populated every few minutes by background jobs, so dashboards stop querying historical transactional data directly.

Would this be the right approach?
How would you handle this architecture-wise?

We're using SQL SERVER.

reddit.com
u/samirson — 4 days ago

Shared header for all screens, how to? RN + EXPO and EXPO ROUTER

Hey, i just decided to learn RN + EXPO, and i'm replicating the app i made in another framework to expo , so i'm learning the navigation with expo router.

my app is pretty simple, is an enterprise app with 20 modules each module has its own screens, services, components and i load the module from my backend in a role based schema.

my folder structure is like this

src/

├── app/

│ ├── (app)/

│ │ ├── (Module1)/

│ │ │ ├── screen1Module1.tsx

│ │ │ └── screen2Module1.tsx

│ │ ├── (Module2)/

│ │ │ ├── screen1Module2.tsx

│ │ │ └── screen2Module2.tsx

│ │ ├── _layout.tsx

│ │ └── mainMenu.tsx

│ ├── (auth)

│ └── _layout.tsx

│ └── index.tsx

so, i'd like to know how you guys handle something like this, it is kinda confusing that screen are routes, and only screens have to be inside the app folder and so on, anyways.

my mainMenu.tsx is a shared screen that every role go after login, here i have an accordion list that go to each screen after tap.

so in my mainMenu my header is a custom header that i put in a drawer.

mainMenu.tsx

after navigating to any module/screen

module/screen

so i'd like to have the same header in all screens. the only thing that would change is the header.

i have the following code in my src/app/(app)/_layout.tsx

export default function AppLayout() {


  return (
    <Drawer screenOptions={{ headerShown: true }}
      drawerContent={(props: DrawerContentComponentProps) => <CustomDrawerContent {...props}/>}
    >      
      <Drawer.Screen name='mainMenu' options={{ header : () => <AppHeader title="Menu principal"/> }} />           
    </Drawer>
  )
}

thanks in advance, any resource or github project that you can share would be great

AI is confusing me in this matter.

reddit.com
u/samirson — 10 days ago

i programmed a script to brute force passwords but this is not optimal, do you guys know any way that works with any lenght passwords?

the script that i programmed only works with <5 lenght passwords >5 passwords takes wayy too much time.

reddit.com
u/samirson — 18 days ago