Now you can run the project.
Electronic Manager of Public Procurement Files of the General State Administration.
Clone this repository:
git clone https://github.com/Lemoncode/gex-front.git
Then install dependencies with:
cd gex-front
npm install
When we install the project we can see that when we finish installing the dependencies the mock server dependencies are installed with the postinstall script.
./package.json
"scripts": {
"predev": "node ./create-dev-env.js",
"postinstall": "cd mock-server && npm install",
"dev": "run-p start:vite start:mock-server",
"start:vite": "vite",
"start:mock-server": "cd mock-server && npm run start",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"prepare": "husky install"
},
Checking again at the ./package.json file we can see that we are running two commands in parallel. The first one is the Vite server and the second one is the mock server.
We have also created a script for when we start the project if the environment is not created it will create it. This is done by the script predev
.
./package.json
"scripts": {
"predev": "node ./create-dev-env.js",
"postinstall": "cd mock-server && npm install",
"dev": "run-p start:vite start:mock-server",
"start:vite": "vite",
"start:mock-server": "cd mock-server && npm run start",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"prepare": "husky install"
},
Now we can run the project with:
npm run dev
Open your browser and go to http://localhost:5173 (if this port is busy it will be changed to the next available port)