简体   繁体   English

可为不同客户定制的Rails应用程序

[英]Customizable Rails Apps for different customers

I will try to make this as clear as possible this is a very difficult situation and I will try to explain as clear as possible. 我将尽力使这一点变得非常清楚,这是一个非常困难的情况,并且我将尽力解释得尽可能清楚。 I have not many experience in Rails but I want to do Rails in the best way I can. 我在Rails方面经验不足,但是我想尽我所能来做Rails。 I've created a previous topic before but I don't really understand it Managing Large Scale apps via Rails . 我之前创建了上一个主题,但我不太了解它是通过Rails管理大型应用程序

Original situation: 原始情况:

We have had an app developed with only 1 customer in mind. 我们开发的应用程序仅考虑了一位客户。 To feed the customer needs we have the following branches: 为了满足客户的需求,我们有以下分支机构:

  • Development 发展历程
  • Customer DEV (separate site for testing new developments) 客户DEV(用于测试新开发的单独站点)
  • Customer ACC (separate site for accepting changes) 客户ACC(用于接受更改的单独站点)
  • Customer PRD (the customer production website) 客户PRD(客户生产网站)

Current situation: 现在的情况:

Now we have a second customer and all the branches have doubled. 现在我们有了第二个客户,所有分支机构都增加了一倍。 So we are now developing changes for each customer separately. 因此,我们现在正在为每个客户分别开发更改。 These changes may include model/controller/helper changes and they have a different stylesheet (sass/css) and also different HTML. 这些更改可能包括模型/控制器/助手的更改,并且它们具有不同的样式表(sass / css)和不同的HTML。

So our 1 app has been split into 2 separate apps for 2 customers. 因此,我们的1个应用已拆分为2个客户的2个独立应用。 And now I have to remembered what I did in each branch and try to implement it into other branches. 现在,我必须记住我在每个分支中所做的事情,并尝试将其实现到其他分支中。

Problem: 问题:

I'm totally going to lose control of managing these apps if more customers buy it. 如果更多的客户购买,我将完全失去管理这些应用程序的控制权。 So each customers could have different CSS / different HTML / different Models/Controllers/Library. 因此,每个客户可能具有不同的CSS /不同的HTML /不同的模型/控制器/库。

Problem Examples: 问题示例:

  • Each customer has different config/connections.yml file 每个客户都有不同的config / connections.yml文件
  • Each customer has different translation files config/locales/en.yml 每个客户都有不同的翻译文件config / locales / en.yml
  • One customer wants to have a database with Users (model/controller) the other doesn't want to keep the users in the DB 一个客户希望拥有一个包含Users(模型/控制器)的数据库,另一个客户不想将用户保留在数据库中

My thoughts: 我的想法:

I'm really scared on losing the control of this app when more customers will buy this app. 当更多的客户购买此应用时,我真的很害怕失去对该应用的控制。 I'm scared that I'm going to have 100 Github branches when 25 customers will buy it. 我担心当25个客户购买时,我将拥有100个Github分支。 I don't know if many people has this problem or maybe should I start all over again with coding these apps. 我不知道是否有很多人有这个问题,或者我应该从编码这些应用程序重新开始。 I don't know if this is even possible but if anyone could help me that would be awesome. 我不知道这是否有可能,但是如果有人可以帮助我,那将非常棒。

IMHO please consider following points for better management of applications with multiple customers: 恕我直言,请考虑以下几点,以更好地管理与多个客户的应用程序:

  1. Instead of creating separate branches for each customer and developing code separately, develop code in same branch for multiple customers(You can continue having 4 branches as per your release management). 不必为每个客户创建单独的分支并分别开发代码,而可以在同一分支中为多个客户开发代码(根据发布管理,您可以继续拥有4个分支)。
  2. If there are any features which are required by a customer but not by other then create settings interface for turning a feature on/off. 如果客户需要任何功能,而其他功能则不需要,则创建用于打开/关闭功能的设置界面。 This can be done by storing values in database or using gems like flipper or rollout 这可以通过将值存储在数据库中或使用诸如脚蹼或卷展栏之类的宝石来完成
  3. For different HTML structure and css, do not maintain multiple templates/partials but maintain different layouts for different customers and render respective layout with appropriate css conditionally. 对于不同的HTML结构和CSS,不要维护多个模板/部分,而是为不同的客户维护不同的布局,并有条件地使用适当的CSS渲染各自的布局。 Let templates & partials be common to all customers. 让模板和部分内容对所有客户都通用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM