MinAPI Documentation

MinAPI is a comprehensive API framework built on Express and MongoDB that provides a minimum viable API setup with built-in authentication, permissions, CRUD operations, and resource management.

What is MinAPI?

MinAPI is designed to be a powerful yet minimal API framework that handles all the common requirements of a modern API, allowing developers to focus on building their applicationโ€™s unique features rather than reinventing the wheel for standard API functionality.

Key Features

Installation

npm install @hq/minapi
# or
yarn add @hq/minapi

Basic Usage

// Create minapi.config.js
module.exports = (API) => {
  return {
    project: {
      name: 'my-api',
      port: process.env.PORT || 3000,
      env: process.env.NODE_ENV || 'development'
    },
    db: '@mongodb/db',
    providers: {
      '@mongodb/db': {
        host: process.env.MONGODB_HOST,
        database: process.env.MONGODB_DATABASE
      }
    },
    // Add your models, routes, and other configuration here
  }
}

// Create index.js
const MinAPI = require('@hq/minapi')
const path = require('path')

const api = MinAPI({
  projectPath: __dirname,
  envPath: path.resolve(__dirname, '.env')
})

api.Init()
api.Start()