@imola-solutions/setup
v0.4.0
Published
One-command turnkey setup for @imola-solutions/* packages. Creates a Supabase project (or connects to an existing one), applies SQL schemas, creates storage buckets, configures RLS, and writes .env + client code. Ready-to-go in one shot.
Readme
@imola-solutions/setup
One-command turnkey installer for @imola-solutions/*. Creates a Supabase project (or connects to your existing one), applies SQL migrations, creates storage buckets, configures RLS, and writes the .env + client code. You only pick — the CLI does everything else.
Usage
Run in your project root:
npx @imola-solutions/setupWhat it does
- Detects your framework (Vite / Next.js / Create React App) from
package.json - Detects installed
@imola-solutions/*packages (pre-selects them in the module picker) - Asks you 3–5 questions:
- Framework
- Which modules (chat, calendar, documents, secure-messaging, workflow-builder, distribution-lists)
- Supabase: create new or connect existing
- If new: org, project name, DB password, region
- If existing: pick from your project list
- Applies the schema:
- Runs
init.sql+rls.sqlfor each module you picked, against Supabase via the Management API - Creates required storage buckets (
documentsbucket for the documents module, etc.)
- Runs
- Writes files in your project:
.env.local— withVITE_SUPABASE_URL+VITE_SUPABASE_ANON_KEY(orNEXT_PUBLIC_*on Next.js)src/lib/imola-client.ts(or.js) — canonical Supabase client instance- Optional:
src/examples/<module>.tsx— minimal wiring for each chosen module
What you need
For create new flow:
- A Supabase account
- A Personal Access Token from https://supabase.com/dashboard/account/tokens (starts with
sbp_) - The CLI never stores it — used only for this session
For connect existing flow:
- Same Personal Access Token (used to fetch keys + apply migrations)
After running
The CLI prints:
Install the modules if you haven't yet:
npm install @imola-solutions/client @supabase/supabase-js \
@imola-solutions/chat @imola-solutions/documents ...
Then use them from your app:
import { client } from "./lib/imola-client";That's it. In your components:
import { createChatService, ChatProvider, ChatLayout } from "@imola-solutions/chat";
import { client } from "./lib/imola-client";
const chatService = createChatService({
apiClient: client,
currentUser: { id: "USR-1", name: "Alice", avatar: "/a.png" },
});
export function App() {
return (
<ChatProvider chatService={chatService}>
<ChatLayout ... />
</ChatProvider>
);
}Safety
- Idempotent — running the CLI twice against the same project is safe. Migrations use
IF NOT EXISTS, RLS policies are dropped-then-recreated. - Never touches your code unless you consent to writing the example files.
- Personal Access Token is never stored anywhere. It's used only for the API calls in this run.
- Service role key is written to
.env.localas a commented-out line so you can uncomment it if you need admin operations from a server.
Requirements
- Node ≥ 18
- A Supabase account
- A
package.jsonin your project (for framework/module detection)
