Platypus is an e-commerce platform designed to streamline the entire online shopping experience. The platform offers a suite of features for both merchants and buyers. I have led front-end development projects and have been recognized as an Outstanding Contributor on the team.
- Node.js v20+
- npm
- Next.js 14 with TypeScript
- Tailwind CSS
- Zustand
- Axios
- Zod
- Shandcn UI
- Daisy UI
- Husky
- ESLint
- Prettier
- Jest
Clone the project
git https://github.com/raybagas7/platypus-marketplace.git
Go to the project directory
cd platypus-marketplace
Install dependencies
npm install
Environment variable
cp .env.example .env
follow the .env.example and fill every variable and base api url with your needs
Start the application in Development mode.
npm run dev
(Web app will run on port 3000 by default)
To build and start the application you can run this command
npm run build
npm run start
(Web app will run on port 3000 by default)
When you want to continue developing this application, follow these steps:
-
Initialize Husky: Run the following command to initialize Husky:
npm run prepare
Husky will be initiated, and every time you commit, Husky pre-commit will intercept the commit and run tests before it is committed.
1.Prettier Test: Husky will run a Prettier test. If it fails, you must fix it manually by following the Prettier style or by running:
npm run write-format
2.Linter Check: Husky will perform a linting check. If the linter fails, there will be information in the terminal, and you must fix it manually.
3.TypeScript Type Checking: Husky will check TypeScript types. If it passes, the commit will be completed if you have already defined the commit message. If not, you will need to write the commit message.
4.Build Test (Optional): Additionally, there is a build test included in the pre-commit file. This test is currently commented out to avoid slowing down the development process, as the build process may take some time. If you want to run the build test, uncomment the script in the pre-commit file.
This project is covered by two types of tests: unit tests using Jest and end-to-end tests using Cypress.
To test the application, you can run unit tests with Jest. To run the tests once, use the following command:
npm run test
If you want to develop more or perform continuous testing, you can run the tests in watch mode:
npm run test:watch
If you want to add more test case, the test directory is on root directory