This is a demo website that is currently under development
ACS is built with the following features:
- PostCSS with mantine-postcss-preset
- React
- TypeScript
- Recharts
- Jest setup with React Testing Library
- ESLint setup with eslint-config-mantine
- Amature Cycling Stats API built with NextJS
npm run dev
– start dev servernpm run api
- start mock api server
npm run build
– bundle application for productionnpm run analyze
– analyzes application bundle with @next/bundle-analyzer
npm run typecheck
– checks TypeScript typesnpm run lint
– runs ESLintnpm run prettier:check
– checks files with Prettiernpm run jest
– runs jest testsnpm run jest:watch
– starts jest watchnpm run test
– runsjest
,prettier:check
,lint
andtypecheck
scripts
npm run prettier:write
– formats all files with Prettier
This mock API was created with json-server
. It allows you to define a JSON object inside a .json
file, and will automatically create endpoints based on the shape of the data. Once you create your file and add your JSON object, you run the command below and will be able to call the endpoints as if they were a normal API. You can add multiple resources to a single file to have them available at the same time on the same local host.
JSON-server documentation can be found here: https://www.npmjs.com/package/json-server[https://www.npmjs.com/package/json-server]
json-server --watch src/_db/mock-api/endpoints.json --port 8000
- http://localhost:8000/racers
- http://localhost:8000/racers?id=1
- http://localhost:8000/history
- http://localhost:8000/history?racerId=1
npm run api:generate
This command will run the script in src/_db/mock-api/generate-endpoints.mjs
and will build new data to populate the JSON-Server endpoints.
- Build a data generator, or hardcode a javascript object and add it to the
endpoints
object insrc/_db/mock-api/generate-endpoints.mjs