yotamN
yotamN

Reputation: 771

Express and Angular directory structure

I want to build a website with Express and Angular (no SQL) so I started wondering what is the right structure for this kind of app.

For Angular there is a directory structre I really like from here:

app/
----- shared/   // acts as reusable components or partials of our site
---------- sidebar/
--------------- sidebarDirective.js
--------------- sidebarView.html
---------- article/
--------------- articleDirective.js
--------------- articleView.html
----- components/   // each component is treated as a mini Angular app
---------- home/
--------------- homeController.js
--------------- homeService.js
--------------- homeView.html
---------- blog/
--------------- blogController.js
--------------- blogService.js
--------------- blogView.html
----- app.module.js
----- app.routes.js
assets/
----- img/      // Images and icons for your app
----- css/      // All styles and style related files (SCSS or LESS files)
----- js/       // JavaScript files written for your app that are not for angular
----- libs/     // Third-party libraries such as jQuery, Moment, Underscore, etc.
index.html

For Express I don't really no where it should be because I have no a lot of experience with Express, where can I put express with the correct structure.

Upvotes: 0

Views: 241

Answers (1)

cgcgbcbc
cgcgbcbc

Reputation: 549

If your express backend acts as an api server, you can simply put it with app's parent folder side by side, i.e.

backend/
----gruntfile.js
----express.js
----router/
----package.json
----node_modules/
frontend/
----app/

Upvotes: 1

Related Questions