JVM-Based Serverless Application Framework

Hyper Agile Development

With Chancla.io, Java/Groovy developers can write code as quickly as PHP developers, and retain the performance of Java applications. At the heart of Chancla.io, is an optimized Groovy framework streamlined for serverless applications.

Chancla.io eliminates a significant amount of JVM boiler plate code, which allows developers to focus on writing code, and not worrying about setting up a new environment for each new project.

Real-Time Application Deployment

Chancla.io optimizes and compiles code according to JVM bytecode best practices and deploys it instantly to the cloud.

All Java libraries are managed by Chancla.io. No need to bundle JAR or WAR files to deploy your builds.

Chancla.io is truly JVM-as-a-Service!

Simple to Learn

Chancla.io allows inexperienced developers to quickly contribute software development projects since they do not need to learn the entire Java language to create production-grade JVM applications. The hyper modular nature of Chancla.io allows developers to only focus on the part of application that falls under his or her responsibility.


Try Chancla.io

Code Examples

Simple JSON Data Run in Sandbox

                                        
def jsonBuilder = new groovy.json.JsonBuilder();

jsonBuilder.customer(
  firstName: 'John',
  lastName: 'Smith',
  streetAddress: '12 Brooks Street',
  city: 'Lemoore',
  state: 'CA',
  country: 'US'
);

println(jsonBuilder.toPrettyString());  
                                
                            

Simple XML Data Run in Sandbox

                                        
import groovy.xml.MarkupBuilder;

def writer = new StringWriter();
def xml = new MarkupBuilder(new IndentPrinter(
new PrintWriter(writer), "", true));

xml.customer() { 
        firstName("John");
        lastName ("Smith"); 
        streetAddress("12 Brooks Street");
        city("Lemoore");
        state("CA");
        country("US")
};

println writer;
                                
                            

Array JSON Data Run in Sandbox

                                        
def customer = [ 
    [ getFirstName : { 'John' }, getLastName : { 'Smith' }, 
    getStreetAddress : { '12 Brooks Street' }, getCity : { 'Lemoore' }, 
    getState : { 'CA' },getCountry : { 'US' }],

    [ getFirstName : { 'Jorge' }, getLastName : { 'Lopez' }, 
    getStreetAddress : { '2 Zapato Calle' }, getCity : { 'Tijuana' },
    getState : { 'BC' },getCountry : { 'MX' }], 
    
    [ getFirstName : { 'Stymie' }, getLastName : { 'Jackson' },
    getStreetAddress : { '232 Broadway' }, getCity : { 'New York' },
    getState : { 'BNYC' },getCountry : { 'US' } ]     
];

def jsonBuilder = new groovy.json.JsonBuilder();

jsonBuilder {
    customers customer.collect { 
        [ 
            firstName: it.getFirstName(), 
            lastName: it.getLastName(), 
            streetAddress: it.getStreetAddress(),
            city: it.getCity(),
            state: it.getState(),
            country: it.getCountry()
        ] 
    }
};

println jsonBuilder.toPrettyString();
                                
                            

Simple JSON Client Run in Sandbox

                                        

import javax.net.ssl.*;
import java.security.SecureRandom; 
import groovy.json.JsonSlurper;

def sc = SSLContext.getInstance("SSL");
def trustAll = [getAcceptedIssuers: {}, checkClientTrusted: { a, b -> },
checkServerTrusted: { a, b -> }];
sc.init(null, [trustAll as X509TrustManager] as TrustManager[], 
        new SecureRandom());
HttpsURLConnection.defaultSSLSocketFactory = sc.socketFactory;
 
 
 def jsonContents = 
 "/api.nasa.gov/planetary/apod?api_key=fsPhDpBvt8trPkmhRiJBkTs7rIMpuEKOBXg1uC7V"
 .toURL().text;
 
  
def jsonSlurper = new JsonSlurper();
def json = jsonSlurper.parseText(jsonContents);

 
println "Copyright: " + json.copyright;
println "Date:  "  + json.date;
println "Explanation: " + json.explanation;
                                
                            

API Test Client (JSON Response) Run in Sandbox

                                        
import javax.net.ssl.*;
import java.security.SecureRandom; 
import groovy.json.JsonSlurper;
import groovy.json.JsonBuilder;
def sc = SSLContext.getInstance("SSL");
def trustAll = [getAcceptedIssuers: {}, checkClientTrusted: { a, b -> }, checkServerTrusted: { a, b -> }];
sc.init(null, [trustAll as X509TrustManager] as TrustManager[], new SecureRandom());
HttpsURLConnection.defaultSSLSocketFactory = sc.socketFactory;
 
 
 def jsonContents = 
 "/api.nasa.gov/planetary/apod?api_key=fsPhDpBvt8trPkmhRiJBkTs7rIMpuEKOBXg1uC7V".toURL().text;
 
  
