Oldie totpenet
- include the CMS, advertise it and name it "totpenet"
- user roles: client | admin
- score keeping
- ...
- game/s
- chat
- notes / lists
This monorepo uses uses Turborepo (from Facebook) and Yarn as a package manager. It includes the following packages/apps:
host-tpn: a React.js app created with Vite- 1
ui: a stub React component library shared by thehost-tpnapplication - 1
eslint-config-custom:eslintconfigurations (includeseslint-config-nextandeslint-config-prettier) - 1
tsconfig:tsconfig.jsons used throughout the monorepo - 1 named
store: localStorage persisted store withZustand& suport for React's nativeContext API - 1 for managing general website settings:
theme, language, authentication - 1 for working with Google Firebase
firebase_package
This turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
To develop all apps and packages, run the following command:
cd totpenet
yarn install
yarn dev
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd totpenet
npx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:
npx turbo link
Learn more about the power of Turborepo:
. . .
Set up the monorepo with turborepo: npx create-turbo@latest
Turborepo will cache localy by default. For an aditional speed boost, enable Remote Caching with Vercel:
npx turbo loginnpx turbo link
(to disable Remote Caching run npx turbo unlink)
yarn install
Test that everything is good and your new monorepo runs as expected: yarn run dev.
You should be able to access hhttp://127.0.0.1:5173/.
yarn [script] --scope=[name] where name is the 'name' from package.json. This will only execute the script for the selected package.
In the terminal navigate to /packages and create folder named store. Inside folder store:
yarn init -yyarn add zustandyarn installto install the dependencies- create a file (custom hook) named useStore.ts and add the store details specific to zustand
- create a file index.ts and add the export options
(apparently zustand allows use of redux toolkit by using devtools. TODO: test this vs. implementing Redux toolkit without Zustand)
dev++
To build all apps and packages, run the following command:
cd totpenet
yarn run build
Using Vercel for hosting, SSL & automatic deployments.
I've already set up my account with Vercel to automatically deploy on every update on git repo branch main.
package hoisting - strict management of versions & imports