4

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

Nelson.b.austin
  • 3,080
  • 6
  • 37
  • 63
  • This is actually very good question. Surprisingly nobody from google gave it a try. I had a lot of troubles with app-route , app-location and queryParameters. @Nelson.b.austin did you find any best practices for routing in polymer app? – ZuzEL May 17 '20 at 19:09
  • 1
    I switched to Vue.js instead of Polymer and have had a much better time! – Nelson.b.austin May 17 '20 at 19:11

0 Answers0