You are previewing Opa Application Development.
O'Reilly logo
Opa Application Development

Book Description

A rapid and secure web development framework to develop web applications in Opa

  • Discover the Opa framework in a progressive and structured way

  • Build secure, powerful web applications with Opa.

  • Create three complete web application demos with Opa.

In Detail

Opa is a full-stack Open Source web development framework for JavaScript that lets you write secure and scalable web applications. It generates standard Node.js/MongoDB applications, natively supports HTML5 and CSS and automates many aspects of modern web application programming. It handles all aspects of web programming written in one consistent language and compiled to web standards.

Opa Application Development is a practical,hands-on guide that provides you with a number of step-by-step exercises. It covers almost all aspects of developing a web application with Opa, which will help you take advantage of the real power of Opa, as well as building a secure, powerful web application rapidly.

Opa Application Development dives into all concepts and components required to build a web application with Opa. The first half of this book shows you all of the basic building blocks that you will need to develop an Opa application, including the syntax of Opa, web development aspects, client and server communication and slicing, plugin, database, and so on. By the end of the book you will have yourself created a complete web application along with a game: Pacman!

Table of Contents

  1. Opa Application Development
    1. Table of Contents
    2. Opa Application Development
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Started with Opa
      1. Installing Opa
        1. Installing Node.js
        2. Installing the required modules
        3. Installing the Opa compiler
        4. Testing the installation
      2. Setting up editors
        1. Sublime Text
        2. Vim
        3. Emacs
      3. Your first Opa application
      4. Summary
    9. 2. Basic Syntax
      1. Basic datatypes
        1. Integers
        2. Floats
        3. Strings
        4. Sum
      2. Functions
        1. Last expression return
        2. Modules
      3. Data structures
        1. Records
          1. Tuples
        2. Lists
          1. Iterating through a list
          2. Finding elements
          3. Transforming lists
          4. Sorting a list
        3. Maps
      4. Pattern matching
      5. Text parsers
      6. Summary
    10. 3. Developing Web Applications
      1. Starting a web server
        1. A simple example
        2. The server module
      2. Dispatching requests
        1. The resource handler
        2. The dispatch handler
        3. The register handler
        4. The customize handler
        5. The handlers group
      3. Preparing pages
        1. XHTML
        2. Creating a page
        3. Adding styles
        4. Handling events
      4. Manipulating DOMs
        1. DOM selection
        2. Reading values
        3. Updating content
        4. Binding an event handler
        5. Animations
      5. Summary
    11. 4. Using Bootstrap
      1. Importing Bootstrap
      2. Using classes
      3. Using icons
        1. Bootstrap icons
        2. Font Awesome icons
      4. Using widgets
      5. Summary
    12. 5. Communicating between Client and Server
      1. Client and server slicing
        1. A simple example
        2. Slicing annotations
        3. Module slicing
        4. Expression slicing
      2. Client and server communication
        1. Session
        2. Cell
        3. Network
      3. Summary
    13. 6. Binding with Other Languages
      1. Binding JavaScript
        1. The first example
        2. Using external types
      2. Binding Node.js
      3. Binding external functions using the classic syntax
      4. Summary
    14. 7. Working with Databases
      1. A quick start to MongoDB
      2. Database manipulation
        1. Records
        2. Lists
        3. Sets and maps
      3. Querying data
      4. Summary
    15. 8. Internationalization
      1. Internal approach
      2. External approach
      3. Summary
    16. 9. Building a Chat Application
      1. Creating a project
      2. Launching the web server
      3. Designing user interface
      4. Building application logic
      5. Broadcasting and receiving messages
      6. Summary
    17. 10. Building a Game – Pacman
      1. The project structure
      2. The HTML5 Canvas
      3. Drawing a shape
        1. Using the fill and stroke properties
        2. Drawing a curve
      4. Drawing an image
      5. Drawing the text
      6. Binding the external JavaScript library
        1. Preloading the resources
        2. Playing sounds
      7. Summary
    18. 11. Developing a Social Mobile Application – LiveRoom
      1. Project structure
      2. Authorizing a user
        1. Signing in and signing out
        2. Signing in with Facebook
      3. The application
        1. Listing topics
        2. Creating a topic
        3. Posting messages and comments
        4. Designing for mobile devices
      4. Summary
    19. Index