vulcan 编程
How unambitious I was, a few months ago, when I published “Vulcan: 15 days for an app”! 15 days is 3 weeks of work. If you include conception time, that’s a month of delay. What if we could reduce it to a week? What if we could develop production-ready applications in a matter of days? Here is how we are achieving this goal.
几个月前,当我发布《 Vulcan:一个应用程序需要15天 》时,我的表现真是太好了! 15天是3周的工作时间。 如果您包括受孕时间,那将是一个月的延迟。 如果我们可以减少到一周呢? 如果我们能在几天之内开发出可投入生产的应用程序该怎么办? 这就是我们如何实现这一目标。
第0天:一些情况 (Day 0: Some context)
不要仅仅因为您产生马虎的代码而自称“启动” (Stop calling yourself a Startup just because you produce sloppy code faster than others)
I run a development and consulting company named LBKE. We take a deep interest in technologies that help produce high quality applications in a very limited amount of time. Think React Native+Expo for mobile, or Meteor for web applications.
我经营一家名为LBKE的开发和咨询公司。 我们对有助于在非常短的时间内产生高质量应用程序的技术产生了浓厚的兴趣。 为移动设备考虑React Native + Expo,为Web应用程序考虑Meteor。
Through the years, the expected quality of Minimum Valuable Products (MVPs) has surged. People are fed up with low quality prototypes sold as “products”.
多年来,最低价值产品(MVP)的预期质量不断提高。 人们受够了作为“产品”出售的低质量原型。
Now, they want their software without bugs (no way!), they want a good UX (how picky they are!), they want tools that truly answer their needs (ugh!). And of course, they don’t want to pay more for that.
现在,他们希望自己的软件没有错误(绝不能!),他们想要好的UX(他们有多挑剔!),他们想要真正能够满足其需求的工具(哦!)。 当然,他们不想为此付出更多。
迈向4天应用 (Toward the 4 days app)
For the entrepreneur, designing and building such a Minimum Loveable Product is a lot of work. But money is tight, and time is money, so you have to be smart about how you spend it.
对于创业者来说,设计和建立这样一个最小可爱产品是大量的工作。 但是金钱紧缺,时间就是金钱,因此您必须对如何花钱保持精明。
Our goal: being able to produce a SaaS application in 4 days. We do not mean a throwaway app that won’t bear further development. We believe that well-designed technologies should allow both long-run development and very fast development: scaling up, and scaling down. For most projects, there is no need for prototyping technologies. Except if you build spaceships, but you don’t, do you?
我们的目标:能够在4天内生成SaaS应用程序。 我们并不是说不值得进一步开发的一次性应用程序。 我们相信,精心设计的技术应该让双方的长期发展,发展速度非常快:扩大和缩小 。 对于大多数项目,不需要原型技术。 除非您要建造太空飞船,但您不这样做,对吗?
Also, we do not like relying on 3rd party services/softwares that pop websites in a few clicks. If your product is truly innovative you likely feel awfully limited by such services.
另外,我们不喜欢依靠单击几次即可弹出网站的第三方服务/软件。 如果您的产品真正具有创新性,那么您可能会受到此类服务的极大限制。
So, how do we achieve this miracle without using a magic wand? Let’s discover it through a real life example, GestiResto, a web application that helps restaurant owners to manage their recipes. Side note: I live in France, we don’t joke about food here, so I really took this project to heart.
那么,如何在不使用魔术棒的情况下实现这一奇迹? 让我们通过一个真实的示例GestiResto来发现它,该示例是一个Web应用程序,可以帮助餐馆老板管理他们的食谱。 旁注:我住在法国,我们在这里不谈食物,所以我真的很喜欢这个项目。
第一天:领取我们的飞船 (Day 1: Picking our spaceship)
认识Vulcan.js,又名类固醇流星 (Meet Vulcan.js, aka Meteor-on-steroids)
Meteor is a famous full-stack JavaScript framework. From its very beginning, it has always emphasized productivity and developer experience. It pioneered many awesome features and patterns, like isomorphic development (reuse the same code server side and client side).
Meteor是著名的全栈JavaScript框架。 从一开始,它就一直强调生产力和开发人员经验。 它开创了许多很棒的功能和模式,例如同构开发(重用相同的代码服务器端和客户端)。
Vulcan.js is basically the good elements of Meteor, plus the good elements of the JavaScript ecosystem, in a single framework. It relies on the latest technologies: React for the frontend, and Apollo (GraphQL) for client/server communication.
Vulcan.js在单个框架中基本上是Meteor的好元素,再加上JavaScript生态系统的好元素。 它依赖于最新技术:React用于前端,Apollo(GraphQL)用于客户端/服务器通信。
As a bonus, it includes a lot of packages and examples for the most common features (sending newsletters, adding a forum, etc.). Vulcan is the direct grandchild of the famous Meteor app/framework Telescope, it has been created by Sacha Greif. It thus benefits from years of experience despite its modernity.
作为奖励,它包括许多软件包和最常用功能的示例(发送新闻稿,添加论坛等)。 Vulcan是著名的Meteor应用程序/框架望远镜的直接孙子,它是由Sacha Greif创建的。 因此,尽管具有现代性,但仍可以从多年的经验中受益。
If you want to know more about Vulcan and how it helps cut development time, you can checkout my previous article in DailyJS.
如果您想了解有关Vulcan及其如何帮助缩短开发时间的更多信息,可以在DailyJS中查阅我的上一篇文章 。
So, Vulcan.js is definitely a solid candidate to meet our self-imposed 4 day deadline!
因此,Vulcan.js绝对是满足我们自己设定的4天截止日期的可靠选择!
开箱即用的用户管理系统 (A user management system out-of-the-box)
One of the most beloved features of Vulcan is its account system, which it inherits from Meteor. It includes signup/signin/logout, permission management, enrollment/forgotten password workflows (+ programmatic email sending), and a nice user interface. Oh, and also it’s quite easy to add 3rd party auth with services such as Google Oauth.
Vulcan最受人喜爱的功能之一是其帐户系统,它是从Meteor继承而来的。 它包括注册/登录/注销,权限管理,注册/忘记密码的工作流程(+编程式电子邮件发送),以及漂亮的用户界面。 哦,而且添加第三方服务(例如Google Oauth)非常容易。
Accounts management is really something you DON’T want to think about in the early stages of your app life-cycle. How many hours have been lost setting up Passport.js! The amount of paid authentication services such as Auth0 shows that this problem is not yet solved, so it’s really a very nice feature.
帐户管理实际上是您在应用程序生命周期的早期阶段不希望考虑的事情。 设置Passport.js丢失了几个小时! 诸如Auth0之类的付费身份验证服务数量表明,此问题尚未解决,因此它确实是一个非常不错的功能。
So, our first day has been well spent. We now have a complete user management system including database, server , UI, and back-office, and we set up a nice Material UI layout with the remaining time.
因此,我们的第一天过得很愉快。 现在,我们有了一个完整的用户管理系统,包括数据库,服务器,UI和后台,并且在剩余时间里建立了一个不错的Material UI布局。
第2天:托管 (Day 2: Hosting)
通过Meteor Up在AWS上托管 (Hosting on AWS with Meteor Up)
Why hosting on day 2 already? Because life taught us that it is a very bad idea to test your app in production the last day. In an agile fashion, a feature is only done when validated in a real life context. So, we can’t consider the application to be set up if we did not run it in a production environment.
为什么要在第二天托管? 因为生活告诉我们,在最后一天测试您的应用程序是一个非常糟糕的主意。 以敏捷的方式,只有在现实环境中进行验证时,才可以完成功能。 因此,如果不在生产环境中运行应用程序,则无法考虑要设置该应用程序。
Meteor Up is a wonderful tool to automatically deploy Meteor apps (so Vulcan apps too) on a distant server. It handles everything, from containerization of the app with Docker to SSL certificate generation with Let’s Encrypt. Setup is easy, deployment is a one line command. There are barely any drawbacks to it.
Meteor Up是在远程服务器上自动部署Meteor应用程序(也包括Vulcan应用程序)的绝佳工具。 它处理一切,从使用Docker进行应用程序的容器化到使用Let’s Encrypt生成SSL证书。 设置很容易,部署是一条命令。 它几乎没有任何缺点。
I picked AWS for the hosting. It has the big advantage of proposing free services for 12 months. I must admit that I had hard times setting up my first EC2 instance. However there are many tutorials on the web and it’s worth the initial trouble. Also, I am currently writing a package to enable daily backup of the MongoDB database on AWS S3 to make your data safe.
我选择AWS进行托管。 它具有建议12个月免费服务的巨大优势。 我必须承认,我在设置第一个EC2实例时遇到了困难。 但是,网络上有许多教程,值得一开始的麻烦。 另外,我目前正在编写一个程序包,以启用AWS S3上MongoDB数据库的每日备份,以确保您的数据安全。
Zeit’s Now + Mongolab上的暂存应用程序 (A staging application on Zeit’s Now + Mongolab)
Sooner or later, you will need to test that your app works in production, without actually sending it to production. That’s what we call a staging environment. You can use AWS too, but let’s try a free solution instead to cut costs.
迟早,您将需要测试您的应用程序是否可以在生产环境中运行,而无需实际将其发送到生产环境。 这就是我们所谓的暂存环境。 您也可以使用AWS,但是让我们尝试一个免费的解决方案来降低成本。
Zeit’s Now service is well suited for this usage. It offers free hosting. You can use mLab for the database, as it provides a free sandbox environment too. To be honest I have nothing much to say here, because the set up is as easy as ABC, and fully documented here. Not even a bug. What’s my purpose as a developer if there are no bugs???
Zeit的Now服务非常适合这种用法。 它提供免费托管。 您可以将mLab用于数据库,因为它也提供了免费的沙箱环境。 老实说,我在这里没什么可说的,因为设置起来像ABC一样容易,并且在这里有完整的文档 。 甚至没有错误。 如果没有错误,我作为开发人员的目的是什么???
Okay, so, at the end of day 2, our app is in production and we have an intermediate demonstration environment. Nice! That’s cool, because less time for generic features is more time for valuable features.
好的,所以,在第二天结束时,我们的应用程序已经投入生产,并且我们有一个中间的演示环境。 真好! 太酷了,因为更少的时间使用通用功能就是更多的时间使用有价值的功能。
第三天:业务逻辑 (Day 3: Business logic)
应用是一堆表格和列表 (An app is a bunch of forms and lists)
Now, let’s get down to business. Most components of an application can be separated in 3 large categories: List, Form, and Details. This model apply to a LOT of websites.
现在,让我们开始做生意。 应用程序的大多数组件可以分为三大类:列表,表单和详细信息。 此模型适用于很多网站。
See Medium: the home page contains a List of articles. This page is a “Details” page of the article you are reading. At the bottom, you’ll find a List of comments with a comment Form. Even the “applause” button on the left (which I invite you to click thoroughly), is a simplistic Form like component.
请参阅中:主页包含文章列表。 此页面是您正在阅读的文章的“详细信息”页面。 在底部,您将找到带有评论表单的评论列表。 甚至左边的“掌声”按钮(我邀请您彻底单击它)也是一个简单的表单,例如组件。
Good news: Vulcan includes a whole lot of helpers to facilitate the creation of List, Form and Details components. It includes nice GraphQL resolvers and React HOCs. You barely need to write your own. There are even a few React components that work out-of-the-box. The most advanced of them is the SmartForm, which automatically generates a customizable creation/edition form for any collection.
好消息:Vulcan包含大量帮助程序,以帮助创建List,Form和Details组件。 它包括不错的GraphQL解析器和React HOC。 您几乎不需要自己编写。 甚至有一些React组件可以直接使用。 其中最先进的是SmartForm,它可以为任何集合自动生成可自定义的创建/版本表单。
I won’t list all the features Vulcan.js has to offer, but basically you can safely trust it to make your development process really fast.
我不会列出Vulcan.js所提供的所有功能,但是基本上您可以放心地信任它,从而使您的开发过程真正快速。
创建配方(或提出应用程序或发布文章或…) (Creating a recipe (or proposing an application or publishing an article or…))
In GestiResto, the 2 mains features are creating and listing recipes. The recipe creation form must display statistics. The details are confidential, so here is a screenshot of an equivalent form developed for Awesome Vulcan.
在GestiResto中,两个主要功能是创建和列出配方。 配方创建表单必须显示统计信息。 详细信息是机密的,因此下面是为Awesome Vulcan开发的等效表格的屏幕截图。
But that makes no difference, because here is the point: Vulcan can auto-generate forms out-of-the-box for whatever type of data you can imagine, whether it’s a recipe or a helicopter. I mean, the JSON representation of a helicopter.
但这没有什么区别,因为这是关键所在:Vulcan可以为您可以想象的任何类型的数据(无论是配方还是直升机)开箱即用地自动生成表格。 我的意思是直升机的JSON表示形式。
The recipe list is even simpler. We focused on building a nice RecipeItem
that allows users to quickly preview the recipe information, as well as triggering some common actions (exporting, deleting…). Of course, it includes a text based search input, for free.
配方列表甚至更简单。 我们专注于构建一个不错的RecipeItem
,使用户可以快速预览配方信息,并触发一些常见操作(导出,删除…)。 当然,它是免费的基于文本的搜索输入。
第4天:送货! (Day 4: Deliver!)
Since we did most of the valuable parts of the job on Day 3, we are left one last day to cleanup and improve the application. Now we can implement the love-to-have features: a component that automatically computes the final price of your recipe, a button that generates a nice PDF export, and a homepage that makes the difference.
由于我们在第3天完成了工作的大部分有价值的部分,因此最后一天需要清理和改进应用程序。 现在,我们可以实现“热爱拥有”功能:一个自动计算配方最终价格的组件,一个生成精美PDF输出的按钮以及一个与众不同的主页。
Eventually, we’re on Day 5. The client has just tested the app delivered yesterday evening, and says to you: “I’ve tested the app, it’s nice! I think of adding feature X to page Y, how long does it takes to add component Z in your opinion?…”. And then you know you did a good job!
最终,我们是在第5天。客户刚刚测试了昨天晚上交付的应用程序,并对您说:“我已经测试过该应用程序,太好了! 我想在页面Y上添加功能X,您认为添加组件Z需要多长时间?…”。 然后您知道您做得很好!
想要在4天内构建自己的应用程序吗? (Want to build your own app in 4 days?)
Take a look at our open source application Awesome Vulcan. It provides a reusable basis for professional apps with a Material UI look. It also demonstrates the use of a few packages we implemented.
看看我们的开源应用程序Awesome Vulcan 。 它通过Material UI外观为专业应用程序提供了可重用的基础。 它还演示了我们实现的一些软件包的使用。
I hope it will help you in your journey toward the 4 days application!
希望对您进行4天申请有帮助!
I am the co-founder of the French company Lebrun Burel Knowledge Engineering (LBKE) — https://www.lebrun-burel.com
我是法国Lebrun Burel知识工程(LBKE)公司的联合创始人— https://www.lebrun-burel.com
Always happy to talk about code, machine learning, innovation and entrepreneurship!
总是很高兴谈论代码,机器学习,创新和企业家精神!
翻译自: https://www.freecodecamp.org/news/how-i-built-an-app-with-vulcan-js-in-four-days-6368814077b1/
vulcan 编程
今天的文章vulkan编程指南_node怎么运行js文件「建议收藏」分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/88236.html