Structure
The structure is very simple:
Backend-server/
.... index.js
.... package.json
.... api/
........ routes.js
........ database.js
........ XXXX.js
.... tests/
........ config.js
........ jobs_specs.js
index.js is the main file. It creates an express server, loads the required package.
routes.js is the file where the magic happens. It loads every other file of the API and creates the routes or endpoints of the API.
database.js is the database connection file that is used by every other files that execute queries.
XXXX.js represents a typical object file of the API. An object is created for each table. Each function has several queries in various functions. Some routes are then mapped to the object's function.
See the Testing tab for more information about testing.