Installation
This guide walks you through installing and running a JCC Express MVC application. JCC Express is a Laravel-inspired framework on top of Express.js and TypeScript, tuned for the Bun runtime. By the end, you should have dependencies installed, environment configured, the database ready, and the dev server responding in the browser.
What you are installing
You will set up four pieces:
- Bun — JavaScript runtime and package manager. The stack expects Bun for
devand many workflows. - Application code — Routes, controllers, models, and views, from
jcc-express-starteror a cloned repo. - Database — MySQL, PostgreSQL, or SQLite. Data goes through JCC Eloquent (Knex), or optionally Sequelize/Mongoose.
.env— Local config: ports, DB credentials, secrets. Do not commit real secrets.
1. Prerequisites
1.1 Bun (required)
Install Bun (official installer):
Restart your terminal, then check:
You should see a version number (for example 1.2.x).
1.2 Database
Pick one:
- MySQL or MariaDB — common default in examples below
- PostgreSQL — supported via
DB_CONNECTION - SQLite — fine for local experiments; set connection accordingly in
.env
Create an empty database (example name: jcc_express) and a user with rights to create tables. You will plug the credentials into .env when you configure the environment (see below).
1.3 Git (recommended)
Use Git to clone projects or manage your own repo. Optional but standard for real projects.
2. Get the application code
You can start in either of these ways.
Option A — New project from the starter (recommended for a fresh app)
Run the starter from your terminal using either npx (npm) or bunx (Bun)—both invoke the same tool:
- Interactive frontend choice — The CLI opens a prompt: “Select your preferred frontend.” Use ↑ and ↓ to move, then Enter to confirm. Typical options:
- Inertia + React
- Inertia + React + TypeScript
- Inertia + Vue
- Inertia + Vue + TypeScript
- What happens next — After you choose a stack, the starter scaffolds the project (folders such as
app/,routes/,database/,bootstrap/, frontend wiring for your choice,package.jsonscripts, etc.), then installs packages. If that finishes without errors, a.envfile is created for you (often with.env.examplealongside for reference). You do not need to copy.envby hand for a successful starter run.
- Enter the project
You usually do not need another install step. If node_modules is missing or the installer reported a failure, run:
If the starter used npm for install, the app still runs with Bun; bun install afterward is fine if you want a single toolchain.Option B — Clone an existing repository
If you already have a JCC Express project (for example this framework’s example app):
3. Environment file
3.1 .env file
If you used the starter (Option A): .env is already created. Open it in your editor and update values for your machine.
If you cloned a repo (Option B): create .env from the example if the repo does not ship a committed .env (most teams ignore it in Git):
The framework reads these values at boot (often via dotenv and app/Config). The important machine-specific edits are usually the real database credentials and other secrets (host, password, session secret, etc.). .env.example in your repo lists every key and is the source of truth for names and optional features.
3.2 Generate JWT_SECRET
JWT-based auth expects a strong JWT_SECRET in .env. Generate and write it automatically from the project root (default key name is JWT_SECRET):
Re-run this anytime you need to rotate the secret. To print a value without writing .env, use bun artisanNode key:generate show. For flags and arguments, run bun artisanNode key:generate --help.
Example (adjust keys to match your .env.example):
OAuth / mail / other features — only fill these when you need them (Socialite, SMTP, etc.). Your .env.example usually documents the keys.
4. Dependencies (usually already done)
If you used npx jcc-express-starter, dependencies are normally installed as part of that command—nothing extra here.
If you cloned a repo (Option B), run once from the project root:
Re-run bun install whenever package.json changes (new packages or lockfile updates).
5. Database migrations
JCC Eloquent migrations live under database/migrations/. The CLI command (from the project root) is typically:
What this does:
- Ensures a
migrationstable exists (if the framework uses that pattern). - Runs each pending migration file in order to create or alter tables.
If migrate fails:
- Confirm MySQL/Postgres is running and the database from
.envexists. - Check
DB_CONNECTIONmatches your driver (mysql2,postgres,better-sqlite3, etc.). - Read the error message: wrong password, unknown database, and SQL syntax issues are the most common.
6. (Optional) Seed sample data
Some projects ship seeders under database/seeders/. To run all seeders:
To run one seeder class by name:
If db:seed fails on path aliases like @/Model/..., run only the seeders that load cleanly, or fix imports — your project docs may describe this.
7. Run the application
Scripts are defined in package.json. bun run <script> and npm run <script> both work the same way—use whichever matches your setup.
For a typical Inertia + Vite app, use two terminals in the project root. Start the asset bundler first, then the server.
7.1 Frontend assets first (Vite)
In the first terminal:
or:
This starts Vite in watch mode (React/Vue, Tailwind, hot reload, etc.). Let it keep running.
7.2 API / server (second terminal)
In a second terminal, from the same project root:
or:
This usually runs bun --watch server.ts (when using Bun) or the dev script from package.json, which boots Express and your bootstrap pipeline.
7.3 Open the app
In the browser, visit:
Use the PORT from .env (e.g. http://localhost:5500). You should see your welcome route or home page.
8. Command-line interface (Artisan-style)
The ArtisanNode CLI is artisanNode. From the application root (where server.ts and bootstrap/ live):
Use bun artisanNode list or bun artisanNode help [command] to see commands (migrate, key:generate, make:controller, make:model, db:seed, etc.).
9. Verify installation (quick checklist)
- [ ]
bun --versionprints a version - [ ] Dependencies are present (starter did install, or you ran
bun installafter a clone) - [ ]
.envexists and is filled in for your machine (starter projects already have the file; cloned repos may needcp .env.example .env) - [ ]
bun artisanNode key:generatehas setJWT_SECRET(required for JWT auth) - [ ]
bun artisanNode migratecompleted (or you intentionally skip DB for now) - [ ]
watchthendevboth run without crashing (bun run/npm runas you prefer) - [ ] Browser loads
http://localhost:<PORT>
10. Common problems
- Port already in use — Change
PORTin.envor stop the other process using that port. - Cannot connect to database — Check host, port, user, password, and database name; firewall; whether MySQL/Postgres is running.
- Migration SQL errors — Driver version and SQL compatibility; try a clean DB or fix migration state (see project docs).
- Module not found /
@/alias —tsconfig.jsonpaths must include the project root; some CLIs need the app bootstrap to resolve aliases. - Session / CSRF / login oddities —
APP_URL, cookie settings, HTTPS in production,SESSION_SECRET(or equivalent). - JWT / token errors (401, invalid signature) — Run
bun artisanNode key:generatesoJWT_SECRETin.envis set and stable; restartdevafter changing it.
11. What to read next
- Configuration.md —
.env,app/Config, and how values are loaded at runtime - Directory-structure.md — Project folders and what each is for
- Frontend.md — Why
watchruns beforedev(Vite + Inertia) - Deployment.md — Production
.env, builds, migrations, and process management docs/docs-for-dev.md— broad framework guide (routing, Eloquent, validation, queues, etc.)docs/getting-started.md— shorter orientationREADME.md(project root) — feature overview and quick startdocumentation-design(repo pointer file) — if your app includes the documentation CMS tables
Summary
- Install Bun and a database.
- New app: run
npx jcc-express-starter my-apporbunx jcc-express-starter my-app, pick a frontend in the prompt, wait for scaffold + install; if it succeeds,.envis created. Thencd my-app. Existing repo:git clonethenbun install. - Edit
.env(starter creates it; clones often usecp .env.example .env). Set app URL, port, database, and other values for your machine. - Run
bun artisanNode key:generatesoJWT_SECRETis set for JWT auth. - Run
bun artisanNode migrate(and optionallydb:seed). - Run
watchfirst, thendev(e.g.bun run watchthenbun run dev, or the same withnpm run—both work). - Open
http://localhost:<PORT>in the browser.
You now have a working local installation of JCC Express MVC.
