Skip to content

Architecture & folders

Marwane Kalam-Alami edited this page Jan 16, 2021 · 22 revisions

Summary

Alakajam is a website powered by a NodeJS server. If you have decent knowledge of modern JavaScript, you should be able to get started quickly. The main techs we use are:

The trickiest part of the sources is the Bookshelf ORM: while it simplifies a lot how database queries are run, it can take some time to get used to.

📜 Alakajam! archeology facts: The website was initially made in pure JavaScript, and used a different templating engine (Mozilla's Nunjucks). This explains some inconsistencies you may find in the code style/quality.

File structure

Name Description See also
client/ Client TypeScript and SASS sources. All the SAAS will be built automatically into a CSS file, same with the TypeScript thanks to Webpack. Don't worry about browser support, Babel will figure things out. Working with client side JavaScript
cypress/ Set of integration tests based on Cypress. We use CircleCI to run these (and unit tests) to detect regressions in the code automatically. Far from extensive, but can catch some regressions.
deployment/ Scripts & files used on the live server.
githooks/ Run the install script inside to make sure the code style is always validated before you commit code.
server/ The entire NodeJS server, handles all the web requests (see Express) processes them, interacts with the database (see Bookshelf (ORM) + Knex (SQL builder)) and eventually renders a page through a template (see Nunjucks). You may find some unit tests in there, powered by Mocha + Chai + Sinon.
server/migrations All files put here will be processed by Knex on startup to upgrade the database tables.
static/ Static assets (pictures, external libraries, etc.)
config.sample.js An example configuration file. The one actually used by server upon launch is config.js (created automatically if it doesn't exist).
Clone this wiki locally