astroash/dickhub

Paths using react router

Closed this issue · 8 comments

It looks like we have three paths:

  • '/' for home/login page
  • '/issues' for the issues board
  • '/issues/new' for writing and submitting a new issue

If someone lands on the home page and is already authenticated it should redirect to the issues page.

@astroash lemme know your thoughts 🆒

It might be worth talking to Zooey about the best way to root an authenticated SPA, as I know power to change were having issues with this.

If we have an SPA, then users will be able to move around all the pages without checking with our client (or authenticating their cookie). I reckon (disclaimer: the following words are unresearched) we could either:

  • have a static webpage for the login, that when you login/authenticate serves up the SPA. This would mean that individual roots are not protected, but it's protected the first time you load (ie. if someone logins then deletes their cookie whilst the page is loaded they won't get kicked out).
  • don't use create-react-app and serverside render individual react pages

Also back to your question on routing, we will also need routes for the individual issues. We could have:

  • / - login page that reroutes to /issues if you have a cookie (which is potentially static)
  • /issues for issues board (which is potentially an spa)
  • /issues/new for adding a new issue (which is part of spa)
  • /issues/102e2a3dea 10 digit hexadecimal number for individual issue numbers (which is part of spa)

NB: This will probs keep us going until mid 2019 as it'll take 1099511627776 issues before we max out and need a new counting system

After consulting with ZoZo the 🧠 lets:

  • Serve static page on home route (login page)
  • Serve SPA post login with auth headers
  • Check auth headers when requesting/posting data to server

Perfect! Also I think we'll hit 1099511627776 issues in no time.

I think you said you were keen to do this part of the app - is this something you want to start on next?

I keep getting distracted with my horror side project. Would you be up for paired programming this? Might be more fun / better learning experience.

We will also need to have a signup endpoint for first time logins.

Update on routes:

  • / login page that reroutes to /issues if you have a cookie (which is potentially static)
  • /signup page for new users to set their avatars and aliases
  • /issues for issues board (which is potentially an spa)
  • /issues/new for adding a new issue (which is part of spa)
  • /issues/102e2a3dea 10 digit hexadecimal number for individual issue numbers (which is part of spa)