Allowing Users to Add Cafes – HadCoffee Blog

Allowing Users to Add Cafes

This was always part of the plan, however there are a few steps required to get this going. As an admin I have already coded most of the functionality, however for non-admin users I need to consider:

  • Suggesting existing cafes they may have missed
  • Being able to merge cafes for when duplicates are created
  • Verifying the user entry to fix mistakes, add additional optional info such as social media profiles for the cafes, or even cleaning up or monitoring spam. Creating a cafe essentially gives some entity a web page on my app, so it could be a target for abuse.
  • Adding more locations to an existing cafe
  • Suggesting that cafes or specific locations have closed down (happens quite a lot, especially with covid).

Right now my Controllers are fragmented with a frontend and admin equivalent. I need to move the ::store method to the public one, use a Form Request to validate and handle the slight differences in behaviour depending on who is adding.

Also need to ensure the geocoding job is queued in either case, and possibly monitor usage as there could be an API cost if it’s abused.

MVP

To get something going soon I think I’ll let users add cafes until there is abuse. I might throttle them to adding N in some number of hours/days.

I’ll review additions manually, and later when I can I’ll build the merge tool.

Still so much work for what seems a simple CRUD feature.