Preface (it is recommended to skip directly)
Many students will come into contact with other people's open source projects if they want to go further in the study of Java backend. At this time, how to import other people's packages and run them normally for my own use seems not as simple as it seems. From this, I have concluded that I have gone through nearly 13 hours of detours, and hope that future generations can learn from it to save time and money.
Early demand
1.VScode
It is used to undertake front-end engineering later.
You can use a newer version (when I installed dependencies later, there were problems caused by the low version of vs, after updating the new version, there is no such error).
2.IDEA
For undertaking back-end projects
It is recommended to use a newer version, pay attention to check whether your own Tomcat and maven plug-ins (generally the new version of IDEA comes with these two plug-ins, but just in case, check them) whether they have been installed, specifically from the set plug-ins search.
At that time, because there were too many error reports, I took the initiative to install Smart Tomcat in order to eliminate them . Later, it should have no effect.
3. Database (MySQL)
(1) I installed version 8.0.25 , which is not limited.
(2) There is no limit to the version of MySQL, but IDEA 's MySQL driver must match, otherwise it will not be able to connect to the database.
Remember, whatever version of MySQL you install, install whatever version of the driver .
4. Nodejs installation
(1) It is recommended to install version 14.17.5, you can refer to this installation tutorial to install vue on npm under windows
The only thing to pay special attention to is that you must not learn from the tutorial and update your npm to the latest version . The node downloaded from the official website will come with its own adapted npm , and you don't need to update it (in case you update, just npm -g install npm@6.***Your adapted version, you can check it on the official website)
(2) If there is no need, it is generally recommended not to touch sass , cnpm unless you need it or you are very sure that the problem is it. I just changed it and changed it, which led to reinstalling Node. I don’t know how many times
(3) There may be problems when installing vue scaffolding . The solution is to open your cmd as an administrator
Front-end deployment
1. Go to gitee to download Renren Open Source (gitee.com) , renren-fast-vue directly download the zip, and then unzip it.
2. Open it with VS
3. To check where your package.json is, first make sure it is under your current directory , then run npm install (the dependencies required to install the package), and then execute npm run dev, if there is no problem, it will open Renren is an open source website , but it has not been verified, because we have not deployed the backend at this time (if you strictly followed my previous steps, there will be absolutely no problem at this point).
(ps: It is recommended to open VS as an administrator to perform the above operations, which is safer, and each computer is different, and some may involve insufficient permissions)
The following is the success interface
At this time, our backend has not been deployed and opened, so its verification code is empty, and you cannot log in
Deployment of the backend
1. Similarly, go to the above website to download and decompress
2. Open the back-end file with IDEA , there is a high probability that the icon in front of some files will burst into red . At this time, mark its root directory file as the source root generated, which is equivalent to manually building it.
If there are still popular files left , you can go to see their problems in detail, and then solve them one by one. Don’t be afraid of becoming popular. It is very normal for other people’s projects to be incompatible .
3. Modify the configuration file
Although I haven't figured out why yet, it seems to be a limit on loading time or something, but just remember not to change it (the code can run normally)
Connect a database to your background.
4. Create your database to store data
You can name the comment position whatever you want.
Remember that if your MySQL is not checked to start automatically at startup, then you need to start it manually.
Make sure your MySQL is started
Right-click on my computer, select management, find my own MySQL from the service, and start it.
If the database has been opened, an error is still reported above
Then it may be that the database you are connected to does not exist , do not use it to create a database , remember to create the database first and then connect to it
In terms of connecting to the database, I have not encountered other problems, but what I know is the time zone modification problem, basically you can directly copy the problem and then Baidu (a programmer's self-cultivation)
Remember to make sure that these two places are connected to your database
Next, run your MySQL file, and after a while, you will see that its table has been created under your database
Find the startup file, then src 》main 》java, and start it directly
The success interface is as follows, and you can log in to view our backend when you are hungry.
The account password is admin.
After login interface
So far, our front-end and back-end deployments are complete, and finally remind you, remember to open your database every time you open the back-end
let's work hard together