Fullstack应用架构|反应| Redux |节点

问题描述 投票:0回答:1

我正在使用node创建一个全栈应用程序,对redux mongo和护照进行反应。我对应用程序架构有一个疑问:

目前,hTML内容显示在页面(React Components)上,而不是从mongo DB中获取的内容(例如用户名,他的信用等),是硬编码的,例如标题,子标题,文章数据,欢迎页面等。进一步扩展应用程序,我也想在其他国家/地区放假我的网站,为此,我需要本地化我的网站内容。第二个用例是添加诸如“我们的博客”,“案例研究”等标签,这些标签将具有不断变化和添加等内容。因此,我的问题是如何也通过某些JSON来制作此硬编码数据并在我的组件中使用它。

我应该采用哪种架构。注意-我已经在使用Express api来获取我的用户信息,登录状态,mogodb数据等。附有屏幕截图。enter image description here

node.js architecture localization content-management-system react-fullstack
1个回答
0
投票
[我鼓励您看看this fullstack starter

它采用以下文件结构:

client |--src (client-specific app code) |--config (client-specific config, e.g. webpack) |--package.json (client-specific npm scripts and dependencies) |--eslintrc.js (client-specific eslint config) |--jest.config.js (client-specific jest config) |__tsconfig.json (client-specific tsconfig) server |--src (server-specific app code) |--package.json (server-specific npm scripts and dependencies) |--eslintrc.js (server-specific eslint config) |--jest.config.js (client-specific jest config) |__tsconfig.json (server-specific tsconfig) shared |--src (shared app code) |--package.json (shared dependencies) |--eslintrc.js (shared-specific eslint config) |--jest.config.js (client-specific jest config) |__tsconfig.json (shared-specific tsconfig) dist (transpiled server app + client static files - ready to put on server and start) |--app.js |__public (Folder for compiled frontend app - static files server by app.js) package.json (main npm scripts, husky hooks, yarn workspaces) .eslintrc.base.js (eslint config common for client, server, shared) .tsconfig.base.json (tsconfig common for client, server, shared) prettierrc.js (prettier config common for client, server, shared)

© www.soinside.com 2019 - 2024. All rights reserved.