Google say that they do not recommend using the script tag to include Firebase in a production web app. I don't use build tools and I was wondering if there was a security risk in using script or if it is just best practice for some other reason?
I have looked at the documentation and cant see any explanation as to why script is not recommended for production apps.
Related
I am a new self-taught developer.
I have created a simple full stack app (learning management system) using PERN stack. Now, I want to deploy it to learn the end-to-end process of creating a web app. I have a plan to make incremental improvements in the app and add more functionality to make it usable.
While researching for deployment, I came across various posts that doesn't recommend using create-react-app for production ready React apps. Further, this official article from React recommends using some toolchains for deployment (I think it is another name for Frameworks or set of tools):
https://reactjs.org/docs/create-a-new-react-app.html
Another alternative is to optimize the code using Webpack etc. before deploying it. I am neither familiar with any React Framework nor much aware of performance optimization for PERN apps.
If I have to use a framework, then my existing code may not work. I may have to do complete review of the same to make it suitable for the framework.
What is the best way to deploy my PERN app which I can scale in the future. (I have partially understood the concept of client side and server side rendering. As of now, users have to login to use app. But in the future it will be like the users can see the page (to take advantage of SEO) but need to login in order to interact with the site).
Do I need to learn a framework? (In that case I may have to develop all the code in that framework to maintain compatibility). If this is the case, then I will be glad to know which one?
Or, is there other way to deploy fully-functional PERN apps ready to use by potential customers.
Eagerly looking for some answers as I am completely confused at this point.
I couldn't find any documentation about build steps on the flexible environment. Only thing I found is that App Engine will run the start script from your package.json file after deployment, but is it possible to make it run the build script first? This is what Heroku does and I want to replicate it.
What you're looking for is the script called gcp-build as this one can perform a custom build step at deployment, just before starting the application. While this is only documented for Standard Environment as of now (I've let the engineers know), there are multiple public resources that can confirm this works on both environments. See the following links as reference:
Why does Google App Engine flex build step fail while standard works for the same code?
https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/typescript
I'm a self taught developer and I recently started learning Node.
I've been using Ruby on Rails for a couple of years now, and I learned most of what I know from online courses. The most helpful course I took was one in which I learned the entire process of setting up a development and production server, setting up a database, etc. In this case I was using Cloud9 for development and Heroku for production. I already knew the coding aspect of building a web app, but this course really changed everything for me because I learned how "real" developers work, how to set up a good work flow with a development environment, how to run my code on a real scalable server, etc... Since then I've built a couple of RoR apps on Heroku.
Now I'm learning Node and Express, but I'm not sure what to do with my code. Can I just use Cloud9 and Heroku, the same way I did with RoR? Are there other common services I should know about, similar to how lots of RoR apps use Heroku?
I'm looking for a small push in the right direction - the same one I had when I was learning Rails - to get the ball rolling. Any information will be greatly appreciated! Thanks
You seem to be asking both for workflow and environment pointers, so I'll give you a tiny bit of both
Env
With node, it is perfectly fine to have your dev environment locally and only host your staging and prod environment
If you don't have specific requirements in terms of hosted environment, use what you are already comfortable with:
Heroku is perfectly fine
OpenShift is a great alternative
Pivotal seems to be alright
Google App Engine and Amazon Elastic Beanstalk are most likely overkill
 Workflow
This is a very broad subject. Everyone has their own ways of doing things. At a minimum I would get familiar with the following tools or concepts:
npm (default package manager)
alternative: yarn (faster, shinier)
eslint (linter for javascript, indispensable)
Gitflow (sane way to manage your git repo)
Semver (what is semantic versioning)
Unit Testing with Tape (it's 2017, you need tests)
alternative: Mocha (more functionalities, some you don't need)
Airbnb Style Guide (a decent baseline for style)
alternative: Google Style Guide (I use this one)
There is also this overwhelming but great list, which is a bit too much but should list anything else you might need
Finally, if you want to work more with Express, I would suggest going through this MDN series Express Web Framework. Once that is done, I would installing the Express App Generator, create a test app and looking at the structure of files and folders
I want to build web ui for StrongLoop. It would let a user build and deploy process with that UI like StrongLoop Arc.
There are simple node applications(Web Services) without created with StrongLoop tools. Need to deploy these applications via web ui. Solution in my mind is some server-side processes, listed steps below:
Upload zip folder(node application) to server
Extract zip and build to tar.gz by shell command (slc build) through node.js child_process API
Deploy tar.gz file to relevant StrongLoop host by shell command(slc deploy..) through API which is mentioned on previous step.
I wonder is there any alternative way to deploy node application(without created with StrongLoop tools) to StrongLoop host via web ui using some StrongLoop API?
I have looked API could not find specific solution.
What you require is a CDP (Continuous delivery pipeline) setup, there seem to be many ways in which you can achieve this (easiest way is using Codeship or similar platforms), but if you want to know how it works it requires a bit of orchestration tools to help you. To describe the steps I'll be using the following tools:
Docker (what is docker?)
Ansible (Use Cases and How it works?)
Jenkins (What is it and Why to use it?)
"There are many other combination of tools that you can look at, but this should give you an idea"
Now that we have the tools, I'll try to describe the deployment pipeline with a very basic use-case.
Step I "Ideally" - Creating a docker image for your nodejs application.
What generally everyone suggests is that you create a docker image of your application. Then save this image on docker-hub. How this will help you is that, now your nodejs application is contained inside a docker image which makes it independent of the Host and can be deployed anywhere you want.
To create this image all you need to do is create a Dockerfile, which is described in the in the link I've shared.
Step II "Ideally" - Creating an Ansible playbook to mimic the setup steps of your application.
Ansible playbooks are basically used to automate every manual process that you would need to do in order to setup-deploy-run your application. This decreases the need to run even trivial tasks like "slc build".
Step III "Ideally" - This is where we get to the UI stuff
By using Jenkins, you are given a UI which will help you configure tasks that can be combined with Github hooks and trigger the deployment as soon as you make a commit. This is explained in more details in the link shared.
So to summarize, This is what goes on at back to some extent, in order to automate the build and deployment of your application using UI. I hope this serves as a good starting point to achieve your requirements, and also in case you want skip these steps in the start, you could always go with Codeship or similar other tools to help you with the steps that you've mentioned.
I'm trying to follow this https://devcenter.heroku.com/articles/platform-api-deploying-slugs?preview=1 to create a slug of my node app and deploy to heroku. Given that heroku has a nodejs buildpack built into it I can't help thinking there must be a way to do so without including the node runtime as recommended, but it's not easy to find out how in the platform api docs.
Anyone have an ideas?
you can also create slugs programmatically using the Build API. See these guides
Building and Releasing using the Platform API
Programmatic builds on Heroku
This is also mentioned in the intro to the article you mentioned, but I'll make that clearer.
Feel free to get in touch at friis#heroku.com if you have any questions about how to use this.