[p2pu-dev] Some thoughts about badges.p2pu.org

Dirk Uys dirk at p2pu.org
Fri Mar 15 12:14:41 UTC 2013


Hey everyone

You may or may not know that we have been working on badges.p2pu.org (
github.com/p2pu/badges) for the last 3/4 weeks. At this stage I would like
to reflect on a few things.

What went well?
- Using OAuth for user authentication worked really well
- Structuring the model as an API and hiding the ORM objects from the view
-- This helped a lot with testing
-- Also made dependencies between different parts of the application
explicit when it needs to be
- Using ansible for sysadmin tasks (see github.com/p2pu/marvin)
- More thorough testing for the model
- Using notifications API to send email notifications
(badges.p2pu.orgknows only the username)


What could/can we improve upon?
- Use API for user info
- User roles like admin not implemented on badges (will need this to handle)
- User uploaded media - scaling images, async upload, storing files on S3
- Testing of views


Other thoughts
- Modularity of the model vs modularity of the view (Django app metaphor
doesn't feel like a good fit for everything)
- Notifications as part of the model. Notifications tends to be more view
like and have more dependancies
- Slightly concerned about performance with API, but only time will tell

Let me maybe say a few things about the modularity and notifications, I
think they're actually related. The application model and the application
view doesn't feel to me like it fits that well with Django's concept of
applications. The views normally have more dependencies than the model and
even though you can use a django app where the view has more dependencies
on other apps, it starts making less sense.

This brings us to notifications, which have several similarities with
views: they are exposed to the user, normally supply more context to the
user that the event triggering the notification in the model, needs to be
translated based on user preferences and probably also uses a template. I
guess it's possible to create notification events in the model and then
hook that up with the actual notification sending code? This obviously adds
a bit of complexity.

So, just felt like sharing this for those who may be interested. Any
feedback will be very welcome!

@Erika & Chris, feel free to add any thoughts that you have.

Enjoy the weekend!

Cheers
d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20130315/0c45e89a/attachment.html>


More information about the p2pu-dev mailing list