Coder Social home page Coder Social logo

build Join the chat at https://gitter.im/cappuccino/cappuccino

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 in continuous development since 2008 and released under the LGPL2 license. It implements as much of the proven NeXTStep/Apple Cocoa API as is feasible and appropriate for the modern web browser environment.

Benefits of Cappuccino's Cocoa implementation:

  • Cross-platform development – any programmer's text editor or IDE is sufficient. The compiler and other parts of the toolchain required to prepare applications for deployment are hosted by Node.js.
  • Cocoa's rich range of interface controls are abstracted to HTML, CSS, and JavaScript. These go well beyond the functionality provided by current browser standards, and only require minimal HTML5 support.
  • These design patterns and APIs provide a solid foundation for application development. The APIs have been proven over forty years and provide browser-independent functionality which is a superset of current browser capabilities.
  • Custom interface controls can reliably build on basic Cocoa controls if extended or new functionality is required.
  • Robust event-handling mechanisms, a superset of those provided by current browsers, ensure responsive and interactive applications.
  • Internationalization and localization technologies simplify global deployment.
  • Consistent and predictable behavior across different platforms enhances reliability and user experience.
  • Objective-J's message-passing architecture, which the Cocoa APIs leverage, promote loose coupling of an app's component functionality — making large scale development more managable.
  • Comprehensive documentation for Objective-J is supplemented by over 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 of such sample code to Objective-J is often trivial.
  • Toolchain stability – use of time-tested APIs means an absense of the churn which is all too common in the current 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 and enhancement requrests can be reported by creating a Github issue.

System Requirements

  • A minimally HTML5-compliant 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 Node.js

Cappuccino compiles source code files written in Objective-J to pure Javascript but can run Objective-J also directly in the browser. A desktop Javascript engine with CommonJS for accessing local resources is required for the compilation phase. Historically, this engine was Narwhal. A transition to Node.js is being finalized. The results of this transition 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 Node.js-based toolchain, the next formal release will include multiple maintenance improvements and enhancements to the API.

To try Cappuccino using the Node.js version, do the following:

  1. Install Node.js and npm from the Node.js website or the OS-specific package manager of your choice. Long-term Support (LTS) versions are supported although others will probably work as intended.

  2. 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.

  3. Add this line to your .zshrc or equivalent config file.

    export PATH="~/.npm/bin:$PATH"
  4. Restart your shell.

  5. Run npm install -g @objj/cappuccino.

  6. 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 with the npm set prefix… command). For more details see this article.

Basic usage

On successful installation, follow these steps to create a basic and fully-functional Cappuccino application:

  1. capp gen HelloWorld
  2. cd HelloWorld
  3. python3 -m http.server (any local http server can be used)

Building Cappuccino from source

To build Cappuccino from source clone the GitHub repository at https://github.com/cappuccino/cappuccino/ and checkout the main branch. Use the command jake install to install the Cappuccino frameworks and toolchain locally.

To build from source, do:

  1. git clone https://github.com/cappuccino/cappuccino.git

  2. cd cappuccino

  3. npm install

  4. Make any desired changes to the codebase.

  5. Make sure the environment variable CAPP_BUILD is set. This is done by adding the line

    export CAPP_BUILD="/path/to/cappuccino/build/directory"

    to your .zshrc or equivalent config file and of course changing the path to where you want to build Cappuccino.

  6. Run jake install to 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.

FAQs

Q: Can I use Cappuccino on Windows/Linux?
A: Yes, Cappuccino can be used on Windows or Linux. While Cappuccino technology is inspired by Apple's Cocoa framework, it is designed to be platform-independent. As long as you have a modern web browser and a compatible development environment (An LTS version of Node.js and an http server), you can develop and deploy Cappuccino applications on other operating systems without any issues.

Q: Has Apple not moved away from Objective-C and Cocoa, making this a dead end?
A: While Apple has introduced Swift as a modern language and shifted focus to frameworks like SwiftUI, Objective-C and Cocoa remain widely used and supported. Cappuccino leverages the mature and proven Cocoa architecture, which continues to be relevant for many applications. Additionally, Cappuccino’s design abstracts these technologies to the web, ensuring that developers can create robust web applications regardless of Apple’s evolving ecosystem.

Q: What is with the funny syntax of Objective-J and its brackets? I've never seen a language like this – how can anyone be productive with something so strange?
A: Objective-J’s syntax, with its brackets, is inspired by Objective-C, which has been used for decades in developing macOS and iOS applications. While it may seem unusual initially, it provides a powerful way to structure code and manage objects. Developers familiar with Objective-C will find it intuitive, and those new to it can leverage extensive documentation and community resources. The initial learning curve is offset by the productivity gains in building complex, maintainable web applications.

Q: I have my own HTML, JavaScript, and CSS I'd like to use in a larger app. I don't see any JavaScript, HTML, or CSS in the sample code available. How do I modify the DOM?
A: Cappuccino abstracts much of the DOM to align with Cocoa's model. Existing Cocoa controls can be extended or new ones built from scratch to meet specific requirements. The Cocoa APIs follow a classic object-oriented programming model – most necessary functionality will be inherited from the Cappuccino base class one is starting with. The CPWebView control can also be used to embed either HTML/Javascript/CSS fragments or entire web pages.

Q: What are the advantages of Cappuccino over libraries and frameworks like React and Vue?
A: Cappuccino offers several advantages:

  • Cocoa Architecture: Leverages the mature and robust Cocoa APIs, providing a solid foundation for complex applications.
  • Object-Oriented Approach: Uses Objective-J, which extends JavaScript with powerful object-oriented capabilities.
  • Desktop-Class Usability: Complex controls, coherent keyboard navigation and undo/redo out of the box.
  • Unified Framework: Integrates UI components, event handling, and data management in a cohesive package.
  • Legacy and Stability: Continuous development since 2008 ensures stability and reliability.

Q: I've heard claims about Objective-C and Cocoa providing increased productivity – how true is this?.
A: Objective-C and Cocoa are designed for efficiency and ease of use. Their mature, well-documented APIs and comprehensive frameworks enable rapid development of robust applications. The object-oriented nature of Objective-C promotes code reuse and modularity, while Cocoa’s design patterns streamline common tasks. Developers often find that these features collectively lead to increased productivity, especially for complex, desktop-class applications.

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

Cappuccino's Projects

acorn-issue-handler icon acorn-issue-handler

Framework for collecting and formatting warnings/errors generated by acorn-based parsers/compilers

cappuccino icon cappuccino

Web Application Framework in JavaScript and Objective-J

cappuccino-old-website-2012 icon cappuccino-old-website-2012

This is some of the source for the 2012 and earlier versions of cappuccino.org. This site has been replaced by cappuccino-project.org and this repository is maintained only for historical reference purposes.

cappuccino-package icon cappuccino-package

Objective-J and Cappuccino CommonJS package, for source code visit http://github.com/280north/cappuccino/

cucapp icon cucapp

Use Cucumber to test Cappuccino applications.

mapkit icon mapkit

A Google Maps API abstraction layer written for Cappuccino

objective-j-package icon objective-j-package

Objective-J CommonJS package, for source code visit http://github.com/280north/cappuccino/

objj-acorn icon objj-acorn

A tiny, fast JavaScript and Objective-J parser with built in preprocessor. Written in JavaScript.

objjc icon objjc

JavaScript and Objective-J compiler

ojunit icon ojunit

OJUnit - Original unit testing framework for Objective-J. Soon to be deprecated in favor of http://github.com/280north/ojtest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.