Getting Started
Quick install
If you want the shortest path to a running Morphis backend, use the published CLI first:
# Install Morphis globally
bun i morphis -g
# Scaffold a new backend
morphis new my-backend
# Enter the project folder
cd my-backend
# Install project dependencies
bun install
# Start local development
bun devOpen http://localhost:3000 after bun dev starts.
If you are developing against the Morphis framework source in the same workspace, keep reading for the local clone and bun link workflow.
Requirements
- Bun installed locally
- Git installed locally
- VS Code or Cursor opened on the workspace root folder
- A terminal with permission to run global Bun commands such as
bun linkorbun install -g
Recommended workspace layout
Create one shared workspace folder so your app and the Morphis framework live side by side:
morphis-workspaces/
├── morphis/
└── my-backend/This layout is useful when you work with AI agents in VS Code or Cursor because the editor can see both your application code and the Morphis framework source in the same workspace.
Minimal tutorial
Create the workspace folder and clone Morphis
mkdir morphis-workspaces
cd morphis-workspaces
git clone https://github.com/kentng201/morphis.gitRegister Morphis as a global CLI
cd morphis
bun install
bun link
cd ..bun link registers the cloned morphis package globally, so you can run the full morphis CLI from anywhere in this workspace.
If you want the published package globally instead of your local clone, use this alternative command:
bun install -g morphisFor this workspace-based setup, bun link is the better option because the global morphis command points at your cloned framework source.
Create your backend project
morphis new my-backendWhen the CLI asks which database you want, choose No database needed.
Link your backend to the local Morphis package
cd my-backend
bun install
bun link morphisThis keeps my-backend connected to the local framework clone in the same workspace.
Run the development server
bun run devThe generated minimal app uses the default api server and serves on http://localhost:3000.
Test your API
Start the Scalar API preview to interactively test your running backend:
morphis-scalar --project=../my-backend --server=apiThen open http://localhost:4173 in your browser.
The generated starter route responds from src/routes/api.ts and returns { "message": "OK" }. You will see it listed in the Scalar UI ready to execute.
Generated structure
After the tutorial, your workspace should look like this:
morphis-workspaces/
├── morphis/
│ ├── scripts/
│ └── src/
└── my-backend/
├── .env.api
├── package.json
├── tsconfig.json
└── src/
├── config/
├── controllers/
├── middlewares/
├── providers/
├── routes/
│ └── api.ts
├── services/
├── transformers/
├── types/
└── validators/Next steps
- Continue with Core Concepts
- Learn the CLI
- Explore Routing