Skip to content

Latest commit

 

History

History
196 lines (154 loc) · 6.26 KB

README.md

File metadata and controls

196 lines (154 loc) · 6.26 KB

Basolato Framework


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

⚠️ This project is under heavy development. It's not yet production-ready. ⚠️

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):

  • dotenv, Loads environment variables from .env.
  • nim-templates, a simple string templating library.
  • allographer, a library for building queries.
  • flatdb, a small Flatfile database, used for sessions.
  • bcrypt, used for hashing passwords.
  • nimAES, for AES support.
  • faker, for generating fake data.
  • 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
│   ├── core
│   │   ├── models
│   │   └── usecases
│   ├── di_container.nim
│   ├── http
│   │   ├── controllers
│   │   │   └── welcome_controller.nim
│   │   ├── middlewares
│   │   │   ├── auth_middleware.nim
│   │   │   └── cors_middleware.nim
│   │   └── views
│   │       ├── layouts
│   │       │   ├── application_view.nim
│   │       │   └── head_view.nim
│   │       └── pages
│   │           └── welcome_view.nim
│   └── repositories
│       └── query_services
│           ├── query_service.nim
│           └── query_service_interface.nim
├── .env
├── .env.local
├── config.nims
├── main.nim
├── migrations
│   └── migrate.nim
├── public
│   ├── basolato.svg
│   ├── css
│   ├── favicon.ico
│   └── js
├── session.db
├── {project_name}.nimble
└── tests
    └── test_sample.nim

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

ducere serve # includes hot reloading

Documentation

English
日本語

Benchmark

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