[Record 1] Vue+node+koa2+mysql+nginx+redis, full-stack development of small programs and administrator management system projects-preliminary preparation

Foreword:
Recently I am developing a small program and supporting background management system, mainly to change my ignorance of the back-end. Considering the development cost, node.js, a server-side development language suitable for front-end people, was selected. This blog will be updated until the end of this project and a summary of the problems encountered in the production environment. It is purely a personal exercise technique.

Preliminary preparations for the development environment:
1. Download the integrated environment (⚠️download its latest version to avoid stepping on pits.). MxSrvs integrated software : It reduces the trouble of configuration and the need to download multiple files (I think so). It
Insert picture description here
already comes with the necessary development tools for Nginx+redis+mysql.
2. Install the node+koa2 development environment (please refer to Baidu for specific installation tutorials, there are many online)
3. Download a Navcat Premium visualization tool to help you quickly build a database and table.
4. Create a new koa2 project. The directory structure I built here is as follows:
Insert picture description here
controllers are controllers, which mainly store connection database files, public methods of executing sql statements, and api (executing sql statements).
Middleware is used to store custom middleware.
redis is to configure the local redis service.
Routes is the project's interface api routing address (non-front-end routing).
Util stores some public methods and configured token-free request whitelists and custom salt that generates tokens.
app.js is the subdirectory of the project. Imported interface routing and routing interceptor middleware, swagger configuration and so on.
At this point, the preliminary preparations for the project are almost complete.

Next: Writing an interface

Guess you like

Origin blog.csdn.net/Smell_rookie/article/details/108625401