A comprehensive monorepo containing HTTP client libraries for modern TypeScript applications. This repository includes packages for both browser and Node.js environments with built-in retry logic, authentication, and comprehensive error handling.
This monorepo contains the following packages:
| Package | Version | Description |
|---|---|---|
| boilerplate-api-core-library | Universal HTTP client library |
- ποΈ Monorepo Architecture: Organized using Yarn workspaces and Turbo
- π Universal Packages: Works in both browser and Node.js environments
- π Type-Safe: Full TypeScript support with comprehensive type definitions
- π Retry Logic: Configurable retry mechanism with exponential backoff
- π Authentication: Built-in support for token-based authentication
- β‘ Performance: Optimized for speed and minimal bundle size
- π‘οΈ Error Handling: Comprehensive error handling with custom error types
- π― Simple API: Clean and intuitive API design
- π¦ Minimal Dependencies: Optimized production dependencies
- π Automated Releases: CI/CD with Changesets for version management
# npm
npm install boilerplate-api-core-library
# yarn
yarn add boilerplate-api-core-library
# pnpm
pnpm add boilerplate-api-core-libraryimport { api } from 'boilerplate-api-core-library/client';
// For browser environments
const { response, status } = await api.get({
url: 'https://api.example.com/users',
contentType: 'application/json'
});For detailed usage examples, see the Core Package Documentation.
βββ packages/
β βββ core/ # Core HTTP client library
β βββ src/
β β βββ client/ # Browser-specific implementations
β β βββ server/ # Node.js-specific implementations
β β βββ core/ # Shared core functionality
β β βββ types/ # TypeScript type definitions
β βββ README.md
βββ examples/
β βββ client/ # Browser usage examples
β βββ server/ # Node.js usage examples
βββ .github/
β βββ workflows/ # CI/CD workflows
β βββ release.yml # Automated releases
β βββ pull_request_checks.yml # PR quality checks
βββ docs/ # Documentation
## π― Examples
Check out the [`examples`](./examples) directory for complete working examples:
- **[Browser Example](./examples/client/)**: Web application usage with HTML/JS
- **[Node.js Example](./examples/server/)**: Server-side usage with TypeScript
### Running Examples
```bash
# Server example
yarn example:server
# Client example (builds and serves)
yarn example:client:build
yarn example:client:serve
- Node.js >= 18
- Yarn >= 1.22.1
# Clone the repository
git clone https://github.com/monzter50/boilerplate-api-core-library.git
cd boilerplate-api-core-library
# Install dependencies
yarn install
# Build all packages
yarn build| Command | Description |
|---|---|
yarn build |
Build all packages |
yarn test |
Run tests for all packages |
yarn test:coverage |
Run tests with coverage |
yarn lint |
Lint all packages |
yarn format |
Format code with Prettier |
yarn type-check |
Run TypeScript type checking |
yarn clean |
Clean build artifacts |
yarn dev |
Development mode with watch |
This monorepo uses Changesets for version management and automated releases:
# 1. Create a changeset for your changes
yarn changeset
# 2. Version packages (updates CHANGELOG and package.json)
yarn changeset:version
# 3. Commit and push - CI will handle the release
git add .
git commit -m "chore: version packages"
git push- Pull Requests: Automated quality checks (tests, linting, type checking)
- Main Branch: Automated releases when changesets are detected
- Workflows: Located in
.github/workflows/
We welcome contributions! Please see our Contributing Guide for details.
- Fork and clone the repository
- Install dependencies:
yarn install - Run tests:
yarn test - Build the project:
yarn build
MIT Β© Monster Codes
- Inspired by modern HTTP client libraries
- Built with TypeScript and modern JavaScript features
- Designed for universal usage across environments
Star β this repo if you find it helpful!