def jsonSlurper = new JsonSlurper();
def jsonResponse = jsonSlurper.parseText(jsonContents);


class TestCaseCollection {
    String name;
    List testCases = [];
};

class TestCase {
    String name;
    String expectedValue;
    String actualValue;
    
    def passFail() {
        return (expectedValue == actualValue) ? "Pass" : "Fail";
    }
};

TestCaseCollection tcc = new TestCaseCollection(name:"Testing the Astronomy Picture of the Day API");
tcc.testCases << new TestCase(name: "Confirm Version Number",
expectedValue: "v1", actualValue:jsonResponse.service_version);
tcc.testCases << new TestCase(name: "Confirm Copyright Contains Value",
expectedValue: true, actualValue: (jsonResponse.copyright != null));
tcc.testCases << new TestCase(name: "Confirm Explanation Contains Value",
expectedValue: true, actualValue: (jsonResponse.explanation != null));


def builder = new JsonBuilder(); 


def root = builder {
    TestCaseReport {
        name  tcc.name; 
        testCases(
        tcc.testCases.collect{ 
               TestCase tc -> [expectValue: tc.expectedValue, actualValue:tc.actualValue,
                              passFail: tc.passFail()]
            }   
    )
    }
};

println builder.toPrettyString() ;
                                
                            

API Test Client (HTML Response) Run in Sandbox

                                        


import javax.net.ssl.*;
import java.security.SecureRandom; 
import groovy.json.JsonSlurper;
import groovy.xml.MarkupBuilder;

def sc = SSLContext.getInstance("SSL");
def trustAll = [getAcceptedIssuers: {}, checkClientTrusted: { a, b -> }, checkServerTrusted: { a, b -> }];
sc.init(null, [trustAll as X509TrustManager] as TrustManager[], new SecureRandom());
HttpsURLConnection.defaultSSLSocketFactory = sc.socketFactory;
 
 
 def jsonContents = 
 "/api.nasa.gov/planetary/apod?api_key=fsPhDpBvt8trPkmhRiJBkTs7rIMpuEKOBXg1uC7V".toURL().text;
 
  
def jsonSlurper = new JsonSlurper();
def jsonResponse = jsonSlurper.parseText(jsonContents);


class TestCaseCollection {
    String name;
    List testCases = [];
};

class TestCase {
    String name;
    String expectedValue;
    String actualValue;
    
    def passFail() {
        return (expectedValue == actualValue) ? "Pass" : "Fail";
    }
};

TestCaseCollection tcc = new TestCaseCollection(name:"Testing the Astronomy Picture of the Day API");
tcc.testCases << new TestCase(name: "Confirm Version Number",
expectedValue: "v1", actualValue:jsonResponse.service_version);
tcc.testCases << new TestCase(name: "Confirm Copyright Contains Value",
expectedValue: true, actualValue: (jsonResponse.copyright != null));
tcc.testCases << new TestCase(name: "Confirm Explanation Contains Value",
expectedValue: true, actualValue: (jsonResponse.explanation != null));


def writer = new StringWriter();
def xml = new MarkupBuilder(new IndentPrinter(
    new PrintWriter(writer), "", true));

xml.html() { 
        
        head {
            title ("API Test Client Developed with Chancla.io"); 
            
            style ("""
                   table {
                        border-collapse: collapse; 
                        border:1px solid #69899F;
                    } 
                    table td{
                        border:1px dotted #000000;
                        padding:5px;
                    }
                    table td:first-child{
                        border-left:0px solid #000000;
                    }
                    table th{
                       border:2px solid #69899F;
                       padding:5px;
                    } 
                    td.Fail {
                        background-color: red;
                        color:white;
                    } 
                     td.Pass {
                        background-color: green;
                        color:white;
                    }
                    
                    """);

        };
        body { 
            h1 ("Report Name: " + tcc.name);
      
            table {
                 tr{
                    th("Test Name");
                    th("Expected Value");
                    th("Actual Value");
                    th("Pass/Fail");
            }; 
                   tcc.testCases.collect{ 
                   TestCase tc ->
                   tr {
                         td(tc.name); 
                         td(tc.expectedValue);
                         td(tc.actualValue);
                         td(class : tc.passFail(), tc.passFail());
                        }; 
                       
                }; 
           };
           
           p ("API Test Client Developed with Chancla.io"); 
     };
      
};

println writer;