Freestyle
Try with SvelteKitTry with Solid StartTry with AstroTry with React Native
DocsGet a Demo

The TypeScript native cloud.

Replace Express, Mongo, Postgres, Kafka, S3, Socket.io, Auth0 and more with standard APIs already built into TypeScript.


Backed ByFreestyle logo

Use APIs you already know

Rather than adding new opinionated APIs for functionality like persistence, streaming and blob storage, Freestyle leverages the APIs already built into ecmascript standards.

TypeScript 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: string) {
    this.emails.push(email);
  }
  list() {
    return this.emails;
  }
}

Own your infrastructure

Freestyle is built to encourage open source collaboration. Rather than relying on external services for things like authentication, Freestyle provides a foundation that full stack packages can be built on top of.

Authentication

Instead of using an auth provider like Auth0, you can use our open source freestyle-auth package.


import { PasskeyAuthentication } from "freestyle-auth";

@cloudstate
class AuthenticationCS extends PasskeyAuthentication {
  static id = "auth" as const;

  override _createUser() {
    return new UserCS(crypto.randomUUID(), "", "");
  }
}

@cloudstate
export class UserCS {
  constructor(
    public id: string,
    public username: string,
    public image: ImageCS,
    public displayName?: string
  ) {}

  _assertSelf() {
    const auth = useLocal(AuthenticationCS);
    const user = auth.getCurrentUser();
    if (user !== this) throw new Error("You do not have permission for this operation.");
  }

  setDisplayName(displayName: string) {
      this._assertSelf();
      this.displayName = displayName;
    }
  }
}

import { PasskeyAuthenticationModal } from "freestyle-auth/react";

export function SignInPage() {
  const auth = useCloud<typeof AuthenticationCS>("auth");
  return (
    <PasskeyAuthenticationModal
      auth={auth}
      onSignedIn={() => {
        window.location.href = "/dashboard";
      }}
    />
  );
}

Deploy everything in 1 command.

No config needed.
computer:~$

npx freestyle deploy


Browser
REST API
Web Server
Database API
Storage
Other Clouds
More than half of code is wasted API boilerplate.
Resources Saved
Browser
Web Server
Storage
Freestyle Cloud

Ready to try the cloud of the future?

© 2024 Freestyle