Closed javidgon closed 10 years ago
BTW, my motivation is to be able to reproduce https://github.com/bookio/client/issues/2
I passed the question to @meg768, but you cant run the client/server without accessing the shared database. This is no big problem though, the data there is not "sacred" :)
Yes, make www
does copy the entire site to www.bookio.com/booker
. However, it requires some credentials to be on the server. Run the cat
command on line 7 in makefile
to enable your computer to upload files without specifying the password.
make css
is used to compile all LESS files into CSS. So, after any change in a LESS file, this command must be run. You may also use less.app
och CodeKit
to compile the files in the background.
make core
combines all common files into js/core.js
. This is to speed up load time. See the makefile what files are included. Basically, it combines jQuery, jQuery Mobile and other libraries into a single file. This file should also be compressed but this is currently disabled for debugging reasons.
Mostly, I run the client directly to http://bookio.herokuapp.com
, but sometimes I run a local rails server. This requires a change in js/gopher.js
. See lines 9-10 in that file. I know this is not a good solution so I am open for suggestions.
As @joakimbengtson pointed out, currently we only have one shared database and running with a local rails server does not resolve this. Maybe a solution would be to have two apps on heroku
, but heroku
must have support for this in some way. I have not spent time figuring this out yet.
This is an inconvenient. If I understood properly, in order to test your "local" backend you modify the remote client (by changing the backend "address" to point out to your "local backend") and "deploy" it again to heroku, right?
With this approach it's not possible to work two different people at the same time. The problem about shared database
that you mentioned is not a big issue as I see, we always could dump
this database into a local one, and change some settings in our local projects. Am i wrong?
So, wrapping up, I think we should first be able to run
both projects (client
and server
) locally, so we can work in parallel efficiently. If you want, I can focus on that this weekend, but I'll probably need some guidance regarding the client
project as i'm not sure what currently prevents it to work on different environments (scripts
, conf
...?).
What I did locally was to update the javascript to point at localhost. Then inside the client directory I start a small webserver serving that directory like: python -mSimpleHTTPServer 8000
I guess there are similar small webservers you can instanciate from like ruby: http://stackoverflow.com/questions/3108395/serve-current-directory-from-command-line
I think php also has built in development webserver that you can start.
2014-01-25 José Vidal notifications@github.com
This is an inconvenient. If I understood properly, in order to test your "local" backend you modify the client (changing the backend "address" to point out to your "local address") and "deploy" it again to heroku, right?
With this approach it's not possible to work two different people at the same time. The problem about shared database that you mentioned is not a big issue as I see, we always could dump this database into a local one, and change some settings in our local projects. Am i wrong?
So, wrapping up, I think we should first be able to run both projects ( client and server) locally, so we can work in parallel efficiently. If you want, I can focus on that this weekend, but I'll probably need some guidance regarding the client project as i'm not sure what currently prevents it to work on different environments (css, conf...).
— Reply to this email directly or view it on GitHubhttps://github.com/bookio/client/issues/9#issuecomment-33285744 .
@javidgon, no, I never upload the client code with the local address. I just open index.html with Safari. To run the server locally (but with the same database) I open Terminal from the server directory and type
rails server
About development and production environments, I found this https://devcenter.heroku.com/articles/multiple-environments
But I have not tried this yet.
@meg768 Ok, so basically you just open with Safari your local client, by double clicking over index.html. What I get when I do that is a page with the bookio logo in the middle, but basically I cannot do much more (there're no links whatsoever). Also, If I open another random page (by double clicking on his html file), It opens without loaded CSS. So I assume I'm doing something wrong :smile:
Do you see any error messages in the log? The login page would normally load when you do this. You can open this window by pressing alt-cmd-I in Safari.
You could also insert a ´debugger;´ command in js/main.html
(or just set a break point) to start debugging.
Basically, the index.html
is the only real page. All other pages are loaded when needed by requireJS
and inserted into the DOM.
Since some of you will do some work on weekends and holidays, I realize I will have to check my e-mail more often during those days. I will try to do that in the future.
Ok, everything seems to work now. It seems like the local web server
I was running was not well configured. Thanks for your help!
Glad you got things working!
I just installed iOctocat on my iPhone. Now I get a push notification on my phone when an issue is created or commented! This will certainly reduce my response time :)
I cloned both repositories locally. The
server
works fine without problems, but I'm not sure how should I execute theclient
in order to use the local server. I did trymake core
,make css
andmake www
, but this last one tries to access to some external machine, so I suppose that it tries to deploy it... (I stopped at that time cause I didn't want to mess up things).However, I assume there must be a way for the local client to "consume" the local "server". So what am I doing wrong?