Structure - aalto-grades/aalto-grades GitHub Wiki

Client

Setup for the client was done with Vite. The high level structure comes from the setup and in order for the build process to succeed, public/index.html and src/index.tsx must exist with these filenames.

client/
├── public                  HTML files and other statically served data.
│   ├── favicons            Favicons of various sizes.
│   └── locales             Translation files of the frontend.
└── src
    ├── components          Views and components. Most of the components are in a directory corresponding
    │                           to the view which uses the component.
    ├── context             Local context to store data over multiple views.
    ├── hooks               Custom hooks.
    │   └── api             Wrappers for React Query hooks to make requests to the backend.
    ├── theme               Theme setup and global theme settings for Material UI.
    ├── types               Client specific types.
    ├── utils               Small utility functions.
    ├── App.tsx             A React App component which defines the app's theme and its overall structure (routes are defined here).
    ├── i18n.ts             Configures i18next to handle translations.
    └── index.tsx           Index file which creates the root element. The App component is rendered inside this root.
                                Some global styles are also defined here.

Server

server/
├── docs                    Api documentation
├── mock-data               Mock data for the database
├── src
│   ├── configs             Environment variables, constants, and other configuration variables.
│   ├── controllers         Logic for routes.
│   │   └── utils           Utility functions used by controllers.
│   ├── database            Sequelize and database definitions.
│   │   ├── migrations      Migrations for transitioning database from one state to another and keeping track of these changes.
│   │   ├── models          Model definitions for Sequelize and for querying the database.
│   │   └── seeders         Seeder functions for populating and deleting data from the database.
│   ├── middleware          Express middleware other than controllers, for example error handling and authorization.
│   ├── routes              Declaratively defines routes using Express routers without any logic.
│   └── types               Generally applicable exported types and zod validation schema objects.
└── test                    Server tests
    ├── controllers         Tests for controllers
    └── util                Utility functions for tests

common

common/
├── types       Shared types and schemas for Server and Client
└── util        Shared functions for Server and Client

e2e-tests

e2e-tests/
└── tests       Test cases and utility code