structor icon indicating copy to clipboard operation
structor copied to clipboard

Run Structor on Cloud9

Open BenjaminHaos opened this issue 8 years ago • 17 comments

Hi!

I am really excited to try this out and after doing everything i know to do, i still cannot get it running.

I am using the Cloud9 IDE, and have followed the instructions listed in the user guide adjusting things were i believe needed.

My node version is 6.10.3 and npm version is 3.10.10. both were updated before i tried to install structor.

Following the instructions, i was able to show console output;

Structor has been started successfully.
Open in the browser: http://localhost:2222/structor

Cloud9 IDE limits ports so i changed the port in /structor-starter/server/index.js but the console output stayed the same and i was unable to find anything being served. Any hints or comments on how to set the ip and port would be great!

This look awesome and i'd love to get it up and running to give it a try. I normally wouldn't bother dropping an issue but since your instructions called for such action, and because i really want to make this work, here i am!

THANXS!

BenjaminHaos avatar May 04 '17 08:05 BenjaminHaos

Hi @BenjaminHaos!

I didn't try to run the recent version of Structor on Cloud9. But I did run previous versions and it worked good for me.

You should not change server/index.js, there is an option p instead, which tells Structor what port to use.

So, just try to change a line in package.json in scripts section: "structor": "structor" to "structor": "structor -p <SOME_OTHER_PORT>"

BTW, you may add v option into the same string: "structor": "structor -v -p <PORT>" - that will show some debug info when Structor's Webpack found errors while compiling.

Let me know if it does not help you.

Thanks for your feedback.

ipselon avatar May 04 '17 08:05 ipselon

It works!

It seems it requires the VM be run in a public mode vs. private, but that's not the end of the world.

If you'd like, i can get you some documentation on how i set it up? I'll most likely post a script to get it running on Cloud9 so i can repeat it myself later.

Thank You for your response, i am totally excited to try it out!

-B

BenjaminHaos avatar May 04 '17 12:05 BenjaminHaos

@BenjaminHaos, thanks a lot for trying Structor!

If you'd like, i can get you some documentation on how i set it up?

Yes, it would be awesome! Please make a PR or write Wiki page.

Any contribution is appreciated, especially documentation.

Thanks in advance.

ipselon avatar May 04 '17 12:05 ipselon

Awesome!

I just did your "hello-world" tutorial and i find your work amazing! I'd love to return the favor so i'll throw together a "Run Structor on Cloud9" document and get it to you here.

-b

BenjaminHaos avatar May 04 '17 13:05 BenjaminHaos

Run Structor on Cloud9

Prerequisites:

  • An account on Cloud9 (it's free.)

Step 1

Create a basic Virtual Machine. Make sure the privacy is set to public.

step12

Step 2

Just to be safe, update npm and node:

npm i npm -g
nvm install 6
nvm alias default 6

step2

Step 3

Clone the structor-starter repo, install modules, and install structor,

# Clone the repo,
git clone https://github.com/ipselon/structor-starter.git

# dwitch to the cloned directory,
cd structor-starter/

# install Node modules,
npm install

# and install Structor!
npm install structor

step4

Step 3.5

During the install, you will need to choose a directory, or simply press return,

step5

Step 4

Once the above is completed, modify the package.json changing one line from this,

(...)
  "scripts": {
    (...)
    "structor": "structor"
  },
(...)

step6

to this,

(...)
  "scripts": {
    (...)
    "structor": "structor -v -p 8080"
  },
(...)

step7

Note - The -v switch is optional but the -p <port> is needed to run on Cloud9. (8080, 8081, 8082 are available at the time this was documented)

Step 5

Run the command npm run structor in the same directory,

step11

click the link displayed in the console,

step8

choose open,

step9

and, ...

step10

You Are Ready to Go!

You should now be able to follow along with the documentation and get to building some UI!

Please create an issue if the above does not work for you.

BenjaminHaos avatar May 04 '17 14:05 BenjaminHaos

@BenjaminHaos That's awesome! Thanks! I'll put it as a separate chapter in Structor's Guide.

ipselon avatar May 04 '17 15:05 ipselon

Followed the steps above and worked out nicely. Thanks!

iwaldman avatar May 07 '17 17:05 iwaldman

Tried to install ui-next-spkg and got "Installing namespaces. Failed to fetch"

iwaldman avatar May 07 '17 17:05 iwaldman

@iwaldman, Could you check the access from your host to https://github.com/ipselon/mui-next-spkg/archive/master.tar.gz file?

ipselon avatar May 07 '17 17:05 ipselon

Was able to download the file. Is that what you needed to know?

iwaldman avatar May 07 '17 17:05 iwaldman

Yes, thanks. In this case, Structor's server is down, I guess.

ipselon avatar May 07 '17 17:05 ipselon

No worries.

iwaldman avatar May 07 '17 17:05 iwaldman

Thanks for the investigation, @BenjaminHaos. I was trying to work through the create-react-app tutorial for Structor and ran into trouble. I have reproduced your steps exactly with a fresh Cloud9 workspace, and am still getting the dreaded "No application seems to be running!". Webpack certainly builds, and the port is correctly being listened to. I have run the steps freshly on Chrome and Firefox, so no dice there. Have you run into any more issues on some more recent version of Cloud9 perhaps? Anyone else having issues for this simple step?

murnanedaniel avatar Jun 13 '17 17:06 murnanedaniel

@murnanedaniel sorry about the delay. Been really busy.

Not exactly sure what your having problems with. Are you getting the Cloud9 "No application seems to be running" error? If that is the case, you need to open the link shown in the console output. I'll wait on you for a more detailed answer.

BenjaminHaos avatar Jun 24 '17 17:06 BenjaminHaos

I am starting in react, so i don't know exactly what happened, but i can help providing logs, making tests and such.

When i tried the tutorial, cloning from github and npm install, I didn't get the "select folder" prompt, installation ended with no problems, but there were no "structor" entry in packages.json so, i guess somehow the installation script doesn't trigger with this method.

furthermore, later i tried npm install --save @blueprintjs/core structor react and while installation everything seems to work fine, i can't seem to be able to start the app successfully... Maybe for the use of https in c9?

EDIT: I realized that i did all of it in a private workspace, i'm deleting it and making it public later

p4cm4n avatar Aug 05 '17 11:08 p4cm4n

FINALLY FOUND IT!

Everything is exactly the same as @BenjaminHaos described but the line to edit in packaje json must reference port AND host there's the correct code:

"structor": "structor -v -h $IP -p $PORT"

p4cm4n avatar Aug 08 '17 21:08 p4cm4n

Thanks for this help, installing Structor on Cloud 9 is really simple. I have another problem:

  • if I create my component, everything works fine, but when I click Export App or Export Pages, Structor creates routes folder with files, but I also got red floating error message: "Generating the source code: Failed to fetch"
  • if I try to install anything from Structor Market I got red floating error message: "Installing namespaces. Failed to fetch". After that Structor try to reload with no success (hang).

Anyone else experienced or maybe solved this problem? Thanks in advance for any hint.

kosirm avatar Sep 19 '17 11:09 kosirm