Introduction
This directory contains the technical details for the digital twin website developed by Lakee Sivaraya. Use the sidebar to navigate to the different sections of the documentation.
Note on TypeScript
The entire website is written in TypeScript. It is important that you have a good understanding of TypeScript. TypeScript is very strict and does not allow you to write sloppy code (like Python does), so it is important that you write proper, clean code with error checking as you go along or else TypeScript will complain. The amazing thing about TypeScript is that it basically makes it impossible to write bad code with bugs in it, so it is important that you take advantage of this. It is very very important that you use an IDE with linting as without it you will not see the errors and warnings that TypeScript will throw at you until build time. I suggest using VSCode however if you use Vim or macs you can install a plugin to do the linting for you.
Pre-requisites
Make sure you have node
and npm
installed on your machine. You can check this by running the following commands in your terminal:
node -v
npm -v
If you don't have them installed, you can download them from here (opens in a new tab).
Tools
We are using the Next.js
framework in Typescript to build the website (using Pages Router). It is imporant that you have a good understanding of how Next.js works. You can read the documentation here (opens in a new tab) (
important: make sure read the docs for the Pages Router and not the App Router).
Important: make sure read the docs for the Pages Router and not the App Router
The entire repository is a Turborepo (opens in a new tab) project. Turbo is a tool that allows you to build your website in a modular way. You can read more about Turbo here (opens in a new tab), it is important that you have a good understanding of how Turbo works. Turborepo allows us to cache our packages and builds our website faster.
Install the Turbo CLI by running the following command in your terminal:
npm install -g turbo
We also use the following tools:
- Tailwind CSS (Styling) - https://tailwindcss.com/ (opens in a new tab)
- Radix UI (Design System) - https://www.radix-ui.com/ (opens in a new tab)
- Tremor (Dashboard Components) - https://tremor.so/ (opens in a new tab)
It is assumed that you have a good understanding of how these tools work particularly React using functional components and hooks.
Fork & Clone
Please fork the repository on github and clone it to your local machine. Clone the repository by running the following command in your terminal:
git clone https://github.com/{username}/digital-twin.git
Installation
Firstly you need to have the pnpm
package manager installed. You can install it by running the following command in your terminal:
npm install -g pnpm
Then clone the repo and install the dependencies:
pnpm install
Running the website
You either run the website from the root directory or from the web
directory.
To run the website in development mode, run the following command:
pnpm dev:web
To run the website in production mode, you need to build the website first:
pnpm build:web
Then run the following command:
pnpm start:web