如题。
如果选择使用nodejs作为网站后端,需要哪些架构配合?
网站要求:
网页端,微信端,移动端都要支持
数据存储打算使用MySQL,redis,数据量目前来说前期百万级,可能存在井喷式数据增长
websocket
目前我只知道可能会用到nodejs,express,react,react-native。
目前有几点比较困惑:
选用前端模板渲染还是后端渲染
ORM
OAuth
CSS,UI方面有木有推荐的框架比如bootstrap之类的
如果使用前端模板的方式,SEO?
我也知道这个问题比较大,需要跟业务相关联,我只是想知道目前大概的架构框子而已,学习。或者说目前比较流行的模式是怎么样的?
先谢谢打字回答了。
It seems that the great masters are taking a rest. I'll just sort it out myself.
Probably the shelf will use
nodejs
as the back-end server, and other needs will revolve aroundnodejs
.express
+mongoose
should probably be able to implement an MVC with a similar structure, and the database will usemongoDB
instead (follow closely trend..). OAuth uses theeveryAuth
middleware (passport
is also very convenient), and the built-in ones are some popular foreign websites. If you want to access WeChat or something, you probably have to write some code yourself. Visual inspection is not very difficult.express
ImplementationREST API
is so eazy by visual inspection,WebSocket
nodejs also supports it, surprisingly simple. As forredis
, the client has it,mongoose
has hooks, I think it also has the cooperation between database and redis A very convenient implementation method. Taking into account the evil Baidu, express's defaultjade
template is used. What has not been finalized yet is the front end. There are too many choices,jQuery
,react
,angular
,backbone
,vue
. I want to try it on the mobile versionreact-native
. Apps are mostly displayed, so I think this is easier. After all, I’m not familiar with iOS.After I clarified these relationships, I discovered that there was already something called
mean
that did something similar. You can go take a look, but I don’t really like this kind of architecture that integrates too much.Recommended
meteor
Addreact
to learn moreI have the same difficulty in choosing as you, and I hope experienced drivers can help answer it