#Can we use Astro for something else than websites?

4 messages · Page 1 of 1 (latest)

sterile portal
#

Hello, I know it will sound a bit weird, but I want to use Astro as a backend. I mean that I don't want to use it to make a website. I'm working on a workflow automation engine framework, and there's a lot of stuff that Astro does that would be relevant for a workflow automation engine (such as Content Collections and AstroDB).

But, from my understanding, Astro is mostly a static website builder. I'm worried it can't be used as a server. I'm using node's built in event API under the hood (to trigger different workflows based on specific events) and I fear it might not work on astro...

inland lindenBOT
#

Hi @sterile portal. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Astro is primarily designed as a web framework for building content-driven websites, with a strong focus on server-side rendering, performance, and features like Content Collections and Astro DB. Its core design principles and documentation emphasize building websites—especially static sites, marketing pages, blogs, and e-commerce sites—where content delivery and fast load times are critical priorities. Astro’s architecture is optimized for these use cases, and its features are tailored to web development needs, not general-purpose backend or workflow automation frameworks Why Astro?.

However, Astro does support server-side features, such as on-demand rendering, API endpoints, and integrations with databases (like Astro DB, Supabase, Turso, etc.), and you can deploy Astro as a Node.js server using the official Node adapter @astrojs/node. This means you can run backend logic, define API endpoints, and interact with databases within an Astro project.

That said, the knowledge sources do not mention using Astro as a general-purpose backend framework or for non-website use cases like workflow automation engines. There is no documentation or guidance on using Astro as a replacement for backend frameworks such as Express, Fastify, or workflow automation tools. Features like Content Collections and Astro DB are tightly coupled to Astro’s web-focused architecture.

Regarding Node.js event APIs: since Astro can run on Node.js (with the Node adapter), you technically have access to Node APIs, but the documentation does not provide details or guarantees about using Node’s event system for complex backend workflows within Astro.

#

In summary:
Astro is not intended or documented for use as a general-purpose backend or workflow automation engine. While you can leverage some backend features and Node.js APIs, the framework is optimized for building websites, and using it outside this context may lead to limitations or unsupported scenarios. If your primary goal is backend automation, a dedicated backend framework may be a better fit Why Astro? @astrojs/node.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: