Nim fullstack website framework - deploy a website within minutes
A quick website tool. Run the nim file and access your webpage. Website: https://nimwc.org
/node_modules/, but very powerful builtin Templating engine.
To get started you only need:
Development dependencies (automatically installed by Nimble):
Foreing optional dependencies:
xorg-server-xvfb, required by firejail setting
OBS: - Use Nim Stable Release, Devel may or may not work.
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
You only need to perform 1a or 1b or 1c - not both of them.
# Install nimwc with nimble nimble install nimwc # Edit the config.cfg accordingly # (change the confg.cfg path to your nimble folder and the correct package version) nano ~/.nimble/pkgs/nimwc-5.5.1/config/config.cfg # Run nimwc # (to add an Admin append the arg "newadmin": nimwc --newadmin) # (to include some standard pages: nimwc --insertdata) nimwc # Login 127.0.0.1:7000/login
This will generate the executable in the folder.
# Clone the repository git clone https://github.com/ThomasTJdev/nim_websitecreator cd nim_websitecreator # Generate and edit the config.cfg accordingly cp config/config_default.cfg config/config.cfg nano config/config.cfg # Install dependencies nimble install jester recaptcha bcrypt datetime2human otp firejail webp, contra # Compile nimwc nim c nimwc.nim # Run nimwc # (to add an Admin append the arg "newadmin": nimwc --newadmin) # (to include some standard pages: nimwc --insertdata) ./nimwc # Login 127.0.0.1:7000/login
This will guide you through the installation.
curl https://raw.githubusercontent.com/ThomasTJdev/nim_websitecreator/master/devops/autoinstall.sh -sSf | sh
curl https://raw.githubusercontent.com/ThomasTJdev/nim_websitecreator/master/devops/autoinstall.sh -sSfLO && echo "6cc7510305db7b0ae5e3755137e71c23c7e08829264ddfb82702e6cac297f1063b46c48c01eafb16156c27a53aa23d1737c34f354ae1834c8498f5bd64b81b3c autoinstall.sh" | sha512sum -c - && sh ./autoinstall.sh
These arguments should be prepended to executable file, e.g.
--showconfig= Show parsed INI configuration and compile options.
--newadmin= Add the Admin user.
--gitupdate= Updates and force a hard reset.
--initplugin= Create plugin skeleton inside tmp/.
--vacuumdb= Vacuum database and continue (database maintenance).
--backupdb= Compressed full backup of database.
--backupdb-gpg= Compressed signed full backup of database.
--newdb= Generates the database with standard tables (does not override or delete tables).
newdbwill be initialized automatic, if no database exists.
--insertdata= Insert standard data, e.g
--insertdata bulma(this will override existing data)
bulma= Use Bulma CSS, No JS required
bootstrap= Use Bootstrap and jQuery
water= Water CSS framework, No JS, HTML Classless (No classes on HTML required)
These options are only available at compiletime:
-d:rc= Recompile. NimWC is using a launcher, it is therefore needed to force a recompile.
-d:adminnotify= Send error logs (ERROR) to the specified admin email.
-d:devemailon= Send email when
-d:demo= Used on public test site Nim Website Creator. This option will override the database every 1 hour with the standard data.
-d:gitupdate= Updates directly from Git and force a hard reset.
-d:postgres= Use Postgres database instead of SQLite.
-d:contracts= Checks pre- and post-conditions when compiled with
-d:hardened= Hardens security, requires
-d:contracts. Performance cost ~20% max.
-d:packedjson= Use PackedJSON instead of std lib JSON. Performance optimization.
There are 3 main user profiles: * User * Moderator * Admin
The access rights below applies to main program. Plugins can have their own definition of user rights.
The "User" can login and see private pages and blog pages. This user has no access to adding or editing anything.
The "Moderator" can login and see private pages and blog pages. The user can add and delete users, but cannot delete or add "Admin" users. The user cannot edit JS, CSS and core HTML - only within the pages and blogposts.
The "Admin" has access to anything.
You can easily add and edit blogpages. The blogpages support metadata: meta description and meta keywords. It is also possible to specify a category and tags.
In the settings menu you can specify how your blogposts should be sorted, e.g. on modfied date in ascending order.
To only show blogpost with a specific name, tag or category, you have to append the criteria to the URL. It is not possible to combine these.
website.com/blog?name=nim website.com/blog?category=article website.com/blog?tags=code
Multiple plugins are available. You can download them within the program at
The plugin repository are located here: NimWC plugin repository
When editing a blogpage or a normal page press Ctrl+S to save.
GrapesJS is a Web Builder Framework. To use GrapeJS with a CSS framework (Bulma or Bootstrap), you have to edit
public/js/grapejsbs4.min.js. Bootstrap support in
public/js/grapejs_custom.jsis commented out.
To activate Google reCAPTCHA claim you site and server key and insert them into
Copy the file
sudo nano /lib/systemd/system/nimwc.service
Enable auto start of NimWC:
sudo systemctl enable nimwc sudo systemctl start nimwc sudo systemctl status nimwc
CrossCompiling, Build for old Linux
Sometimes you may need Build for very very old Linux, like old Centos and Debian Old Stable, from a recent Linux, like new Arch or Ubuntu, heres how you can do it, without a virtual machine with an old Linux to build.
You can choose how much CPU & RAM NimWC can use, Firejail will make NimWC believe that theres less CPU & RAM that the actually physically available. If you choose too small resources for too big load, then it will feel like when you try to run a heavy program on a VirtualBox with too small CPU & RAM, but will still run, or do the best to try to run. This can be useful for Clouds that charge you extra when you pass certain threshold of CPU & RAM usage.
NimWC does not depend on any Hardware device to run, like audio, video, USB, DVD, etc, so you can block the access to the hardware peripehals, that also blocks its hardware drivers and libraries that may have vulnerabilities, making your NimWC more secure.
There are options to block root user and the rest of the users on the Linux system, thats help protect your NimWC against Privilege Scalations, thats when an unprivileged normal user becomes superuser root, or an user can see other users stuff.
Caches and Temporary directories are mounted as private temporary unique autogenerated TMPFS, meaning that the real ones can not be altered from within NimWC.
noMnt=true is for when you run 1 instance NimWC per server,
noMnt=false is for when you run multiple instances NimWC per server,
because it may or may not block other instances of accesing subfolders on
noX=false if you are running a headless server or ChromeBook.
Xvfb for X Isolation (
you may need to install it if you want to use it, but is not a hard dependency,
noX=false and you dont need to install it if you dont want to.
The features come from the Linux Kernel itself, so theres zero cost on performance and the technology is already there even if you use it or not.
So in conclusion NimWC being compiled binary wont need access to most of your system, just its own folder, the integration with Firejails hides everything else.
You local version of firejail to needs be >=
0.9.58. Install using your package manager:
sudo pacman -S firejail
NimWC uses The Peer Production License (PPL).
PPL is derived from the Creative Commons Attribution-NonCommercial-ShareAlike license. However unlike CC-BY-NC-SA, PPL demands reciprocation (whether monetary or otherwise) from non-contributing commercial entities (aka Big Corporations). This means, that mega-corporation cannot just take all your code, rename it, and sell it without contributing back to you.
The Peer Production License is a reciprocity-based license by which commons are freely accessible to those who contribute to create them, while third party non-contributing entities profiting from these commons can be charged a license fee to sustain the project in the long run.
For all other meanings of license, is very similar to MIT license.