preface
To tell the truth, as an engineer in the eyes of others API calls, I gradually cut is not content to simply make a figure, write their own back-end idea in mind now, so after the node chewed on two consecutive days, my hand rolled a blog background, is also half a foot into the whole stack of threshold (ha ha, don’t spray me). Get to the point, this article, I will completely from 0 begin to write, since I bought the server steps, of course, if you are interested, and determined to learn, I suggest that can also buy a server to play, bat who cloud server can casually, new users 9 9 bag mail, you can’t buy the disadvantaged, buy don’t fall for it.
Here attached page address (PC) : myblogs. LTD: 8088 / home/list
Front-end git: github.com/809525536/m…
Backend scaffolding git: github.com/809525536/t…
The complete back-end project is not open source, mainly related to the database account password ~~
Let’s start with an overview of the technology stack required to create a complete blog:
- NUXT: Server rendering framework, reason for choosing – seo optimization, speed up the first screen rendering
- VUE: Needless to say, as a qualified cuttoon, don’t tell me you can’t
- KOA: The Node application framework helps us to encapsulate everything, directly on the handwriting interface
- Typeorm: with KOA, using JS syntax can help us very easy to add, delete, change and check the database
- Typescript: PERSONALLY, I see the future as a front end trend, so I can get my hands on it
- Mysql:
Preparatory work:
- A mysql database. After all, we all want to save it, first of all have to have a database, for such will build table behind again, I bought a so-and-so cloud database, 9 dollars for three months, with a enough, if you are cash-strapped, can also build a set of database, locally just won’t be able to experience pleasure in the remote access.
- A cloud server ESC, I also buy the so-and-so cloud, I suggest also buy a new user experience version, a few dollars a month, after all, there is no cheap what is it. How to configure it will be discussed later.
- A computer for writing code.
Once the preparation is complete, I will start to put up the front shelf, either using the scaffolding provided by NUXT or directly clone my Git project.
This is the directory structure after scaffolding generation, nuxT feature is that we do not need to configure additional routes, you just need to create a new page in the Pages directory, NuxT will automatically generate the corresponding routes for us. Global plug-ins, such as axios interceptors, or custom components, are placed in the plugins directory and configured in nuxt.config.js:
Once configured, NPM run dev is ready to run, and we are ready for the back shelf. Again, I can clone my Git project, which is already configured with KOA, typescript, and Typeorm, out of the box:
This is the generated directory structure. Note that in ormconfig.js, this is configuring our database
Now that the front and back shelves are ready, in the next article I’ll write about cloud server and database configuration and how to deploy the code on them.