itsumura-h / Nim Basolato
Programming Languages
Projects that are alternatives of or similar to Nim Basolato
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):
- 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.
The following libraries can be used for making views:
- Karax, for single-page applications.
- react.nim, React.js bindings.
- react-16.nim, React 16.x bindings with an example app (WIP).
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:
โโโ .gitignore
โโโ app
โ โโโ controllers
โ โ โโโ README.md
โ โ โโโ welcome_controller.nim
โ โโโ domain
โ โ โโโ di_container.nim
โ โ โโโ models
โ โ โ โโโ README.md
โ โ โ โโโ value_objects.nim
โ โ โโโ query_services
โ โ โ โโโ README.md
โ โ โ โโโ query_service_interface.nim
โ โ โ โโโ rdb_query_service.nim
โ โ โโโ usecases
โ โ โโโ README.md
โ โโโ middlewares
โ โโโ README.md
โ โโโ auth_middleware.nim
โ โโโ custom_headers_middleware.nim
โโโ config.nims
โโโ main.nim
โโโ migrations
โ โโโ README.md
โ โโโ migrate.nim
โ โโโ migration0001sample.nim
โโโ public
โ โโโ README.md
โ โโโ basolato.svg
โ โโโ css
โ โโโ favicon.ico
โ โโโ js
โโโ resources
โ โโโ README.md
โ โโโ layouts
โ โ โโโ application_view.nim
โ โ โโโ head_view.nim
โ โโโ pages
โ โโโ welcome_view.nim
โโโ 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
Or by compiling through Nim:
nim c -r main
Documentation
- ducere CLI tool
- Routing
- Controller
- Request
- Middleware
- Headers
- Migration
- View
- Error
- Validation
- Security (CsrfToken, Cookie, Session, Auth)
- Password
- Helper
- Logging
Benchmark
- https://github.com/the-benchmarker/web-frameworks
- https://www.techempower.com/benchmarks/#section=test&shareid=d57ac3fe-2855-40ec-ac7a-424d34ce7a92&hw=ph&test=json&a=2
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