An experiment in building a public facing personal knowledge web app with TiddlyWiki and Nodejs.

Overview

Maarfapad

What is this?

Maarfapad was my attempt at learning Expressjs back in 2016 while building a CRUD app to handle TiddlyWiki html files. It was hosted at cloudnode, but has since been retired in favor of another project of mine Oneplaybook. This repository contains Maarfapad's source code, licensed under MIT.

How do I get it to work?

When you clone this repo, you'll need to first install all dependencies with npm install.

Please note that, depending on what you want to do, you might want to fiddle around with the config folder under the root directory. In there you will find 2 JSON files containing credentials needed to:

  1. Configure a host and port to run the app
  2. The CouchDB server address for long-term storage of the wiki files and otther app data
  3. Configure the email client to send service emails for things like password resets

The dev.secret.json file contains generic localhost addresses and whatnot for development purposes. Use the secret.json file to add production credentials. I chose this setup because Cloudnode allows for private git repositories that safely handle these secret JSON files. Needless to say, don't persist secrets to your public Github repo!

The editions.js file exports a URL pointing to an HTML TiddlyWiki template that is used by the app to create new wikis for the user. You can add more if you wish! These are used in app.js.

Finally, to run the whole thing in development mode, run the npm script:

npm run deploy:dev

For production (which is the default mode when your host boots the app with npm start using the server.js file, run:

npm run deploy:prod

Oh, and make sure you have CouchDB installed for all this to work when you're developing. You'll have to find a cloud provider that offers CouchDB instances for you to use. I used Cloudnode.

Is this project still being maintained?

As stated at the begining, this repo is just me archiving a project that was fun to build back when Nodejs was at v6.1 or less. A lot has happened since then. Things might break, but it worked well for me up to the moment of this commit. Feel free to play around with it.

Miscellaneous technical details

This app uses PUG as its view template engine. The server code uses Expressjs framework with a number of essential middlewares for things like parsing cookies, etc. The service worker code under the public folder is somewhat unorthodox because it was supposed to do a LOT.

  1. It allowed the app to be pretty much offline first, or atleast as much as possible.
  2. If wiki saves (the app saves the whole wiki as a single HTML blob) fail, then the app persists the blob into the browser cache. Of course, this is only temporary and the app tells you as much
  3. The only problem that used to happen was rare but annoying episodes of the app presenting a stale cache as a current view. I had the service worker always check the revision cached against the one in CouchDB to decide if it should default to fetch from the database or the browser cache. I never got a chance to address these staleness hiccups completely (partly because it was infrequent) so if it happens, just logout of the app and log back in. This causes the servier to reset credentials and delete the cached content (this tends to happen when you revisit the app on a device long after the credentials had expired, and it would warn you anyway that that is the case).
  4. Sign ups and login handling is done using Passportjs middleware
  5. Note that I artificially limited the number of wikis you could create per account to 2 for the sake of evaluating its performance. I have never increased it beyond that but you're welcomed to.
  6. Finally, this whole thing is a nice progressive web app!

Have fun 😄

You might also like...

A NodeJS Express server that uses Prisma ORM.

Express - Prisma Template (Typescript) A NodeJS Express server that uses Prisma ORM. Stack NodeJS Express Prisma TypeScript File Structure src/config

Feb 4, 2022

Egg Framework Boilerplate for NodeJS Runtime.

Egg Framework Boilerplate for NodeJS Runtime.

EGG.JS FRAMEWORK Tomato Work Personal Affairs Management System WEB Applets Built with Node = 14.16.0 Node Version Release Egg Application - Document

Jul 8, 2022

Set up a modern web app by running one command.

Create React App Create React apps with no build configuration. Creating an App – How to create a new app. User Guide – How to develop apps bootstrapp

Dec 28, 2022

React Starter Kit — isomorphic web app boilerplate (Node.js, Express, GraphQL, React.js, Babel, PostCSS, Webpack, Browsersync)

React Starter Kit — isomorphic web app boilerplate (Node.js, Express, GraphQL, React.js, Babel, PostCSS, Webpack, Browsersync)

React Starter Kit — "isomorphic" web app boilerplate React Starter Kit is an opinionated boilerplate for web development built on top of Node.js, Expr

Jan 1, 2023

⚡️ Set up Next.js Progressive Web App with `npx create-next-pwa`

⚡️ Set up Next.js Progressive Web App with `npx create-next-pwa`

⚡️ create-next-pwa A cross-platform Node.js based CLI tool that creates Progressive Web App (PWA) with Next.js. You can also integrate tailwind with t

Nov 20, 2022

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

A comprehensive starter kit for rapid application development using React. Why Slingshot? One command to get started - Type npm start to start develop

Jan 3, 2023

Starting a new JS app? Build, test and run advanced apps with kyt 🔥

Starting a new JS app? Build, test and run advanced apps with kyt 🔥

kyt Every sizable JavaScript web app needs a common foundation: a setup to build, run, test and lint your code. kyt is a toolkit that encapsulates and

Dec 26, 2022

An upgradable boilerplate for Progressive web applications (PWA) with server side rendering, build with SEO in mind and achieving max page speed and optimized user experience.

An upgradable boilerplate for Progressive web applications (PWA) with server side rendering, build with SEO in mind and achieving max page speed and optimized user experience.

React PWA v2 A highly scalable, Progressive Web Application foundation,boilerplate, with the best Developer Experience. Demo: https://demo.reactpwa.co

Dec 26, 2022

一個透過Google App Script發送台科公佈欄資訊的機器人

一個透過Google App Script發送台科公佈欄資訊的機器人

GAS-NTUST-bulletin 一個透過Google App Script發送台科公佈欄資訊到telegram和line notify的機器人 機器人網址 Telegram Line Screenshots 部署說明 先把學校的信件設定轉寄到某個gmail,,然後把GAS跑在該帳號上 基本上把

Nov 17, 2022
Comments
  • 同学,您这个项目引入了198个开源组件,存在14个漏洞,辛苦升级一下

    同学,您这个项目引入了198个开源组件,存在14个漏洞,辛苦升级一下

    检测到 abesamma/Maarfapad 一共引入了198个开源组件,存在14个漏洞

    漏洞标题:Nodemailer 注入漏洞
    缺陷组件:[email protected]
    漏洞编号:CVE-2020-7769
    漏洞描述:Nodemailer是Nodemailer团队的一个使用可提供发送邮件功能的 JS 代码库。
    nodemailer 6.4.16之前版本存在注入漏洞,该漏洞源于使用精心设计的收件人电子邮件地址可能会在sendmail传输中导致任意命令标志注入以发送邮件。
    国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-66596
    影响范围:(∞, 6.4.16)
    最小修复版本:6.4.16
    缺陷组件引入路径:[email protected]>[email protected]
    

    另外还有14个漏洞,详细报告:https://mofeisec.com/jr?p=a4587d

    opened by ghost 1
Owner
A.B. Samma
Medical doctor & researcher; I love building useful web apps. I have a thing for wikis and knowledge processes.
A.B. Samma
Webplate is an awesome front-end framework that lets you stay focused on building your site or app all the while remaining really easy to use.

Webplate Framework Webplate is an awesome front-end framework that lets you stay focused on building your site or app all the while remaining really e

Chris Humboldt 560 Nov 24, 2022
A professional front-end template for building fast, robust, and adaptable web apps or sites.

HTML5 Boilerplate HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites. This project is t

H5BP 53.8k Dec 28, 2022
Opinionated SvelteKit Template for building web applications.

Opinionated SvelteKit Template for building web applications.

Manassarn 7 Jan 1, 2023
A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose

By running a single command, you will get a production-ready Node.js app installed and fully configured on your machine. The app comes with many built-in features, such as authentication using JWT, request validation, unit and integration tests, continuous integration, docker support, API documentation, pagination, etc. For more details, check the features list below.

Hagop Jamkojian 5k Dec 31, 2022
Solana Boilerplate - Lightweight boilerplate for Solana dapps. Allows quick building and prototyping.

Lightweight boilerplate for Solana dapps. Allows quick building and prototyping. Feel free to contribute or fork this repository. Make it yours! Leave us a ⭐️ if this repo helped you.

null 21 Nov 15, 2022
A simple environment to start building on Starknet with Cairo

Starknet Boilerplate A simple environment to start building on Starknet with Cairo. Uses Nile for compilation/deployment and Starknetjs for contract i

threepwave 19 Dec 11, 2022
A boilerplate application for building Node.js back-end application in TypeScript

RESTful API Node Server Boilerplate A boilerplate/starter project for quickly building RESTful APIs and with typescript ?? Installation Install the de

Youssef Hajjari 14 Nov 23, 2022
Node Express Template (NET.ts) - a small template project which help you to speed up the process of building RESTful API

Node Express Template (NET.ts) - a small template project which help you to speed up the process of building RESTful API

Przemek Nowicki 26 Jan 4, 2023
X-Netflix is a streaming platform based on Netflix UI: built with ReactJS in frontend and nodeJS in backend.

X-Netflix X-Netflix is a streaming platform based on Netflix UI: built with ReactJS in frontend and nodeJS in backend. Built with FrontEnd: React.JS,

Mehdi BHA 52 Aug 19, 2022
NodeJS library develop quick start: TypeScript + CI/CD + Release Workflow + Linter + Changelog + ...

node-lib-starter Start NodeJS + TypeScript library developing with ease, have fun! Include Lint Git Hooks Release workflow CI/CD Changelog Configurati

LinbuduLab 22 Oct 28, 2022