Thursday, February 11, 2016

Re: Front End and Back End separation

For validation, I tend to write very lousy validations in JS. Serializers handle most of the validations in BE itself. 
If you want to depend on JSON, then you can write JSON schema validation in BE and use the same schema validation in JS. 

We tend to write BE such that it remains compatible with FE for long time, so change in API is very rare. Otherwise we make changes in FE also. I'm not quite sure how can you handle in your case. 

On Thu, 11 Feb 2016 at 15:45 Radek Svarz <radek.svarz@gmail.com> wrote:
Thanks for supporting my gut feeling :)

 - ad validation 
   - do you somehow propagate the validation rules to the FE app? Or do you need to rewrite some of them in JS?

 - ad app versioning 
    - how do you give the impulse towards FE app that it needs to reload itself in order to be compatible with the new BE version? (for the continuous deployment - i.e. several deployments / day)



On Thursday, February 11, 2016 at 2:24:51 AM UTC+1, Dheerendra Rathor wrote:
If you don't want FE guys to touch your Python code, I will suggest to go with option 1. DRF is a great library and creating REST API is dead simple. Data validation is pretty easy in DRF using serializers. 
I tend to write my own authorization methods with DRF but they are also easy. It is just plug and play for DRF. 

On Wed, 10 Feb 2016 at 15:33 Radek Svarz <radek...@gmail.com> wrote:
Hi,

I am deciding about the new architecture of the Django business app.

The web frontend app constists of 1 highly interactive part - visual editor (using D3js) and several configuration pages.

I am strong in the Django backend part, but outsourcing the JS front end to the freelancer.com guys.

My main repo is in git. I am deploying automatically upon master push towards Openshift (i.e. pushing the whole master HEAD).

I am considering to have 2 git repos - 1 for Django and 2nd for HTML/JS FrontEnd app.
    Motivation:
        1. I do not want freelancers to touch django BE part
        2. mindset of some FE guys - they do not like Python and just want to interact against mockup BE server

Please help me choose the best approach of FE vs BE architecture. My options so far:

alt 1. Separate FE code with bower/npm packaging in own git repo
    - completely separated concern
    - communicating with Django via DRF API 
    - here I foresee issues like authentication, app versioning and data validation. I found something, but not sure whether it is still valid: http://richardtier.com/2014/03/15/authenticate-using-django-rest-framework-endpoint-and-angularjs/
    - any other issues with this approach?

alt 2. FE in Django templates with AJAX calls for the interactive editor
    - can I keep the JS in the separate git repo?  I read something about git submodules. But I am not sure whether there are any issues.

opt 3. Django crispy forms 
    - complementary option only for the app part of configuration pages
    - the idea is that these pages are rather data form driven so once the visual FE template is done, the JS FE guys do not need to focus on this

note: I tried to inspire myself from the source of great djangopackages.com and sentry, but they seam to mix FE and BE within 1 repo.

Thanks for any advice,
Radek

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/73a7474e-9941-4592-831d-d06835807b19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAByqUgiGPA%2B0XYrG93i5RPqFZQmmzYvsgj4EUzispxFvjKFEWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment