Running an open-source project on heroku - node.js

I am trying to run HabitRPG on Heroku because I don't have root access in the machines in my school's library to install the dependencies.
The wiki to HabitRPG gives instructions on how to run it on a localmachine, but does not talk about running it on Heroku. I understand that HabitRPG used to run on Heroku, but lefnire had to move it.
What am I facing here? How much work am I looking at to run on Heroku? Have they not given instructions to deploy it because they don't want people to? Any help would be appreciated.

Related

Angular Universal - Deploying to AWS Elastic Beanstalk

I have been trying and failing for over three days now to get this working, and am growing increasingly frustrated with my own lack of understanding on the topic - so this is my search for an answer that I've not yet found.
I am using Angular 9.x and Angular Universal 9.x and am unable to work out how to deploy this to Elastic Beanstalk on a server running node. There are zero tutorials that explain how this should be done, as they are all aimed at those wanting to use Lambda on AWS. If someone could please point me in the right direction that would be great. I run npm run build:ssr --prod, and get the following in my dist folder:
[
I have tried deploying this folder by uploading it zipped, as well as tried eb deploy with my whole app - but all of these result in errors like the following (for eb deploy method)
> blush-front-end#0.0.0 start /var/app/current
> ng serve
sh: ng: command not found
Could someone please point me in the correct direction?
I struggled for months too because of the lack of tutorials online on how to deploy Angular Universal to AWS Elastic Beanstalk. And you will now be very happy to know how easy it is.
First, run the command npm run build:ssr to build for production.
Inside the dist folder, you will probably find a folder with your project name. Inside this folder you will find a "browser" folder and a "server" folder. Inside the "server" folder it is the main.js file.
Your setup might be slightly different, but you will be able to adjust this explanation to your situation after you read my entire answer.
Zip the dist folder.
Let's now configure the environment in AWS Elastic Beanstalk.
1) When you create an environment in Elastic Beanstalk, choose "Web server environment", and then on Platform branch config, choose the last option: "Node.js running on 64bit Amazon Linux". This is a very important step, since this is the only option that will enable you to configure the Container Options.
2) On the Application code, choose "Upload your code" and upload your zip file.
3) Click on Configure more options
4) Click on the Edit button on the Software box.
5) On the Node command field,type node dist/yourProjectFolderName/server/main.js
That's it!! Save and create your environment. Your app will work now. :-)

Deploying nodejs to amazon

I'm new with NodeJS and have worked lately with a project which run in NodeJS. This project is actually going to be put online. The server runs on Amazon and is now running an "old" version of the project.
I've had a very fast manual how to deploy, but I didn't get it.
What I got:
Install cygwin (already did)
tar the project without the .git directory in cygwin
Upload the tar to the server in cygwin
Restart the application
Does anyone know a good tutorial or can someone explain to me how I do best? I know that there is no auto deployment.
I recently setup a nodejs application on AWS, the tools that i used was
nginx server for handling my http request, as starting nodejs in terminal is very problematic.
pm2 for auto restarting nodejs in case if error occur
git for version control, maintained a repo of my code and clone it to my AWS server
SSH for remote login
Hope this helps :)
I'm actually in the same process of deploying a node server via amazon aws. I personally started with watching some Videos to get a clue about AWS EC2, S3 and so on. The following link is a good start for understand some conecpts:
https://www.youtube.com/watch?v=jLVPqoV4YjU
afterwards it is best to read the documentation (better not all of it just the things you need and want to understand).
I also use pm2, git and maybe will use nginx also as reverse proxy ...

How to use simple npm-install in Openshift?

I'm trying to use cute-files on my openshift account
https://www.npmjs.com/package/cute-files
I know node.js works as I did in localhost:3000 but not as expert,
I'm ended up with http://cutefiles-powerupware.rhcloud.com/ that's not I'm looking it. It should be Cute-files app as start.
I did PuTTY to access terminal to do npm-install but no luck due to permission.
The problem is... I cannot understand how openshift works, I need to know how to access console to do npm-install then, execute "$ cute-files", alternativley I've used Git to commit and push, the files are updated...I got no results... I've spent like 6 or 7 hours, Openshift has been very complicated me to use, can anyone explain how to install and execute simple node.js app in openshift?
It's not like you can access Openshift and run any command. Openshift isn't a simple hosting or vps service, it's a PaaS. That means they offer you an environment to run certain services in particular as you demand.
When you create an app it's bound to a git repository which when pushed will be deployed to openshift.
About your application being deployed and runned, it's NOT about node.js running in port 3000. Openshift has some default application file names and port to expect.
So, working in a local clone of such repository you might perform the npm install command, that will download the node_modules folder to be there.
How to do all this?
First you should install rhc in your system.
Manage to clone any of you applications via rhc.
Make changes, and do git.
Those changes may include doing npm install getting your dependencies.
When doing git push, expect the changes to be deployed.
You really should read this guide.

How to build MEAN stack development environment with GitHub?

I am newbie to MEAN stack building MEAN stack development environment for start-up project(web service). Below is a topology where I build up MEAN stack environment.
topology image link: http://147.46.215.116/Picture1.png
Remote PC which developers will use Sublime Text(Code Editor) to code. Git client, NodeJS, its plugins and other stuffs(bower, grunt-client and so on...) are also set on their PC.
I made a Git-hub repository (forked from https://github.com/linnovate/mean.git) for SCM. I also built Jenkins server for CI. Web server is on cloud(Digital ocean).
When I started sample MEAN web service on each machine, It worked like a charm.
After typing following commands, I could see the empty sample page at localhost:3000.
git clone https://github.com/myname/mean.git (which is forked from ~/linnovate/mean.git)
cd mean && npm install
grunt
Here is where my trouble started.
At remote PC, I modified a js source a little bit, and I pushed this to the git-hub repository. It seemed that, by setting .gitignore, MEAN stack didn't let whole project files pushed to git-hub. Instead, it uploaded small part of the project, requiring developers 'npm install' when they git-cloned the project.
One newbie developer git-cloned this project to his remote PC. After 'npm install'ed, however, it didn't work. This is what came up instead.
[4mRunning "clean:0" (clean) task[24m
[4mRunning "jshint:all" (jshint) task[24m
[1m Gruntfile.js[22m
1 |[90m'use strict';[39m
^ Use the function form of "use strict".
9 |[90mmodule.exports = function(grunt) {[39m
^ 'module' is not defined.
11 |[90m if (process.env.NODE_ENV !== 'production') {[39m
^ 'process' is not defined.
12 |[90m require('time-grunt')(grunt);[39m
^ 'require' is not defined.
......
Here's my question.
Is it right to 'npm install' whenever I git-cloned/pulled the project?
How do you guys usually develop web service project w/ MEAN stack and Git?
I wonder whether I misunderstood mean stack development(w/ git) process.
If it is, why doesn't it work?
I also feel confused while using Jenkins. If 'npm install' should happen whenever builds,
Should 'npm install' process occur in Jenkins server (and output files goes to web server)?
or in web server (after just source files are transferred to web server)?
a grass-hopper waits for you guys advice. please help-.
RTFM
How to install MEAN.js http://meanjs.org/docs.html#getting-started
How to deploy via Git http://krisjordan.com/essays/setting-up-push-to-deploy-with-git
If you do now understand how to use Git and MEAN.js what the reason to make things worth and to use Jenkins?

Deploy sails.js to Windows Azure Website

I'm following this guide on installing a node.js application on Azure:
http://www.windowsazure.com/en-us/develop/nodejs/tutorials/create-a-website-(mac)/#header-0
Is it possible to get a sails.js app running without having to instantiate a Virtual Machine?
New guide on deploying to Windows Azure:
https://github.com/mdrmuhaimin/sails-docs/blob/b1030c21daf885e6490e1d1f946375a5c8584e4c/Guide:Deploying-Sails-to-windows-azure-linux-vm.md
Also, as I mentioned in the comment above, you don't have to install Sails globally to deploy it-- just clone your app, run npm install, and then forever start app.js or node app.js. See the deployment guide for more info.
As of right now sails requires an npm install -g on the box which would require either a virtual machine or a cloud service with a startup script. The link you are showing if for a deployment model where you don't get any access to manipulate the host since there are many instances running on it.
It would be great if sails could be included inside an app by putting it in the package.json and started up from within the app.
UPDATE - This has changed since the answer was posted. #mikermcneil has an updated answer that reflects the current state.

Resources