Advanced Polymer routing

112 Views Asked by At

I'm trying to build a Polymer web-app. I've followed the examples, read the documentation, and understand the starter-kits. The problem is I have no idea how to go beyond the examples. In particular - app-routing. I have a basic app structure in mind and was looking for a little help to get started. I want to have my main website, and also an admin panel - which you can access via a login page.

Admin Portal - admin is hardcoded.

/admin/:collection
/admin/:collection/:document

/admin/users
/admin/users/userA

and that's about it for the admin page. Maybe an admin-dashboard page too.

If you can't tell, i'm using Firebase Firestore as the backend, so everything is collection/document based (think mongodb)

/:collection
/:collection/:document

/bars
/events
/bars/barA
/events/eventA

static pages

/coming-soon
/about
/terms-and-services
/admin

so, put an observer on page. if admin - do what? otherwise - load single page?

Do i handle all of the page navigation in the my-app? Do I have to setup an app-route to handle every situation?

<app-route
    route="{{route}}"
    pattern="/:page"
    data="{{routeData}}"
    tail="{{subroute}}">
</app-route>
<app-route
    route="{{subroute}}"
    pattern="/:subpage"
    data="{{subrouteData}}">
</app-route>

What's the best practice for handling large production, dynamic websites? Thanks

0

There are 0 best solutions below