Outline: RESTful API to manage the infrastructure of the application. Create users/goals/points via API and build mobile applications on top of it. I'm not too familiar with developing apps in this way, but it does not seem overly complicated. Pleae correct anything obviously wrong with this plan, still a noob
- get /users, returns all users
- get /users/:id, returns user
- patch /users/:id, updates user (which should include users points)
- post /users, create user
- patch /users/:id, update user
- destroy /users/:id, destroy user (and associated points)
- post /sessions, create a new user session (log in)
- delete /sessions/:id, destroy a user session (log out)
- id
- has many points (awarded for completing various actions we define)
- user's name
- encrypted_password (or not, unsure how this works with oauth)
- has many relationshionships (follow other user's progress)
- post /points, create points for a user
- delete /points/id, destroy a point post
- id
- belong to user
- value of point, arbitrary integer of worth we give to activity
- description, string that describes that point so we can organize them (so "walked to work" could be a category)
Suggested technology to build it with:
- Python/Flask - very minimalistic, not as familiar with designing an entire application on top of it but want to learn. Would probably need a bit of mentoring in the best way to organize and implement that code.
- Ruby/Rails - black box, that said I've developed a very similar application with views in rails and it's a breeze. The rails-api project looks like a really good option, strips out all the views/templates/assets of rails and makes it lighter weight and better suited for a JSON API. https://github.com/rails-api/rails-api
What if we changed "Points" a bit? Maybe something like:
The app has a collection of "Activities", each of which has certain "Achievements", each of which has a certain number of points associated with it.
So, for example -
"Walk to Work" is an activity/category. Each day you walk to work, you mark it in the app, and you get X points. Mark more than Y days in a week, get Z additional points.
So we'd have an internal API for creating/managing Activities and Achievements (externally read-only), and then a many-to-many user achievement xref (illustrated in the structure below). The app would post to UserAchievements when the user marks some task as being completed.
Activity
-id
-name
-description
Achievement
-id
-name
-description
-activity_id
-points
-one-time/repeatable
-
UserAchievements
-user_id
-achievement_id
-datetime
This way, each achievement is only in the DB once - DRY applies to databases, too : )
Let me know if this doesn't make sense.