0.1.0-dev.03a85f44875cc2268b504dba024aa82fb2e1f8f0 • Published 10 months ago

@antribute/backend-core v0.1.0-dev.03a85f44875cc2268b504dba024aa82fb2e1f8f0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Antribute Backend Framework

A completely type safe, auto-generated backend framework

Installation

pnpm i @antribute/backend-core

Configuration

The Antribute backend can be configured entirely within one file .antributerc.ts. Besides .ts, the CLI will look for the following files

  • .antributerc.js
  • .antributerc.cjs
  • .antributerc.mjs

By default, the CLI will use the following configuration

import { defineConfig } from '@antribute/backend-core';

export default defineConfig({
  auth: {
    platform: '@antribute/backend-auth-nextauth',
  },
  graphql: {
    platform: '@antribute/backend-graphql-pothos',
  },
  logLevel: 'info',
  orm: {
    dir: 'prisma',
    platform: '@antribute/backend-orm-prisma',
  },
  permissions: {
    platform: '@antribute/backend-perms-auth0-fga',
  },
  server: {
    dir: resolve('src', 'server'),
    platform: '@antribute/backend-server-nextjs',
  },
});

In order to use this default config, you'll need to install the following packages and their peer dependencies

pnpm i @antribute/backend-auth-nextauth @antribute/backend-graphql-pothos @antribute/backend-orm-prisma @antribute/backend-perms-auth0-fga @antribute/backend-server-nextjs -D

Any package can be used as a platform, however the following platforms are built and maintained by Antribute for your convenience:

NameTypeDescription
@antribute/backend-auth-nextauthauthAdds NextAuth.js Support to the Antribute Backend
@antribute/backend-graphql-pothosgraphqlAdds Pothos GraphQL Support to the Antribute Backend
@antribute/backend-orm-prismaormAdds Prisma Support to the Antribute Backend
@antribute/backend-perms-auth0-fgapermissionsAdds Auth0 FGA Support to the Antribute Backend
@antribute/backend-server-nextjsserverAdds Next.js API Handler Support to the Antribute Backend

Usage

  1. Optionally Create a new file called .antributerc.ts and use the above instructions to configure it
  2. Run antribute-backend generate to generate the code required for your server
  3. That's it! Run your server as usual