ESC
Type to search...
S
Soli Docs

Introduction

Welcome to Soli MVC, a modern web framework designed for developers who value both elegance and performance. Soli combines the expressiveness of dynamic languages with the speed of compiled execution.

What you'll learn

This guide will introduce you to the MVC pattern, Soli's philosophy, and help you understand how to build applications with Soli.

What is Soli?

Soli is a high-performance programming language and web framework written in Rust. It features:

Expressive Syntax

Inspired by Ruby and modern languages for maximum developer happiness.

Blazing Performance

Bytecode compilation with optional JIT for near-native speed.

Batteries Included

Built-in ORM, WebSockets, and hot-reload development server.

Type Safety

Optional static typing allows you to catch bugs early.

The MVC Pattern

Soli follows the Model-View-Controller (MVC) architectural pattern, separating your app into three layers:

M

Model

Manages data, business logic, and database interactions. Located in app/models/.

V

View

Handles the presentation layer and HTML templates. Located in app/views/.

C

Controller

Coordinates between Models and Views to handle requests. Located in app/controllers/.

Project Structure

Directory Layout
my_app/
├── app/
│   ├── controllers/      # Request handlers
│   │   └── home_controller.soli
│   ├── models/           # Data models
│   │   └── user.soli
│   ├── views/            # HTML templates
│   │   ├── layouts/      # Shared layouts
│   │   │   └── application.html.erb
│   │   └── home/
│   │       └── index.html.erb
│   └── middleware/       # Request interceptors
│       └── auth.soli
├── config/
│   └── routes.soli       # Route definitions
├── public/               # Static assets
│   ├── css/
│   └── js/
└── package.json          # Build configuration

Quick Example

Here's how the pieces fit together in a simple Soli application:

1 Define a Route

config/routes.soli
get("/", "home#index");
get("/users/:id", "users#show");

2 Create a Controller

app/controllers/home_controller.soli
fn index(req: Any) -> Any {
    let message = "Welcome to Soli!";

    return render("home/index", {
        "title": "Home",
        "message": message
    });
}

3 Build a View

app/views/home/index.html.erb
<h1><%= message %></h1>
<p>Start building something amazing.</p>

Pro Tip

The fastest way to learn Soli is to build something. Start with a simple blog or todo app and expand from there!

Next Steps