A TypeScript project with MVC architecture for fetching and displaying UFC fighter and event information. This project uses Axios for HTTP requests and Cheerio for parsing HTML.
- Fetch UFC fighter details from Sherdog and UFC.
- Fetch and display UFC event details.
- Use TypeScript for static type checking.
- Follow MVC architecture.
mvc-ufc-api/
├── dist/
├── node_modules/
├── src/
│ ├── controllers/
│ │ ├── EventController.ts
│ │ ├── FighterController.ts
│ ├── models/
│ │ ├── EventModel.ts
│ │ ├── FighterModel.ts
│ ├── views/
│ ├── index.ts
├── .gitignore
├── package.json
├── tsconfig.json
├── README.mdClone the repository:
git clone
cd into projectInstall dependencies:
npm installStart the terminal:
npm startCompiles TypeScript to JavaScript:
npm run buildBuilds and starts the Electron app:
npm run start-electron- start: Run the application using ts-node.
- build: Compile the TypeScript code into JavaScript.
- test: Placeholder for running tests (no tests specified currently).
- Endpoint: /fighter/:query
- Method: GET
- Description: Fetches fighter details from Sherdog and UFC.
- Parameters:
- query: Name of the fighter.
- Endpoint: /events/upcoming
- Method: GET
- Description: Fetches upcoming UFC events.
- Endpoint: /event/:query
- Method: GET
- Description: Fetches details of a specific UFC event.
- Parameters:
- query: Name or identifier of the event.
- axios: ^1.7.2
- cheerio: ^1.0.0-rc.12
- @types/cheerio: ^0.22.31
- @types/node: ^20.3.1
- ts-node: ^10.9.1
- typescript: ^5.1.6
Erik Williams