scafold-mojo-svelte Svelte Themes

Scafold Mojo Svelte

scafolding a backend + frontend with mojo + svelte

scafold-mojo-svelte

A scaffold project combining Mojolicious (Perl web framework) for the backend and Svelte for the frontend.
This template provides a minimal yet practical starting point for building modern full-stack web applications.


✨ Features

  • Perl Mojolicious backend with routing and API structure
  • Svelte frontend for reactive UI
  • Ready-to-use development environment
  • Hot-reload for frontend development
  • Configurable environment variables

šŸ“‚ Project Structure

.
ā”œā”€ā”€ backend/          # Mojolicious app (Perl)
│   ā”œā”€ā”€ lib/          # Perl modules
│   ā”œā”€ā”€ templates/    # Mojo templates
│   ā”œā”€ā”€ public/       # Static files
│   └── script/       # Application script
└── frontend/         # Svelte application
ā”œā”€ā”€ src/          # Svelte components
ā”œā”€ā”€ public/       # Static assets
└── package.json  # Frontend dependencies

šŸš€ Getting Started

1. Clone the repository

git clone https://github.com/marcoarthur/scafold-mojo-svelte.git
cd scafold-mojo-svelte

2. Backend Setup (Mojolicious)

Make sure you have Perl 5.16+ and Carton installed.

cd backend
carton install

Run the backend server:

carton exec morbo script/app

3. Frontend Setup (Svelte)

Make sure you have Node.js (>=16) and npm installed.

cd frontend
npm install
npm run dev

This will start the Svelte development server (usually on http://localhost:5173).


4. Combine Backend + Frontend

  • Configure the backend to serve the built frontend from frontend/public/ or proxy API calls.
  • Build Svelte for production:
npm run build

Copy build output to the Mojolicious public/ directory.


āš™ļø Configuration

  • Create .env files for environment-specific settings.
  • Configure backend API routes in backend/lib/MyApp.pm.

āœ… Requirements

  • Perl 5.16+
  • Node.js 16+
  • Carton (for Perl dependency management)

šŸ“œ License

MIT License. See LICENSE for details.

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes