Achieve 3 Advanced Examples
This archive contains six complete demonstrations of Achieve 3: MySQL, WebSockets and Rooms, Node clustering, XML/SAX streaming, distributed computing, and SOAP services.
You do not need an existing Achieve installation or an
adjacent development checkout. npm install installs Achieve and
the supporting packages used by the examples.
Requirements
- Node.js 22 or a later compatible Node.js release.
- npm, included with Node.js.
- A terminal such as PowerShell, Command Prompt, or a Unix shell.
Extract and install
- Choose an ordinary location and extract the ZIP file there.
- Extraction creates one directory named
achieve_examples. - Open a terminal in that directory.
- Install the dependencies and start the default server:
npm install
npm start
Open http://localhost:8989/ in a browser. The landing page links to the examples available through the default server, including XML/SAX streaming and the confirmation servlet.
The nested application/ directory is the Achieve application
space. Startup files, package metadata, installed packages, and this guide
remain outside the HTTP-visible application space.
Specialized demonstrations
Stop the current server before starting another demonstration that uses the same port. Press Ctrl+C in the terminal to stop a server.
| Demonstration | Command | Ports | Extra requirement |
|---|---|---|---|
| WebSockets and Rooms | npm run start:websockets | 8989 | None |
| Node clustering | npm run start:cluster | 8989 and 8990 | None |
| Distributed computing | npm run start:distributed | 8989 and 8990 | None |
| SOAP services | npm run start:soap | 8989 and 8990 | None |
XML/SAX streaming and the confirmation servlet run with the default
npm start command.
Optional MySQL setup
The MySQL demonstration requires a reachable MySQL server. The rest of the distribution does not require MySQL.
In phpMyAdmin, use the Import tab to import
application/advanced/mysql/setup.sql. The SQL file is imported,
not executed as a program. It creates the achieve_demo database
and its users table. Then replace the placeholder user name and
password in both servlets under
application/advanced/mysql/servlets/. Run npm start
and open or refresh the MySQL demonstration from the landing page.
The credentials and login logic are deliberately simple demonstration code; they are not production authentication guidance. Do not commit or share real credentials.
Troubleshooting
- If
npm installreports thatachieve@3cannot be found, verify that Achieve 3.0.0 or a later compatible version is available from the npm registry. - If port 8989 or 8990 is already in use, stop the other server or process
before starting a demonstration. For local testing, the launchers accept
ACHIEVE_EXAMPLES_PORTandACHIEVE_EXAMPLES_SECONDARY_PORToverrides, although some pages and service descriptions use the default ports. - Run commands from
achieve_examples, wherepackage.jsonis located. - For MySQL connection failures, confirm that the server is running,
setup.sqlhas been applied, and both servlet credential blocks are correct. - Use the specialized launcher listed above if a feature is unavailable from the default server.
Cluster and distributed launchers create child processes. Allow shutdown to finish before starting the next example.
Achieve documentation
For tutorials and the complete API Reference, see the Achieve 3 documentation.