Gollwu / LoLManager

Development of amateur application LoL Manager
Other
3 stars 0 forks source link

File structure #41

Closed Nhacsam closed 9 years ago

Nhacsam commented 9 years ago

I think we will have problems with the file structure and heroku. We need to manage all the application dependency with the same pakages.json in the root directory. I propose this kind of structure :

node_modules/
app/ # serveur code
    app.js
    model/
    controller/
    modules/

config.js
config.js.dist  

doc/ # api documentation
test/ # unit test
fixtures/ # To preload the database
srv_assets/ server assets (uploaded)

Gruntfile.js or Gulpfile.js # script for compiling (launch by heroku at deploy)

LICENSE 
README.md
.gitignore

package.json # Main package.json

front_src/
    index.html
    app.js
    stuff/ # Will be compiled by grunt or gulp
        somescripts.js
        sometemplate.html

www/ # compiled front stuff
    index.html
    favicon.ico
    scripts/
        app.min.js
        vendor.min.js
    css/
        app.min.css
        vendor.min.css
    assets/
        img.png
    fonts/
        fontawesome.ttf
Gollwu commented 9 years ago

What is the problem then?

Nhacsam commented 9 years ago

What if you need angular for front and expressjs for the back ? You will make 2 npm install in the main folder and the server folder ? With 2 packages.json ?

Other oroblem, if you will tell in the root packages.json (the front one) that's the application main js is in server/app/app.js, how to get the index.html ? If not, how to run the server ? ...

Gollwu commented 9 years ago

Sorry that's not something I'm very familliar with but I don't see the problem with 2 npm install and can't they use the same package.json?

I don't see either what is the problem with having the path to the HTML file...

Sorry for my noob-itude :)

Nhacsam commented 9 years ago

Try ti push it or heroku and make both work ;)

Gollwu commented 9 years ago

Or you can just explain it to me

Nhacsam commented 9 years ago

You cant have two url with : GET / Which get the index.html without passing by the server GET /api/player Which will pass by the server to compute the result

The GET / must pass by the node serveur which will return the index.html file. The best way to do that is to have the index.html in a sub dir of the server root directory

qr7hur commented 9 years ago

Hey I think we don't have the prerequisites to fully understand this level of discussion. Can we start again from the basics?

Like: Nhacsam, what are the advantage of having a build system? What are Grunt and Gulp? Do we really need them for our project or do you just think it's interesting for us to know about? Can we combine that with a template engine (like Jade)? Does this system imply pages are generated at server boot, and then clients have to query the server asynchronously to get the dynamic content? What are the advantages of this technique versus serving dynamic pages?

I agree that the current file structure is not suitable from a package.json/dependencies point of view. Just be aware that we did not really think of it beforehand, and that it's cool someone like you offers help on that point.

I do not understand your last comment, and I believe it all depends on the framework/communication model we use. But "without passing by the server" does not really make sense. I assume it means "GET / returns a static file", and "GET /api/player asks the server to do come computations before returning a result". This looks like a RESTful model, right?

Yeah, lots of questions...

Nhacsam commented 9 years ago

I will answer to all your questions with some propositions and maybe a skype today or tonight.

Just 2 little questions to prepare my propositions :

Gollwu commented 9 years ago

"Today or Tonight?" WHY NOT BOTH

qr7hur commented 9 years ago

BOTH! Thx Nhacsam for the skype Tech Talk proposal! Didn't mean to waste your time. I'll try to be available on skype from 11pm (your timezone). Works for you?

Nhacsam commented 9 years ago

Yeah, maybe we will begin without you ^^

Gollwu commented 9 years ago

Issue closed then?