Welcome to Cappuccino!
Cappuccino, a web application framework in Objective-J, a superset of JavaScript, enhances web development by implementing the NeXTSTEP/Apple Cocoa APIs for web browsers. This integration supports the creation of sophisticated, desktop-class applications without imposing arbitrary complexity limits. Leveraging Cocoa’s well-established architecture, Cappuccino facilitates scalable and reliable application development. Applications can be served from any web server and deployed to any modern web browser without dependencies, offering a streamlined solution for developers.
Introduction
Cappuccino is an open-source framework continuously developed since 2008, released under the LGPL2 license. It implements as much of the proven NeXTStep/Apple Cocoa API as practicable in the modern web browser environment. Resulting applications are served as HTML, JavaScript, and CSS, allowing deployment from any web server.
Benefits of Cocoa over raw HTML/Javascript/CSS:
- Cocoa's rich selection of interface controls are abstracted to HTML, CSS, and JavaScript.
- These design patterns and APIs provide a solid foundation for application development. These proven APIs provide browser-independent functionality which is a superset of formal browser capabilities.
- Robust event-handling mechanisms ensure responsive and interactive applications.
- Internationalization and localization technologies simplify global deployment.
- Consistent and predictable behavior across different platforms enhances reliability and user experience.
- Comprehensive documentation for Objective-J is supplemented by two decades of resources for Objective-C and Cocoa. Additionally, a large public catalog of Objective-C Cocoa applications offers valuable guidance for development. Translation to Objective-J of such sample code is often trivial.
- Toolchain stability - use of proven APIs means one won't experience the churn which is all too common in the generic browser-app ecosystem.
Check out a live demo of the standard interface controls provided by Cappuccino
Check out some tutorials
For more information, see the
Bugs can be reported by creating a Github issue.
System Requirements
An HTML5 web browser is the only requirement for running Cappuccino applications. They are served as standard HTML, Javascript, CSS and images from any web server.
Any programmer's editor can be used for coding.
macOS users can use Xcode - which leverages the visual development tools from Apple for creation of complex applications with minimal coding.
Notes on the transition of Cappuccino from the Narwhal Javascript engine to NodeJS
Cappuccino compiles source code files written in Objective-J or Javascript to pure HTML/Javascript/CSS. A desktop Javascript engine with extensions for accessing local resources is required for the compilation phase. Historically, this engine was Narwhal. Over the several calendar years, a transition to NodeJS has occured. The results of this are available as a Release Candidate. While a formal production release is scheduled for early-autumn 2024, it should be considered production-ready as-is. Multiple production deployments over the last twelve months have confirmed this. In addition to the NodeJS-based toolchain, the next formal release will include multiple maintenance improvements and enhancements to the API.
To try the Cappuccino using the Node.js version, do the following:
-
Install Node.js and npm from the Node.js website.
-
Run
npm set prefix ~/.npm. This will set the default install location for npm to~/.npm. The reasoning behind this is outlined in the section about permission issues below. -
Add this line to your
.zshrcor equivalent config file.export PATH="~/.npm/bin:$PATH" -
Restart your shell.
-
Run
npm install -g @objj/cappuccino. -
Done! See below for basic usage.
Permisson issues
By default npm uses /usr/local/lib/node_modules as the install location for globally installed packages. This causes
problems since users typically lack write permissions there. It is therefore recommended to either use a version
manager, or change npm's default install location manually (which is what we did above). For more details on how to do
this, see this article.
Basic usage
On successful installation, follow these steps to create a basic and fully-functional Cappuccino application:
capp gen HelloWorldcd HelloWorldpython3 -m http.server- Go to
localhost:8000in your web browser.
Building Cappuccino from source
If you want to build Cappuccino from source you should clone the GitHub repository at
https://github.com/cappuccino/cappuccino/ and checkout the node branch. Then you can use the command
jake install to install Cappuccino and its tools locally.
To build from source, do:
-
git clone https://github.com/cappuccino/cappuccino.git -
cd cappuccino -
git checkout node -
npm install -
Make any desired changes to the codebase.
-
Make sure the environment variable
CAPP_BUILDis set. This is done by adding the lineexport CAPP_BUILD="/path/to/cappuccino/build/directory"to your
.zshrcor equivalent config file and of course changing the path to where you want to build Cappuccino. -
Run
jake installto build and install Cappuccino.
Beware that building and installing Cappuccino from source will overwrite the binaries installed from npm. To undo this,
simply run npm install -g @objj/cappuccino again.
Getting Started
To write you first application, download the starter package.
To try our new Node (alpha) version of the Cappuccino framework, check the Node installation instructions
To contribute to Cappuccino, please read here: Getting and Building the Source.
License
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA