8
structure folders
Ratstail91 edited this page 2023-12-24 02:35:03 +11:00

Folder Structure

Each repository in this project has a specific folder structure that I find to be the most convenient. Here, I'll explain it.

root/
  - client/
    - pages/
      - accounts/
      - administration/
      - panels/
      - static/
      - utilities/
      - app.jsx
      - dashboard.jsx
      - homepage.jsx
      - not-found.jsx
    - styles/
  - common/
    - utilities/
  - server/
    - database/
      - models/
        - index.js
      - index.js
    - server.js
  - tools/
    - create_database.sql
  - test/
  - .envdev
  - .gitignore
  - LICENSE
  - README.md
  - configure-script.js
  - package.json
  - webpack.config.js

These are the most common folders and files between the core project and the microservices. Some, like client/ are only present in the core repo, while others not shown, are only present in their specific server/ directories (such as server/auth/ in the auth-server).

Client

This folder structure is only in the core repo, and provides the client-facing React code. Most of the components are under client/pages/.

Common

The common/ directory is used for common files shared between client and server directories.

Server

This directory is used by all repos, but the core repo has only a placeholder server that serves the client code at the time of writing. server/database and server/database/models hold the database information, while repo-specific directories can also be found here (such as server/news, server/auth and server/chat). server/admin may occasionally be found here as well.

Test

test/ contains tools for testing the services.

Tools

tools/ contains miscellaneous scripts intended for various different uses.

Root

There are also a number of files in the root directory, which are fairly common between services. These cover things from legalities, to basic documentation.