All the codes of GAGU are in the same repository, which consists of three parts:
gagu
|- gagu-back-end
|- gagu-front-end
|- gagu-website
Only the pnpm-lock.yaml file is uploaded in the project, so using pnpm instead of npm to install dependencies can ensure that our running results in the development environment are consistent.
# install dependencies
pnpm i
In order to minimize the size of the package, after the project became independent, the originally used UI component library BlueprintJS was gradually removed and replaced with SemiUI which can be loaded on demand.
Windows wallpapers and MIUI V5 icons were also removed, and the monochrome icons were replaced from Carbon Design System to RemixIcon. Almost all icons are used from RemixIcon, even the icons of internal Apps are selected from it and edited in Figma.
The whole still uses the combination of React + TailwindCSS, and the built size is very small.
# dev
$ cd gagu-front-end
$ pnpm start
After comparing several common frameworks during model selection, the reason for finally choosing NestJS is very simple, because it adopts the module syntax of ES and has good support for TS.
In addition, considering that the front-end and back-end codes will be placed in the same repository, when switching contexts, a unified code style can more or less reduce switching costs.
# dev
$ cd gagu-back-end
$ pnpm start:dev
Have a try with Astro, first time using it.
# dev
$ cd gagu-website
$ pnpm start
version field in ./package.jsonGAGU_VERSION in ./gagu-back-end/src/shared/utils/constant.util.tsSync production dependencies in ./gagu-back-end/package.json to ./package.json
Run build script npm run build:npm, refer to ./build-npm.sh
Dry run publish, update package size info and Changelog date, publish to NPM
The binary version needs to complete the previous built step above
Install the dependencies in ./package.json, yes, this is a bit redundant, this is caused by the original decision to put the three parts in the same repository, fortunately, it is not a big problem
Execute npm run build:pkg in the gagu directory, you need to install Vercel/pkg globally in advance npm i -g pkg
The built content will appear in ./pkg
There are also many dependencies used throughout the project:
@tanstack/react-virtual axios i18next chalk crypto-js eslint express express-zip github-markdown-css gm lodash-es luxon motion minimist music-metadata node-disk-info piexifjs prettier qrcode.react react-i18next react-markdown react-photo-view react-rnd recoil rehype-raw remark-gfm thumbsupply
My workload would be enormous without them and I am very grateful to them.