Abstract: This paper is about the front and back end separation project technology and framework selection general scheme, is a relatively mature scheme. At present, most companies also use this system.

I. System architecture

The whole system will be composed of three parts, as follows



Second, the details

1, the front end

Front end here is a pure front end project, using Webpack only a few static js/ CSS files.

Develop languages and frameworks

vue+webpakc+axios

Deployment way

Static JS/CSS/HTML files are deployed directly to a directory on the machine where Ngnix is located, and then the Ngnix Settings are mapped to that directory

Technical difficulties

Cross-domain with cookies, cross-domain cookies sharing

The solution

The front fetch/ AXIos request ajax can be set to allow cross-domain cookies, and the middle platform can also be set to cross-domain cookies. For cookie sharing, you can write cookies under the root domain.

2, China

The middle platform is a WAR package project that can be placed directly under Tomcat

Development of language

Java+springMvc+spring+Dubbo+Tomcat

Deployment way

Package the project into a WAR package and deploy it on Top of Tomcat. Note that the WAR package here has no pages, it simply provides the address of the Ajax request for the front-end project in 1 above

Technical difficulties

The scheme is relatively mature without technical difficulties

3, the background

Background is a pure background project, in the Java language

Development of language

Java+Spring+Mybatis+Dubbo

Deployment way

Create a separate package containing lib, conf, and bin directories. Use the Dubbo startup script to start the service for the central platform (see this article: Dubbo application startup and stop scripts, dissected in detail)

Technical difficulties

The scheme is relatively mature without technical difficulties

Three, think

In fact, the mid-stage project can not use, but the background Java interface to find a direct HTTP request solution.