Gavin Li Business Systems Build and Testing November 2025
A React component library with automated code quality checks. Built on top of Assignment 12, this adds Husky pre-commit hooks, ESLint, Prettier, and GitHub Actions CI/CD. Everything runs in Docker on port 8018.
- React + TypeScript
- Styled Components
- Storybook
- Prettier & ESLint
- Husky (git hooks)
- Jest (testing)
- Docker + Nginx
- GitHub Actions
git clone https://github.com/gli58/Coding-Assignment-13.git
cd Coding-Assignment-13
npm installnpm start # dev server on localhost:3000
npm run storybook # component docs on localhost:6006npm run format # auto-format code
npm run lint # check for errors
npm test # run testsHusky runs checks before every commit:
- Prettier formatting
- ESLint linting
- All tests
If something fails, commit is blocked. Just fix the issues and try again.
git commit -m "your message"
# hooks run automaticallyEvery push triggers CI workflow:
- Install dependencies
- Run ESLint
- Run tests
- Build app
Check the Actions tab on GitHub to see results.
Build and run:
docker build -t li_gavin_coding_assignment13 .
docker run -d --name li_gavin_coding_assignment13 -p 8018:8018 li_gavin_coding_assignment13Open http://127.0.0.1:8018 to see Storybook with all components.
Stop:
docker stop li_gavin_coding_assignment13
docker rm li_gavin_coding_assignment13- Button
- Label
- Text
- Card
- Dropdown
- Radio
- Image
- HeroImage
- Table (with Header, Row, Cell, Footer)
All components have tests and Storybook docs.
npm test -- --watchAll=falseResults:
- 14 test suites
- 27 tests total
- All passing
Hooks not working?
npm run prepareCommit blocked?
npm run format
npm run lint:fixDocker fails? Make sure tests pass locally first.
Port 8018 in use?
# Windows
netstat -ano | findstr :8018
# Mac/Linux
lsof -i :8018.
├── .github/workflows/ci.yml # CI config
├── .husky/pre-commit # git hook
├── src/lib/components/ # all components
├── .eslintrc.json
├── .prettierrc
├── Dockerfile # port 8018
├── nginx.conf
└── package.json
- Can't commit without passing checks (by design)
- Docker build includes all quality checks
- Storybook shows interactive component demos