This is the client app of superyard
This project is generated by Vite
To run this app locally, you must:
- Setup MySQL with appropriate db schema;
- Install Go;
- Compile and run subscription-api;
- Compile and run superyard
- Run this app
npm run dev
.
Or you can use mockjs to build a mocking backend service.
Pay attention:
- Never touch the
index.html
file unde project root. This file is generated. Instead you should edit files underscripts/template
file and then runnpm run html-dev
to update this file. - To upgrade bootstrap used in the
index.html
, update it in thepackage.json
and then runnpm run html-dev
.
Run npm run publish
command, which will generate build bundle.
By default, vite build
will generate a production bundle for js and css. It will also copy index.html
file into dist
. However, the URLs for js and css will probably not what you want in a production envirionment. scripts/lib/deploy.ts
file provides a prependAssetsUrl
function to modify these URLs with JSDOM.
The npm run publish
performs these steps:
- Run
npm version <major|minor|patch>
to increase version. - Run
vite build
to generate production bundler. - Run
npm run deploy
to- Add a prefix to each JS and CSS URLs in
dist/index.html
file and save it asdist/next.html
. - geenerate a version file based on package.json field, then save it as
dist/client_version_reader
- Copy
dist/assets/*js,css
files to SVN - Copy
dist/client_version_next
to the root ofsuperyard
- Copy
dist/next.html
tosupyerad/web/template
directory.
- Add a prefix to each JS and CSS URLs in
- In backend project
superyard
, commint the updated files and then add a new version tag.
Then you should commit SVN and rebuild Go binary in Jenkins.
Folder layouts on my machine are as follows:
$HOME
|-- svn-online
|-- ft-interact (SVN repository)
|-- GolandProjects
|-- superyard (the backend project)
|-- superyard-react (thie project)
To copy production files into different folder structure, modiy scripts/deploy.prod.ts
to suit your needs.
dev
for local developmentbuild
generated production html, js and css intodist
directoryhtml-dev
updateindex.html
filedeploy
modifieddist/index.html
by chaning js and css urls to production ones, and then copy js, css, and html to respective folders.publish
Runbuild
anddeploy
commands sequentially.