Skip to content

Coding Standards Demo 3

Byron Pillay edited this page Sep 3, 2026 · 1 revision

Frontend

File Structure

frontend/
├── public/ # Next.js application
├── src/ # src
│   ├── app/ # Pages
│   │   ├── (auth)/ # auth
│   │   │   ├── landing/ # landing page
│   │   │   │   └── page.tsx
│   │   │   ├── login/ # login page
│   │   │   │   └── page.tsx
│   │   │   └── register/ # register page
│   │   │       └── page.tsx
│   │   └── (sidebar)/ # any page located n sidebar
│   │       ├── admin/ # admin page
│   │       │   └── page.tsx
│   │       ├── dashboard/ # Dashboard page
│   │       │   └── page.tsx
│   │       ├── case-page/ # case page
│   │       │   └── page.tsx
│   │       ├── workbench/ # workbench page
│   │       │   └── page.tsx
│   │       ├── help/ # help page
│   │       │   └── page.tsx
│   │       └── layout.tsx
│   ├── assets/ # Icons, fonts, etc 
│   ├── components/ # Reusable components
|   |   ├── commons/ # Larger components
|   |   └── ui/ # Small atomic components
│   ├── hooks/ # Custom react hooks
│   ├── styles/ # CSS and stylings
│   └── types/ # Custom interfaces/types to used
├── .gitignore
├── eslint.config.mjs
├── next.config.ts
├── package.json
├── postcss.config.mjs
├── README.md
└── tsconfig.json

Naming conventions

  • camel case used for everything
  • Constants in capital letters

General practices

  • Opening curly braces must not be on a new line

Coding Languages

  • TypeScript

Backend

File structure

Backend/ 
├── app/
|   ├── api/        #fastapi routers
|   ├── core/       #cross cutting concerns that all modules require handled here (config.py, security.py etc...)
|   ├── database/   #everything for the PostgreSQL
|   ├── ai/         #Where the best trained ai model goes
|   ├── training/   #Where the code to train the different ai model goes
|   ├── tests/      #pyTest suite
|   └── auth/       #authorization logic here
├── requirements
|   └── base.txt
├── DockerFile
├── docker-entrypoint.sh
├── init_db.py   # A script to initialise the first user that go into the database using the .env
└── .dockerignore

Naming Conventions

  • Variable: Are up to the developer.

  • Functions: Are to match the regular expression ^[a-z_][a-z0-9_]*$. // Which is just snake case

  • Classes: camel case

Formatting

If a method has three or more parameter than the parameters are to start on a new line. e.g:

func(
 parameter1,
 parameter2,
 parameter3,
 parameter3
)

If the developer uses json the same rules apply. If the developer uses the HTTPresponse and HTTPException they must be formatted like:

raise HTTPException(
    status_code=400,
    detail="Could not verify PDF security. File rejected."
)  

The indents are tabs not spaces.

Coding Languages

  • Python

Clone this wiki locally