Skip to content

Instantly share code, notes, and snippets.

@cadecairos
Last active November 5, 2015 16:45
Show Gist options
  • Save cadecairos/58e3509395342f8e2dfe to your computer and use it in GitHub Desktop.
Save cadecairos/58e3509395342f8e2dfe to your computer and use it in GitHub Desktop.
Several options for tag based endpoints.

We can roll the new featured tag[s] into /discover

Pros: No extra HTTP requests on the client

Cons: Kind weird, especially with pagination. Larger payload sizes.

GET /disover

{
  "projects": [{ /* Projects with the featured flag set to true */ }, ...],
  "featuredTags": {
    "mozfest2015": [{ /* projects tagged mozfest2015 */ }, ...],
    "makerparty2016": [{ /* projects tagged mozfest2015 */ }, ...]
  }
}

New featured tag route

Pros: only one extra request, dedicated featured tag route

Cons: pagination is still strange, one extra request

GET /discover/tagged

{
  "mozfest2015": [{ /* projects tagged mozfest2015 */ }, ...],
  "makerparty2016": [{ /* projects tagged mozfest2015 */ }, ...]
}

route to get featured tags, route to get projects with a tag

Pros: A way to expose featured tags without fetching projects too. easier pagination

Cons: Much more HTTP Requests

GET /discover/tags

{
  tags: ["mozfest2015", "makerparty2016"]
}

GET /projects/tagged/mozfest2015

{
  projects: [{ /* projects tagged mozfest2015 */ }, ...]
}
@xmatthewx
Copy link

core functionality:

  • add description with tags
  • tag as link
  • list of projects with tag

screenshot 2015-11-04 10 01 04

# something we might try: - an "advertisement" that encourages people to browse a theme and maybe contribute a project - not a core feature - might be a good idea. might be a bad idea we change or dump

screenshot 2015-11-04 10 07 01

@xmatthewx
Copy link

Question: should client or service wrap tags with link html?

@gvn
Copy link

gvn commented Nov 5, 2015

Client. Both sides will need to share a common regex... 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment