Quickstart
Get started with Admiral in under 5 minutes.
Prerequisites
- Node.js 18+ or Bun
- Docker (for local development)
- A Stripe account (for billing features)
Installation
Using the CLI (Recommended)
# Install the Admiral CLI
npm install -g @admiral/cli
# Create a new project
admiral init my-saas-app
cd my-saas-app
# Start local dependencies
admiral dev:deps
# Start the development server
admiral dev
Manual Setup
# Clone the starter template
git clone https://github.com/admiral/starter my-saas-app
cd my-saas-app
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Start Docker dependencies
docker-compose up -d
# Run migrations
npm run db:migrate
# Start the development server
npm run dev
Project Structure
my-saas-app/
├── src/
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ ├── lib/ # Utilities and helpers
│ └── server/ # Server-side code
├── prisma/ # Database schema
├── public/ # Static assets
└── package.json
Configure Authentication
Admiral supports multiple authentication methods out of the box:
// admiral.config.ts
export default {
auth: {
providers: ['google', 'github', 'email'],
magicLink: true,
mfa: {
enabled: true,
methods: ['totp', 'sms'],
},
},
};
Add Your First Tenant
import { admiral } from '@admiral/sdk';
// Create a tenant
const tenant = await admiral.tenants.create({
name: 'Acme Corp',
plan: 'pro',
});
// Invite a user
await admiral.tenants.invite(tenant.id, {
email: '[email protected]',
role: 'admin',
});
Next Steps
- API Reference - Complete API documentation