开发社交网络:技巧、细节和信息
我想使用 Ruby on Rails 3 创建一个小型社交网络。由于它是一个复杂的系统,建议使用什么信息架构?
我想创建多个具有分层架构的 RoR 应用程序,每个应用程序用于完成特定目的。因此我创建了一个域和多个子域。
例如:
主域:http://main.com
所有嵌套子域:http://app1.main.com
、http://app2。 main.com
,...
使用这种类型的架构时出现的一个问题是用户的身份验证,因为在 http://main.com 处设置 cookie 时。 com
级别(以便所有 cookie 都可以从所有子域访问),当我尝试在子域之间进行 HTTP GET 调用时,它们不会被“跟踪”,除非您在 HTTP GET 调用中显式传递 cookie 的参数值,可能使用 SSL/TSL 连接。这是正确的做法吗?
但是,在这种情况下,我可以考虑使用 REST API 和 OAuth 等协议来保护资源...
创建社交网络的正确方法是什么?谁能给我足够详细的建议吗?
PS:我说的对吗?!
I would like to create a small Social Network using Ruby on Rails 3. Since it is a complex system, what is recommended for the Information Architecture?
I thought to create multiple RoR applications with a Hierarchical Architecture, each used to accomplish a specific purpose. Therefore I created one domain and more subdomains.
For example:
Main domain: http://main.com
All nedded subdomains: http://app1.main.com
, http://app2.main.com
, ...
A problem that occurs using this type of architecture is the authentication of users, because, while setting the cookie at the http://main.com
level (so that all cookies are accesible from all subdomains), they are not "followed" when I try to make an HTTP GET calls between subdomains, unless you explicitly pass parameter values of cookies in the HTTP GET call, maybe using a SSL/TSL connection. Is this a right approach?
However, in this case, I can think of using REST APIs and a protocol such OAuth to protect resources...
What is the right way to create a Social Network? Can anyone advise me detailed enough?
P.S.: is it correct what I'm saying?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看 Social Stream,它是构建社交网络网站的核心:
https://github.com/ging/social_stream< /a>
Take a look at Social Stream, a core for building social network websites :
https://github.com/ging/social_stream
你也可以看看 Diaspora,这是一个功能齐全的社交网络,他们在 github 上提供了源代码! https://github.com/diaspora/diaspora
you could also look at Diaspora it's a fully featured social network and they made the source code available on github! https://github.com/diaspora/diaspora
我创建并开源了 Brevidy,一个视频社交网络。它可能有助于向您展示应用程序的结构。
来源:https://github.com/iwasrobbed/Brevidy
演示:http://brevidy.heroku.com/rob/channels
I created and open sourced Brevidy, a video social network. It might be helpful in showing you a structure for the app.
Source: https://github.com/iwasrobbed/Brevidy
Demo: http://brevidy.heroku.com/rob/channels