Skip to main content

remarkbox

Project description

Quick Start: Operating a Server with PyPI or Source Code

This Makefile based workflow lets you choose between installing Remarkbox from PyPI packages or directly from the source code (editable mode). Both flows create a virtual environment in ./env and store configuration and SQLite data in the persistent ./data directory.

  1. Install Remarkbox

    • Get the Makefile in your present working direcory, run:

      wget "https://git.unturf.com/engineering/remarkbox/remarkbox/-/blob/main/Makefile"
    • For a PyPI Installation, run:

      make install-from-pypi
    • For a Source Installation (editable mode), run:

      make install-from-source
  2. Activate the Virtual Environment

    Before running any subsequent commands or scripts (including starting the server or running tests), activate the virtual environment with:

    source env/bin/activate

    Activating the virtual environment ensures that all Python commands (such as pip or pshell) use the packages and settings in ./env rather than your system-wide Python installation. This is crucial for consistency throughout the rest of this document.

  3. Start the Development Server

    Once the virtual environment is active, run:

    make serve

Other commands—such as make test, and make http operate within this environment.

Remarkbox

This is the codebase that powers both self‑hosted and SaaS Remarkbox!

SaaS Sites

Self‑hosted Example Running a Custom Theme

What is Remarkbox?

Remarkbox is a standalone question and answer site (forum) or an embedded comments/product reviews service that works anywhere HTML is supported.

Project Goals

Note: These goals are not in priority order.

  1. Support Multiple Use Cases: - Q&A sites (e.g. StackOverflow) - Embedded comment systems for static sites - Forums - Product review sections on e‑commerce sites

  2. Adopt Widely Used Tools: - GitHub (with GitLab under consideration) over Bitbucket - Git instead of Mercurial - Jinja2 templates instead of Mako - Markdown rather than reStructuredText - …and more, choosing solutions trusted by the majority.

  3. To be popular

  4. To be safe from spammers

  5. To be easy to manage and clean up spam

  6. To be passwordless – using one‑time-password codes via email for registration and authentication

  7. To scale horizontally

  8. To be multitenant

  9. To minimize friction for new users

  10. To be engaging for users

  11. To be search engine optimized

  12. To have great test coverage

  13. To be easy to create and load custom themes (similar to WordPress)

Local Installation

This repository includes a Makefile that automates your local Remarkbox environment setup by creating: - A virtual environment in ./env - A persistent data directory in ./data (which holds your development.ini and SQLite database)

Note: The Makefile handles environment setup and database initialization, so you do not need to run these steps manually.

Functional Testing Environment

To set up a functional testing environment on your workstation, open two terminal shells:

  1. In the first shell, start the Remarkbox server:

    make serve
  2. In the second shell, run a simple HTTP server (to serve an index.html file):

    make http

Browse to http://127.0.0.1:8000 to view the homepage, which embeds a local copy of Remarkbox. In development, one‑time-password codes are logged to the console if an SMTP server is not available.

SQL Migrations

For new environments, migrations are not needed—the Makefile creates and stamps the database schema as ready. For existing deployments, you can run:

  • Upgrade to the Latest Revision:

    env/bin/alembic -c data/development.ini upgrade head
  • View Migration History and Current Revision:

    env/bin/alembic -c data/development.ini history
    env/bin/alembic -c data/development.ini current
  • Create a New Migration Script:

    env/bin/alembic -c data/development.ini revision -m "Added email_id column to User table."
  • Autogenerate a Migration Script:

    env/bin/alembic -c data/development.ini revision --autogenerate -m "autogenerated indices."

Review the generated script before applying it.

Looking Up Paying Customers

To list paying customers, execute:

SELECT * FROM rb_pay_what_you_can
    INNER JOIN rb_user ON rb_user.id = rb_pay_what_you_can.user_id
    WHERE amount > 0 AND rb_user.stripe_id IS NOT NULL;

Python Pyramid Shell

To interact with Remarkbox’s models and database using an interactive Python shell, run:

env/bin/pshell data/development.ini

For example, the following script modifies every Node that has a Uri:

# Begin the database transaction.
request.tm.begin()

# Retrieve all Uri objects.
uris = m.uri.get_all_uris(request.dbsession)

# Update each Node.
for uri in uris:
    uri.node.has_uri = True
    request.dbsession.add(uri.node)

# Flush and commit changes.
request.dbsession.flush()
request.tm.commit()

Contributing

  • Establish communication with Russell or another admin to have your GitLab account approved.

  • Clone the repository and make commits.

  • Create merge requests; unit and headless functional tests run automatically on each commit.

  • Upon merge, changes are released to production and become visible to users.

Optional Formatting Guidelines:

  • Python: Use black (manual execution).

  • Jinja2/HTML: No formatter needed.

  • JavaScript/CSS: Use Prettier or Biome (manual execution).

Licence

All contributed code is placed in the public domain.

Original Developer: Russell Ballestrini

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remarkbox-1.0.1.tar.gz (218.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

remarkbox-1.0.1-py3-none-any.whl (265.5 kB view details)

Uploaded Python 3

File details

Details for the file remarkbox-1.0.1.tar.gz.

File metadata

  • Download URL: remarkbox-1.0.1.tar.gz
  • Upload date:
  • Size: 218.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for remarkbox-1.0.1.tar.gz
Algorithm Hash digest
SHA256 502fbdea1ba9a7fb173cd5f95b62f9d5b5d4eed6e5ba84276d0f639be7a28642
MD5 058e45fd4ca2ee07b2a17949362750e7
BLAKE2b-256 68de08178bbf833adf4d015567b644082c13a564a028befe715c912ec7b1550c

See more details on using hashes here.

File details

Details for the file remarkbox-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: remarkbox-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 265.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for remarkbox-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f8fdfb2563ac03895c7945ce717f77809ab234f48d34db1fc5ab54c736a1e7e
MD5 42ea1ee634aeebc64cfe99c00e4e8c97
BLAKE2b-256 9fb8e13c5ba5f4d459e605cb785c22e41799b162aa8406efab69edefc9910a8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page