(苹果多开)在webex上工作后,如何更好地开发软件
作为软件开发者,我往往不满足于只写页面业务逻辑,对接后端接口。
(当然,如果我想成为钓鱼之王,我还是会满足的。哪怕只写一个静态页面,我也会很满足。)
我不愿意在界面上只看到这个区域。我渴望了解更广阔的世界。
于是,我有了建立自己个人网站的想法。
使用的工具和技术有:墨刀-vue-node . js-MySQL-navicate-pagoda panel。
以下步骤不需要严格按照顺序进行。比如网站备案可能需要很长时间,可以作为第一步。
比如我在开发的时候,有了一些新的想法,可以回来修改原型。
毕竟在这里,我是产品经理,ui设计,前端后端。也就是我可以为所欲为。
1.原型
建网站首先需要需求和原型图。
我的网站内容是什么,我想表达什么,我想分享什么?这不比写作文难。
后期还需要个人不断思考延伸,更新升级网站的布局。
推荐使用墨刀在线工具进行原型设计。
2.设计
有了原型图,我们需要设计UI来进一步美化页面。建议使用ps。
然而,今天的重点是建立一个网站。这里,我就偷懒,直接进入下一步。
3.发展
开发过程需要三个项目:前端项目、界面项目、后台项目。
前端开发不多说,就用vue family bucket。
在后端开发端,要和原型对比,先设计数据库,用navicate构建数据库和表字段。
然后创建node.js接口项目,使用express框架进行开发。
一般来说,添加、删除和检查的界面是标准的。我的习惯是加贴,删除,修改,获取。
4.计算机网络服务器
项目写好了,本地就可以运行了。下一步肯定是找到一种方法将它们部署到服务器上。等等,我还没买服务器呢!
4.1购买服务器
我买的是腾讯云的云服务器,先买最便宜的就行了。我买的是1核2GB的,我选的是centOS系统。搞活动的时候买的,一年好像不到100块。
4.2购买域名
顺便说一下,购买域名,只需使用。第一名。价格只有几块钱。比如我买了哈哈哈. top
但是后期备案域名会比较麻烦,需要根据收到的邮件和电话不断调整备案材料的内容。
4.3连接到服务器
下载一个服务器连接工具,比如finalShell(下载地址:https://www . jb51 . net/softs/717120 . html)。输入服务器的ip地址和密码,连接将会成功。
5.宝塔面板
5.1安装宝塔面板
yum install-y wget & amp;& amphttp://download.bt.cn/install/install_6.0.sh & amp;& ampSh install.sh输入y安装。安装后会显示登录链接,以后可以在线操作服务器。
理论上,毕竟是linux系统,服务器的大部分操作都可以通过finalShell命令行进行。
但是我习惯了windows,我还是更喜欢可视化的界面。所以我们必须安装宝塔板。
宝塔常见的功能有添加站点、网站、ftp等。
你需要先在软件商店安装apache、pm2 manager、mysql和node环境。
5.2添加站点
进入宝塔面板,添加一个网站。比如我可以加一个demo .哈哈哈. top,www .哈哈哈. top,m .哈哈哈. top
添加后进入网站目录,可以上传静态文件,比如简单的测试html或者打包vue项目生成的文件。
注意:网站需要dns解析,使网站域名与ip地址链接。需要进入腾讯云,添加一条分析记录。将demo和m添加到分析记录中。
5.3添加数据库
在pagoda面板上添加数据库,可以先将本地数据库导出为sql文件,然后上传到线上数据库。
然后在节点项目中,将连接mysql的账号密码改为online。
6.部署
6.1前端项目
对于网站和管理后台项目,只需将npm run build打包后生成的文件上传到指定的网站目录即可。
6.2后端项目
将除node_modules文件夹之外的节点项目文件上传到一个目录,例如/wwwroot/website-api/
使用finalShell进入该文件夹,使用npm install安装依赖项。
使用node app.js测试是否启动。
当您退出此命令时,项目将停止。为了保持项目启动,可以使用以下命令:
nohup节点应用程序。以上命令仍然需要持续连接服务器,如果需要关闭连接,仍然可以运行,可以使用pm2。
2 pmstartapp.js这样节点项目就可以持续运行,和本地节点app.js始终打开有异曲同工之妙。
注意:比如接口项目使用端口3000,需要先添加到云服务器中的安全组规则中。
至此,基本完成。可以打开网站访问,可以请求界面,可以后台修改数据。