How to structure my project?

I’m about to start voting app, this will be first big project where I will have views, styles, libraries, users, polls, DB with different tables, etc.

Instead having all my source code in one file (server.js), how should I organize my project?

There’s no best way - just do something that suits the structure of the way you envision the parts of the app and keeps your source code in nice small chunks.

I didn’t use a frontend framework, which simplifies the structure.

Mine looked something like this:

  [contains ejs templates]
  [contains ejs partial templates]
[contains all my express routes]
[contains my database queries / functions used by routes]
1 Like