Skip to content
Proyek

Tentang

An asynchronous fullstack web framework for Nim.

Pengembangan web dan aplikasi

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
0
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

Basolato Framework


An asynchronous multiprocessing full-stack web framework for Nim, based on asynchttpserver.

:warning: This project is under heavy development. It's not yet production-ready. :warning:

The only supported OS are Alpine, Debian, and Ubuntu. The Docker example below assumes Ubuntu 26.04.

FROM ubuntu:26.04

# prevent timezone dialogue
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
    apt upgrade -y && \
    apt install -y \
      # for build Nim and make
      build-essential \
      # for unzip tar.xz
      xz-utils \
      # for https
      ca-certificates \
      curl \
      git \
      # for database
      sqlite3 \
      libpq-dev \
      libmariadb-dev \
      libsass-dev

ARG NIM_VERSION="2.2.10"
WORKDIR /root
RUN curl https://nim-lang.org/choosenim/init.sh -o init.sh
RUN sh init.sh -y
RUN rm -f init.sh
ENV PATH $PATH:/root/.nimble/bin
RUN choosenim ${NIM_VERSION}

ENV PATH $PATH:/root/.nimble/bin
WORKDIR /application
COPY ./basolato.nimble .
RUN nimble install -y -d
RUN git config --global --add safe.directory /application

Table of Contents

Introduction

Basolato extends asynchttpserver, an implements a high performance asynchronous HTTP server in Nim std library, while also adding features for full-stack development. It was also heavily inspired by other frameworks:

Language Framework
Ruby Rails
PHP Laravel
Python Masonite
Java/Scala Play
Go Revel

Set up your environment

In order to start using Basolato, you'll first need a working Nim installation. You can find installation instructions for Nim here. Once installed, make sure Nimble, Nim's package manager, is already in your PATH. If not, add .nimble/bin in your favorite shell.

export PATH=$PATH:~/.nimble/bin

Dependencies

The framework depends on several libraries (installed automatically by Nimble):

  • allographer, a library for building queries.
  • faker, for generating fake data.
  • nim-rustcrypto, used for password hashing and JWT helpers.
  • sass, provides a Sass/SCSS to CSS compiler for Nim through bindings to libsass.

Installation

You can install Basolato easily using Nimble:

nimble install https://github.com/itsumura-h/nim-basolato

After installing Basolato, you should have access to the ducere command on your shell.

Creating projects

Using ducere you can easily create a template project structure to start development right away. Ducere will generate a folder automatically using your project name.

cd /your/project/dir
ducere new {project_name}

The overall file structure is as follows:

├── app
│   ├── data_stores
│   │   ├── queries
│   │   └── repositories
│   ├── di_container.nim
│   ├── http
│   │   ├── controllers
│   │   │   └── welcome_controller.nim
│   │   ├── middlewares
│   │   │   ├── auth_middleware.nim
│   │   │   └── set_headers_middleware.nim
│   │   └── views
│   │       ├── errors
│   │       ├── layouts
│   │       │   ├── application_view.nim
│   │       │   └── head_view.nim
│   │       └── pages
│   │           └── welcome_view.nim
│   ├── models
│   └── usecases
├── config
│   └── database.nim
├── config.nims
├── database
│   ├── develop.sh
│   ├── staging.sh
│   ├── production.sh
│   ├── migrations
│   │   ├── default
│   │   │   └── migrate.nim
│   │   └── test
│   │       └── migrate.nim
│   └── seeders
│       ├── data
│       │   └── sample_seeder.nim
│       ├── develop.nim
│       ├── production.nim
│       └── staging.nim
├── main.nim
├── public
│   ├── basolato.svg
│   ├── css
│   ├── favicon.ico
│   └── js
├── resources
│   └── lang
│       ├── en
│       │   └── validation.json
│       └── ja
│           └── validation.json
├── {project_name}.nimble
└── tests
    └── test_sample.nim

With your project ready, you can start serving requests using ducere:

ducere serve # includes hot reloading
> Run server for development

ducere build
./startServer
> Run server for production 

Documentation

English
日本語

Benchmark

TechEmpower Benchmark results:

FrameworkBenchmarks

Roadmap

Version Content
v1.0 Support Clean architecture and Tactical DDD
v2.0 Support GraphQL

Development

Generate TOC of documents

Run.

nimble setupTool # Build docker image
nimble toc # Generate TOC

Jelajahi proyek terkait

Memuat…