Skip to content

CFBD/cfb-api-v2

Repository files navigation

CFBD API v2

This is the repository for the CFBD API v2, currently hosted at APINext.CollegeFootballData.com. The API is built on NodeJS using TypeScript and Express over a PostgreSQL database.

Getting Started

This repo uses yarn for dependency management. Run the following commands to install dependencies and start a dev server with hot reloading:

yarn install
yarn dev

Code Formatting

This repo uses prettier and eslint for code formatting. Run the following command to format your code before committing:

yarn prettify

Semantic Versioning

Semantic versioning is used for this project. Version numbers are automatically updated via semantic-release based on commit messages. commitlint is used to enforce commit message formatting.

Project Architecture

tsoa and Express

This project uses tsoa to generate OpenAPI documentation and Express routes from TypeScript controllers.

Data Access

Data access is implemented using kysely, a lightweight SQL query builder for TypeScript.

Folder Structure

src/
├── app/ - application logic
│   └── category/ - application category
│       ├── controller.ts - tsoa controller
│       ├── service.ts - business logic
│       └── types.ts - typescript types
├── config/
│   ├── middleware/ - tsoa and express middlewares
│   ├── types/ - typescript types
│   ├── auth.ts - authorization logic
│   ├── database.ts - database configuration
│   ├── errors.ts - error handling
│   └── express.ts - express configuration
├── globals/ - global types and constants
└── app.ts - application entrypoint