A tiny, SQLite powered BBS without any frontend JavaScript.
liteBB is a very tiny BBS/forum written in Node.js.
It’s goals are
Note: The choice of sequelize is that, if you, the user
decide, you want a bigger database powering your community
discussions, you can change it just like that, in the config.
SQLite was chosen because its fits my
needs perfectly.
P.S the name liteBB
comes from SQLite
and oh! there’s a live instance running
on https://litebb.aktsbot.in/
$ git clone --depth=1 https://github.com/aktsbot/litebb litebb
$ cd litebb
$ npm i
$ mkdir dbs
$ NODE_ENV=production ./node_modules/.bin/sequelize db:migrate
$ cp example.env .env
$ # change the values in .env
$ npm start
username
.admin
users can create Boards.regular
users can create posts and replies.admin
s have access to the Settings page..env
file, if there is a FIRST_RUN=1
entry,admin
s.FIRST_RUN=1
in.env
file. Then create your admin user.FIRST_RUN=1
or remove it and thenSQLite is the star here. So have the sqlite3
binary installed on our
machine. For a GUI tool, there’s sqlitebrowser.
If you’re using the sqlite3
binary, having the following in
$HOME/.sqliterc
helps.
.header on
.mode column
We’ll need node.js installed on our machine. This is a node
project after all. Also it helps, to install some tools like the
sequelize
cli globally.
export NPM_PACKAGES=$HOME/.npm
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
export PATH=$NPM_PACKAGES/bin:$HOME/bin:$PATH
I don’t like to sudo npm i -g package
. With the above 3 lines in our $HOME/.profile
, we could do the same without sudo. $ npx sequelize
works too, but hey!
We make use of the sequelize
cli, if one does not like installing packages
globally, just add an alias to our $HOME/.bashrc
. This is what I have
alias sequelize="node_modules/.bin/sequelize"
To start the app in debug mode
$ DEBUG=litebb:* npm start
Sequelize cheatsheet, shamelessly ripped off from their README
Commands:
sequelize db:migrate Run pending migrations
sequelize db:migrate:schema:timestamps:add Update migration table to have timestamps
sequelize db:migrate:status List the status of all migrations
sequelize db:migrate:undo Reverts a migration
sequelize db:migrate:undo:all Revert all migrations ran
sequelize db:seed Run specified seeder
sequelize db:seed:undo Deletes data from the database
sequelize db:seed:all Run every seeder
sequelize db:seed:undo:all Deletes data from the database
sequelize db:create Create database specified by configuration
sequelize db:drop Drop database specified by configuration
sequelize init Initializes project
sequelize init:config Initializes configuration
sequelize init:migrations Initializes migrations
sequelize init:models Initializes models
sequelize init:seeders Initializes seeders
sequelize migration:generate Generates a new migration file [aliases: migration:create]
sequelize model:generate Generates a model and its migration [aliases: model:create]
sequelize seed:generate Generates a new seed file [aliases: seed:create]
The app and session databases will be generated in ./dbs
.
Boards
------
id
name
description
slug
createdAt
updatedAt
Posts
-----
id
name
content
renderedContent
slug
boardId
createdByUser
createdAt
updatedAt
Replies
-------
id
postId
content
createdByUser
createdAt
updatedAt
Users
-----
id
username
email
passwordHash
role
resetPasswordToken
createdAt
updatedAt