question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey I was just curious what a good file structure would be for use with Studio and an Express API. I’m thinking something like this:

- services
    - config-service.js
    - user-module
        - index.js
        - create-service.js
        - update-service.js
        - remove-service.js
    - auth-module
        - index.js
        - signup-service.js
        - login-service.js

- api
    - user-routes
        - index.js
        - create-route.js
        - update-route.js
        - etc.
- app
    - index.js

Under the services folder, they are group by Studio module’s if appropriate, or just standalone files if the service doesn’t need a module. Then each api route would have its own file, which would then require its associated service.

Thoughts? Also, what have you guys done?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ericholiveiracommented, May 11, 2016

Oh, thx i will add it tonight. Anyway you can see it here: https://medium.com/adopting-microservices-architecture/nodejs-microservices-from-zero-to-hero-pt2-72fbb2a1b1c4#.dahyaklx5

(I will keep the issue open for a while if anyone wants to comment something on this )

0reactions
ericholiveiracommented, May 11, 2016

Something like this (attaching this, because i only have my company code, so i prefer to avoid printing it) , on express.js i initialize express to use on the routes captura de tela 2016-05-11 as 15 40 39

Read more comments on GitHub >

github_iconTop Results From Across the Web

File Structure : Broad Institute of MIT and Harvard
File structures are not fixed entities, but rather build a framework that communicates the function and purpose of elements within a project by...
Read more >
5 Tips To Create An Organized File Structure Like A Pro
One folder structure best practice is to avoid having folders that compete with one another. Try not to create folders with overlapping ...
Read more >
Programming 101: File Structures - Medium
Generally speaking, a file structure is how you organize information on your computer. Regarding programming, the Broad Institute of MIT and Harvard ...
Read more >
file structure - SAA Dictionary
file structure. n.The manner in which data and other objects are organized within a file.The manner in which files are organized in a...
Read more >
Understanding File Structure | Computerworld
Understanding file structure. is helpful when transferring multiple HTML and graphics files to your. server and when referencing these files in your code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found