0.1.0-dev.03a85f44875cc2268b504dba024aa82fb2e1f8f0 • Published 2 years ago
@antribute/backend-core v0.1.0-dev.03a85f44875cc2268b504dba024aa82fb2e1f8f0
Antribute Backend Framework
A completely type safe, auto-generated backend framework
Installation
pnpm i @antribute/backend-coreConfiguration
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 -DAny package can be used as a platform, however the following platforms are built and maintained by
Antribute for your convenience:
| Name | Type | Description |
|---|---|---|
@antribute/backend-auth-nextauth | auth | Adds NextAuth.js Support to the Antribute Backend |
@antribute/backend-graphql-pothos | graphql | Adds Pothos GraphQL Support to the Antribute Backend |
@antribute/backend-orm-prisma | orm | Adds Prisma Support to the Antribute Backend |
@antribute/backend-perms-auth0-fga | permissions | Adds Auth0 FGA Support to the Antribute Backend |
@antribute/backend-server-nextjs | server | Adds Next.js API Handler Support to the Antribute Backend |
Usage
- Optionally Create a new file called
.antributerc.tsand use the above instructions to configure it - Run
antribute-backend generateto generate the code required for your server - That's it! Run your server as usual