Restuta / rcn.io

:bicyclist: Making bike racing in USA "a better place" or "great again"
https://rcn.io
MIT License
44 stars 18 forks source link

Create URL structure for Calendar #66

Closed Me4ta closed 7 years ago

Me4ta commented 8 years ago

We need to think this through, since we want our URL structure to be adequate from the beginning, current requirements are:

Possible options: rcn.io/cal/ncnca/2016 — name-centric, year is secondary rcn.io/cal/2016/ncnca — year centric rcn.io/cals/ncnca/2016 — same as above but "cal" is in plural

Current shema: rcn.io/calendars/{id} (where id starts from cal- but we strip out cal-to make url better looking)

rcn.io/calendars/ncnca-216

Restuta commented 8 years ago

So far we are using:

http://rcn.io/calendars/norcal-mtb

so it's calendars/{:id}/

~~for events it can be: calendars/ncnca-2016/events/evt-afw23~~

for events it's rcn.io/events/evt-1234/ since event can be in multiple calendars and for rendering/app performance it's easier not to nest it under calendars/

Calendar can be referenced by short name or id if short name exists it should be treated as canonical URL and we should redirect, so if NCNCA 2016 calendar has internal id of cal-sdf234 then when we access calendars/cal-sdf234 we must redirect to calendars/ncnca-2016

I decided to take simpler approach, just strip out cal- part from id and let calendars have arbitrary ids that would cover nice ones like ncnca-2016 and any random ones like aff323

Todo: