The No APIFreestyle Cloud

Browser
REST API
Web Server
Database API
Storage
Other Clouds
Remove APIs From
Your Stack
Resources Saved
Browser
Web Server
Storage
Freestyle Cloud

JavaScript is The Database

Put @cloudstate on any class and it's properties will be stored forever and available in any request.

@cloudstate
class CloudEmailList {
  emails: string[] = [];
  add(email) {
    this.emails.push(email);
  }
  list() {
    return this.emails;
  }
}

Blob Storage

Store blobs on classes just like any other data.

@cloudstate
class MyBlobs {
  blobs: Blob[] = [];
  add(blob: Blob) {
    this.blobs.push(blob);
  }
}

RPC Layer

No need to build a REST API. Just call functions on your frontend with useCloud. Create root level classes with static ids and instances with dynamic ids.

@cloudstate
class YourClass {
  static id = "your-class";
  // or id = crypto.randomUUID();
  // ...
}

useCloud<typeof YourClass>("your-class")
  .yourFunction();

Full Stack Signals

Methods are effects. You'll be notified when their dependencies have changed allowing you to recall them as you see fit to implement complex realtime systems.

@cloudstate
class YourClass {
  @signal count = 0;
  getCount() {
    return this.count;
  }
}

const counter = useSignal<typeof YourClass>("<instance-id>");
for await (const getCount of counter.getCount) {
  console.log(await getCount());
}

Streaming Data

Leverage signals and async iterators to create efficient realtime streams.

@cloudstate
class YourClass {
  // ...
  async *countStream() {
    const counter = useSignal<typeof YourClass>(this.id);
    for await (getCount of counter.getCount) {
      yield await getCount();
    }
  }
}

const counter = useSignal<typeof YourClass>("<instance-id>");
for await (const count of counter.countStream()) {
  console.log(count);
}

Deploy in 1 Command

Deploy with a single command. No config needed.
computer:~$

freestyle deploy

Ready to try the cloud of the future?

© 2024 Freestyle