/NoR

Nim on Rails - Batteries included web framework

Primary LanguageNimApache License 2.0Apache-2.0

Nim on Rails v0

Please note that this software is still under development and is subject to change without notice!


This is a batteries included web framework that is heavily inspired by Ruby on Rails. It follows the same MVC pattern as Rails, keeping most of what everyone loved about Rails, but now it is in Nim, a statically typed programming language with a syntax similar to Python, but with the power of C++! Nim has the ability to transpile down to JavaScript, C, Objective-C and C++, which makes it perfect for performance focused applications as well as web apps.

Why NoR?

There are other Nim web frameworks (even batteries included ones), but they are not well documented, over complicated, or just have a dumb project structure. Other frameworks are usually libraries that you import into your project, NoR tries to be different, it is just an executable that does all the setup (similar to Rails) for you, you do not import it, you just run it!

PoC

Here is a proof of concept for this framework: Click Me.

Usage

Create a new project

No spaces should be in the project name.

nor new project_name

Why depend on x module?

Web Services

Prologue was the way to go for web services, as it is easy to understand and use.

Database Management

Allographer is the go to for relational database management in Nim.

HTML Templates

Nimja is currently our HTML template engine, it will be replaced with our custom implementation in the future, as it is similar to Jinja, and I prefer the PHP and somewhat RoR approach to HTML templates, just use the language like normal, allowing for maximum flexibility and power.

Plans for the future

These are potential plans for the future of NoR, however some of them may never be implemented!

  • Mongodb
  • Cross platform support with Nimview - the idea is that we can then expand the functionality from web framework to software framework, allowing us to cover more ground towards the WORA (write-once-run-anywhere) approach

What does NoR depend on?

  • Argparse - to parse commandline arguments

Contributing

Take an issue (or think of a cool feature), clone the repository, make the change, create pull request!

TODO

  1. Generate project
    • src
      • {name}.nim (entry point)
      • {name}.nimble
        • name
        • license
        • author
        • description
        • srcDir
        • bin
        • requires "nim >= 1.6.10"
      • app/
        • assets/ (or public/assets instead?)
        • controllers/ (will contain routes as well)
        • models/
        • views/
      • config/
        • locales/
      • db/
        • schema.nim (nim table/object)
        • seeds.nim
      • log/
        • development.log
      • test/
        • controllers/
        • models/
      • tmp/
  2. Initialize git repo
  3. Create README.md