Create a project
此内容尚不支持你的语言。
A project is a folder you own: your generated pages as files, your own buttons, save hooks and table cells beside them, and one config file that says which databases the admin is built from. You open it in an editor, commit it to git, and deploy it like any other Node app.
Nothing about how Adminium works changes. It still reads your schema and draws the admin from it — the pages are settings, not generated code. A project just keeps those settings in your repository instead of only in Adminium’s database.
You do not need one. adminium try, the
Docker image and the
desktop app keep Adminium entirely in its own database, which is
the right choice if nobody is going to write code. Use a project when you want
to review changes in a pull request, run the same admin on a laptop and on a
server, or add code of your own.
What you need
Section titled “What you need”- Node.js 22.14 or newer (
node -v). - A database Adminium can reach — PostgreSQL, MySQL/MariaDB or SQLite — or neither, and take the sample database instead.
One command
Section titled “One command”npx @adminiumjs/adminium new my-adminIt asks which database the admin should be built from:
Which database should the admin be built from? › The sample database a small demo company, in SQLite My own database a Postgres, MySQL or SQLite URL Decide later set DATABASE_URL in .envThen it writes the folder, puts a fresh ADMINIUM_SECRET and your database URL
in .env, starts a git repository, and installs the dependencies with the
package manager you ran it with:
Created my-admin. Added: package.json, adminium.config.ts, tsconfig.json, .env.example, … Wrote: .env (ADMINIUM_SECRET), .env (DATABASE_URL)
Next: cd my-admin npm run dev--sample, --database <url> and --yes answer the questions up front, which
is what you want in a script:
npx @adminiumjs/adminium new my-admin --sample --yesEvery flag: adminium new.
Run it
Section titled “Run it”cd my-adminnpm run devOpen http://localhost:4600 and create the first super admin. On this first
run Adminium connects the database, reads its schema, generates the pages — and
writes them into your folder:
Database "main": added (postgres://…).Database "main": generated 20 page(s).Wrote schema/main.json.Wrote pages/contacts.json.Wrote pages/orders.json.…From here the folder and the running admin stay in step in both directions: edit
pages/orders.json and the open page changes; rename a column in Studio and the
file changes. That is page files.
npm run dev restarts when adminium.config.ts or .env changes, and reloads
your hooks, actions,
pages and widgets without a restart. Ctrl-C
stops it.
In a folder you already have
Section titled “In a folder you already have”Run new with no name and the current folder becomes the project:
cd my-appnpx @adminiumjs/adminium newIt changes nothing that is already there. Missing files are added, and
package.jsonkeeps every value it has; Adminium’s dependency and itsdev,build,start,checkandpullscripts are added. A script name you already use is kept, and Adminium’s goes in asadminium:devand so on..gitignoregets the lines it is missing, appended..envis created if it is missing. If it exists, only missing keys are added, andADMINIUM_SECRETis never touched.
It asks first when the folder is not empty, and refuses your home folder, the filesystem root, and a folder that is already a project.
From an instance you already run
Section titled “From an instance you already run”If you have been using Adminium without a project, new adopts it rather than
starting over. A data/ folder holding an instance is kept as it is, and
--import copies one in first — ~/.adminium is where
try puts an instance started from a folder of its
own:
mkdir my-admin && cd my-adminnpx @adminiumjs/adminium new --import ~/.adminiumWhat happens:
- The secret is kept.
newtakesADMINIUM_SECRETfrom.envor the environment, or asks for it, and checks that it opens the instance’s stored connection strings before it writes anything. Without the right secret it stops. - Each connection gets a key. The oldest becomes
main, the others are named after the connection.adminium.config.tslists them, each reading its URL from.env(DATABASE_URL, then<KEY>_DATABASE_URL). - Those variables start empty. The URLs stay where they are, encrypted, in
the instance;
newnever writes a password into a file. Fill them in when you want the config to be the source. - Its pages and schema customizations are written to
pages/andschema/, so what you already built is in the folder from the first commit.
Users, roles, settings, saved views and the audit log stay in the instance’s own database, as they do in every project.
Try it without a project
Section titled “Try it without a project”npx @adminiumjs/adminium trytry is the interactive setup wizard with no folder to create: it asks whether
to continue in your browser or in the terminal, walks through connecting a
database and generating the admin, and starts the server. Its data goes to
~/.adminium, unless you started it in a folder that is a project of some other
kind (one with a package.json, a .git or a compose file), where it uses
./data beside it. You can adopt either later with new --import above. try
needs an interactive terminal, and it refuses to run inside an Adminium
project — there, npm run dev is the command.
- The project folder — every file, and what
adminium.config.tscan say. - Page files — the format, and how the folder and a running server stay in step.
- Hooks and actions — your own code on the server.
- Pages and widgets — your own React pages, table cells and dashboard cards.
- Pull and check — bring edits made on a server back into the folder, and check the project in CI.
- Deploy a project — Docker, Render, Fly.io, App Platform, Railway, or a plain VPS.