Skip to main content

About

What is Foscia?

Type safe, modular and intuitive API/data client for JS/TS.

Foscia acts as an intermediary layer between your application and your data source (API, database), just like an ORM would. It helps keeping your data structure clear and type safe with simple models definition and provide a lot of useful tools to make common tasks easier (changes tracking, hooks, serialization, etc.), allowing you to focus on your features! It is built with functional programming in mind, has a clear and complete API and is fully tree-shakable. It is framework-agnostic and can integrate inside any app using JavaScript or TypeScript, and with any data source, with already implemented HTTP/REST/JSON:API exchanges.

  • Exchange with any REST or JSON:API backend with already implemented adapters.
  • Modular with simple configuration and framework-agnostic.
  • Fully tree-shakable for optimal build size.
  • Strong type your data structure with TS.
  • Record changes on data during lifecycle with instance's snapshots.
  • Register hooks, such as saving or deleting.
  • Never re-fetch data thanks to the cache system.
  • Get started quickly with the built-in CLI.
  • Free and open-source under MIT license

How does it integrate in your app?

Foscia acts as an intermediary layer between your application and your data source (API, database), just like an ORM would.

You define your data structure using models (attributes, relations), customize your data interactions using actions (serialization, etc.) and can directly get a smooth and clear exchange with your data source.

Starting point

You may start to discover Foscia from different point of view.

  • Install the package to use it immediately
  • Get started using our simple guide about interacting with a JSON:API or REST API
  • Check out examples built with Foscia to know if the API fits your needs

Available packages

  • @foscia/core: core features of Foscia (models, actions, hooks, etc.)
  • @foscia/http: HTTP adapter implementation
  • @foscia/jsonapi: JSON:API implementation
  • @foscia/rest: REST implementation
  • @foscia/serialization: data serialization and deserialization partial implementation
  • @foscia/test: testing utilities