Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Structure #55

Open
PandelisZ opened this issue Mar 15, 2017 · 4 comments
Open

Project Structure #55

PandelisZ opened this issue Mar 15, 2017 · 4 comments

Comments

@PandelisZ
Copy link
Member

PandelisZ commented Mar 15, 2017

Currently it looks a little like this

|auth
|bin
|db
|scripts
|test

I'd like to make it something like

|scripts/ (or lib)
| .. |auth/
| .. | db/
| .. | etc/
|tests/
|bin/
For general readability and ease of imports later on via an optional scripts.js in the root of scripts/

Discuss..

@PandelisZ
Copy link
Member Author

Oh this is helpful,

http://stackoverflow.com/questions/5178334/folder-structure-for-a-node-js-project

@alexwileyy
Copy link
Member

alexwileyy commented Mar 15, 2017

@PandelisZ don't see the need for things to be in a scripts folder, however I do like the way the StackOver flow suggests:

| models
  | user.js
  | events.js
  | announcements.js
  | ...
| views
  | dashboard
  | admin
  | ...
| public
  | js
  | css
  | img
  | ..
| controllers
  | index.js
  | admin.js
  | send-text.js
  | ...
//Additional folder structure I think could be useful
| tests
  | tests...
| middlewares
  | s3.js
  | twillio.js
  | texting.js
  | authentication (example - passport reality)
  | ...

I like the scripts being placed in the middleweare folder as that's what they technically are, we get a request, put it through that, then return a result.

The above is a common project structure that i've been used in several production products. Up for discussion but I think the above cleans things up a lot and sections purpose to folders 😄

@PandelisZ
Copy link
Member Author

Yeah, a middleware folder sounds good. Are middleware and lib an interchangeable title?

I'm asking because I'm not 100% familiar with project structures

@alexwileyy
Copy link
Member

Yeah I'm fairly sure they are, a lot of structures technically are the same just use different names :)

I've seen the above structure used quite a bit though, we can implement it once these hackathons are over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants