Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

AtomicLunchbox/orderthis

Repository files navigation

OrderThis

History & Legacy

Original Author: Christopher Sharrer

Original Entity: Luminous Chao, Inc.

Context: OrderThis (originally developed under the com.lc23 package) served as the backbone for a family of branded garden tool e-commerce stores. It was designed to be a lightweight, robust alternative to the heavy enterprise platforms of the era.

This project is dedicated to the memory of Christopher Sharrer. It is being released as open source to preserve the craftsmanship of the original engine and to provide a reference for lightweight Java/JSP architecture.

OrderThis handles the full shopping flow — catalog browsing, cart management, checkout, payment processing, and order storage — as a self-contained web application.

The payment gateway integration has been replaced with a stub that always returns SUCCESS. No real charges are made.

Features

  • Session-based shopping cart with quantity updates and item removal
  • Multi-step checkout: cart → billing/payment form → review → confirmation
  • Payment processor stub (always approves) for demo and testing
  • Rule-based shipping and tax calculation from plain-text rate tables
  • CSV product catalog (no database required)
  • Order and transaction records written to the filesystem
  • Coupon and express shipping support
  • Response filters: blank-line compression, GZIP, link rewriting, JSON escaping, expires headers

Project Layout

src/                          Java source
  com/lc23/
    cache/                    In-memory and disk order cache
    counter/                  Lightweight request counters
    crosscontext/             Shared Tomcat cross-context lock (deploy to shared/lib)
    database/                 CSV catalog reader (ItemList, Item)
    email/                    Order confirmation email templating
    forms/                    Form-to-object binding (Payment, Checkout)
    http/                     Servlets (OrderServlet, DataServlet, WebApp listener)
      filters/                Servlet filters (GZIP, BlankLine, LinkFix, JsonEscape, Expires, Redirect)
    io/                       Filesystem utilities (numbered order files)
    io/pbe/                   Password-based encryption utilities
    order/                    Order lifecycle (status, completion, templates)
    payment/                  PaymentProcessor stub (gateway removed for open source release)
    rates/                    Rate table loaders (shipping, tax, coupon, express)
    tags/                     JSP tag library
    util/                     String, date, logging, and crypto utilities
    Order.java                Core order domain object
    OrderItem.java
    OrderRequest.java         URL routing and request lifecycle
    ...

demo/                         Runnable demo web application
  *.jsp                       JSP pages (catalog, cart, checkout, confirmation)
  admin/                      Admin interface JSPs (login, dashboard, orders, shipping, transactions)
  data/demo-items.csv         Sample product catalog
  WEB-INF/
    web.xml                   Servlet configuration
    properties.txt            Demo site configuration (generated paths)
    defaultProperties.txt     Default values for all properties

shared-data/                  Shared data files provisioned at runtime
  states.csv                  US states list
  shipmethods.csv             Available shipping methods
  orderstatuses.csv           Order status codes
  templates/                  Order completion email templates

tomcat-users.xml              Sample Tomcat auth config (admin/admin)
build.gradle                  Gradle build with embedded Tomcat demo runner
settings.gradle

Order Flow

GET  /                            Catalog (index.jsp)
POST /order/add/{CODE}            Add item to cart
GET  /order/cart                  Shopping cart (order2.jsp)
GET  /order/checkout/secure       Billing and payment form (order3.jsp)
POST /order/review                Submit checkout form
GET  /order/review/secure         Review order before placing (order4.jsp)
POST /order/receipt               Place order
GET  /order/receipt/secure        Confirmation page (order5.jsp)

Admin Interface

The admin interface is at /admin/ and uses form-based session login. Navigate to /admin/login.jsp and log in with the default credentials.

Default credentials: admin / admin — change before any real deployment.

Page URL Description
Login /admin/login.jsp Admin sign-in form
Dashboard /admin/ Links to all admin sections
New Orders /admin/neworders.jsp Lists unprocessed orders waiting to ship
Order Status /admin/orderstatus.jsp Look up any order by number or OID
Ship Orders /admin/ship.jsp Update order status, ship method, and tracking
Transactions /admin/transactions.jsp Browse payment batch history
Logout /admin/logout.jsp Invalidate session

Building and Running the Demo

Prerequisites: Java 8+, Gradle

Start the demo (downloads Tomcat 9, builds WAR, deploys, and starts):

gradle start

Open the store:

http://localhost:8080/orderthis/

Stop the server (from a second terminal):

gradle stop

The gradle build task alone produces build/libs/orderthis.war for manual deployment to any Tomcat 6+ instance.

Configuration

Runtime configuration is loaded from two files in WEB-INF/:

  • defaultProperties.txt — defaults for all settings; safe to leave as-is
  • properties.txt — site-specific overrides (the demo version is pre-configured)

Key properties:

Property Description
base.path Root directory for order/transaction/rate file storage
shared.path Directory for shared templates and server.properties
image.path Directory for product images
data.file Path to the product catalog CSV
store.name Display name of the store
store.domain Domain used in emails and links
use.https Whether to enforce HTTPS for secure pages
required.fields Comma-separated list of mandatory checkout fields
use.coupon Enable coupon code entry at checkout

${base.path} must contain the following writable directories at runtime:

  • data/ — product catalog
  • orders/ — order files
  • transactions/ — transaction logs
  • rates/ — rate tables (ships.txt, taxes.txt, coupons.txt, express.txt)
  • images/ — product images
  • postage/, shipping/ — postage and shipping data

${shared.path} must contain:

  • data/server.properties — must exist; set production=false for test/demo mode
  • templates/ — order completion email templates
  • log/ — writable log directory

The gradle start task creates all of these automatically under /tmp/orderthis-demo/.

Payment Processor

The proprietary payment gateway integration has been removed for open source release. PaymentProcessor.java contains this note and returns a stub SUCCESS result for all transactions:

// Proprietary payment implementation removed for open source release.
// processTransaction() and processOrder() return a stub SUCCESS result.

To integrate a real payment processor, replace the bodies of processTransaction() and processOrder() in com.lc23.payment.PaymentProcessor.

License

MIT License Copyright (c) 2016 Marcia DiVerde. Portions Copyright Luminous Chao / Christopher Sharrer. See LICENSE.

About

Historical archive of a light weight e-commerce platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages