# Darkwave Documentation > Darkwave is a batteries-included toolkit for building data-driven web applications with Astro. > A meticulously curated selection of reliable and approachable tools, combined into a professional-grade full-stack boilerplate with pre-wired functionality and components for common SaaS and CRUD features. Site: https://darkwavejs.com Docs: https://darkwavejs.com/docs Field Guide: https://darkwavejs.com/fieldguide --- # Docs ## Ethos URL: https://darkwavejs.com/docs/ethos **On a scale of skateboard to aircraft carrier, it's a cargo van.** DW doesn't solve every problem, but it has really good solutions for the problems it does solve. Think Toyota 4Runner: reliable, dependable, useful, just works, still a delight to use. ## Guiding Principles - **Pragmatic solutions using boring techniques** - Professional, maintainable solutions without unnecessary complexity - **Code that is easy to understand** - Clarity over cleverness - **Proven, stable patterns** - Over bleeding-edge features - **Long-term maintainability and reliability** Code should be easy to write and easy to read. Basic and simple, no frills. ## Conventions over Configuration DW sets standards: we use Kysely, MySQL, Tailwind, shadcn. If you're using DW, you're not using Prisma or Drizzle. ## Design Goals - Easy to learn (help teams get up to speed quickly) - Efficient (enable tasks to be completed as quickly as possible) - Consistent (prevent teams from wasting time relearning) - Transparent (allow bugs to be diagnosed and solved easily) - Resilient (ensure what works today also works next year) - Perfectly suited for quick prototyping with reliable results ## What We're Building A robust system boilerplate that's easy to modify and maintain. Do the predictable obvious thing, nothing too clever. Designed to be flexible enough to fit a variety of use cases and work with a variety of services (hosting providers, CDN, image storage, mailers). Goal: make it just as easy to build a custom CRUD app as it is to configure a generic CMS. --- ## Who needs it? URL: https://darkwavejs.com/docs/who DW is designed to be approachable and beginner-friendly, but it's intended for professional software developers building custom applications for clients. If you like the idea of Rails or Laravel but want to write JavaScript without being too restricted, this is for you. DW provides structure and guidance without excessive constraints. ## Ideal Projects DW is most useful for: - Internal tools and intranets - Company/organization portals - Custom ERP software - Bespoke web applications - Content management systems - B2B SaaS applications Particularly suited for managing user-generated content, especially images. Astro is already designed for content-driven websites; DW excels at managing user-generated content. ## Built to Ship A JavaScript stack for solo devs who ship. Good for building turn-key SaaS businesses. Useful for both large enterprise apps and small custom sites. --- ## Why? URL: https://darkwavejs.com/docs/why ## Why does this exist? I've tried many frameworks and CMSs over the years, and they all felt cumbersome and unwieldy. Web development doesn't need to be so hard. Sure there's complexity involved, but it doesn't need to be nearly as difficult as people make it. The majority of development problems are already solved. A clean system that combines the basic functionality will handle 80% of the problems, letting you spend energy on what matters most. The real value of DW (and any framework) is that the big decisions are made for you. I've thought long and hard about these solutions and settled on pragmatic decisions with a few key principles: - Keep architecture as simple as possible - Keep the workflow simple too - Make boring decisions (avoid being overly clever) ### Focus on Development Speed - Don't get lost in the weeds solving problems you don't need to solve - Get "table stakes" functionality without having to invent it: 2FA, image uploads, job queues, email service - Focus on building complex features fast and shipping ## Why would I use it? If you've bemoaned the time and effort to set up auth, this is for you. If you've thrown objects across the room while trying to get photo uploads working with cropping, this is for you. If a client has asked you to build a bespoke back office system, this is for you. This is especially for you if you want to build something well-thought-out and reliable without having to think about it. ## Why this technology? ### Why Astro? - Beginner-friendly with an easy dev workflow - Use React, Vue, or Svelte components if you want - Clean organization, easy enough to make it what you need - Easy enough deployment story ### Why Node? - It's everywhere with tons of integrations - Easy to set up locally - More secure on a VPS than PHP apps ### Why TypeScript? Full disclosure: I don't love TypeScript. For 10 years DW was written in PHP and it was great. But here I am, using TypeScript for new apps. The ecosystem is huge with tons of free libraries. It's easier than it used to be. Fast enough processing, reliable architecture. IDEs love it with type definitions and click-through function references. TypeScript is also great for AI-assisted development. You can write apps with this stack incredibly fast using Claude and Cursor. ### Why shadcn? We embraced React specifically to use shadcn. The React ecosystem is hard to beat - the React version of any given tool is almost always the most well-designed. Maintaining your own component library is torture. We want to rely on people doing this as their main focus, solving hard problems with industry-standard solutions. ### Why these specific tools? There's so much stuff out there, and not all of it is good. DW uses carefully vetted dependencies. We try to make the most "normal" decisions - straightforward and obvious choices, not too clever. Do what you can with the provided libs (Alpine, Tailwind, etc.) before reaching for anything else. --- ## ButtonDelete URL: https://darkwavejs.com/docs/components/buttondelete Delete button with confirmation dialog. ## Usage ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `text` | string | Button text | | `confirmTitle` | string | Confirmation dialog title | | `confirmText` | string | Confirmation dialog message | | `endpoint` | string | API endpoint for deletion | | `redirectUrl` | string | URL to redirect after deletion | --- ## ButtonLink URL: https://darkwavejs.com/docs/components/buttonlink Styled anchor link component. ## Usage ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `href` | string | Link destination | | `text` | string | Link text | | `variant` | string | Style variant (primary, secondary, outline) | | `target` | string | Link target (_blank, etc.) | --- ## ButtonSubmit URL: https://darkwavejs.com/docs/components/buttonsubmit Form submission button with loading states and success feedback. ## Usage ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `text` | string | Button text | | `workingText` | string | Text shown while submitting | | `showSuccessAlert` | boolean | Show success alert | | `successButtonText` | string | Text after successful submit | | `successButtonResetDelayMs` | number | Delay before resetting button | | `form` | string | Form selector | | `endpoint` | string | API endpoint for submission | --- ## Hello, Cruel World URL: https://darkwavejs.com/docs Darkwave is a batteries-included toolkit for building data-driven web applications with Astro. A meticulously curated selection of reliable and approachable tools, combined into a professional-grade full-stack boilerplate with pre-wired functionality and components for common SaaS and CRUD features. ## Full stack web apps with Astro Building full stack apps with Astro can be fun and rewarding. Astro is beginner-friendly while being robust and capable of supporting professional functionality. ## DW = Don't Worry **We help you get started faster.** The bulk of technical decisions are already made. Focus on the things that make your app unique. Fewer decisions means fewer opportunities to overthink and over-engineer. Build your project quickly. Spend more time with your family and friends. ## It's all about the workflow DW is less of a technical framework and more of a methodology for building functionality in a modular way that is both understandable and maintainable. A pragmatic approach to developing high quality data-driven applications quickly and reliably. --- ## What is this? URL: https://darkwavejs.com/docs/what Darkwave is three things: 1. **The Stack** - A pre-wired configuration of frameworks, libraries, and dev tools 2. **The Boilerplate** - A starter kit with auth, middleware, and extendable admin 3. **The Philosophy** - Guiding principles for building maintainable applications In practice, Darkwave is just a starter kit for Astro. At a higher level, it's [an entire paradigm](/docs/ethos) for building web applications. ## The Stack A pre-wired configuration of specific frameworks, libraries, and dev tools. Straightforward, responsible choices for building reliable CRUD apps. You don't have to deal with the foundational minutiae of starting a new project. The boring problems are solved: we've done the research, evaluated options, and put together a good starting point. ### Core Stack - [Astro](https://astro.build) (SSR with [Node.js](https://nodejs.org/) adapter and [TypeScript](https://www.typescriptlang.org/) support) - [MySQL](https://www.mysql.com/) (8.0) with [Kysely](https://kysely.dev/) query builder - [Better-Auth](https://www.better-auth.com/) - [Tailwind CSS](https://tailwindcss.com/) with [shadcn/ui](https://ui.shadcn.com/) ### Supporting Libraries - [Alpine.js](https://alpinejs.dev/) - [HTMX](https://htmx.org/) - [Cropper.js](https://fengyuanchen.github.io/cropperjs/) - [Dropzone](https://www.dropzone.dev/) - [Flatpickr](https://flatpickr.js.org/) - Date picker - [SortableJS](https://sortablejs.github.io/Sortable/) - [Validator.js](https://github.com/validatorjs/validator.js) - [Iconify](https://iconify.design/) - [Nodemailer](https://nodemailer.com/) ## The Boilerplate ### Application Structure - Middleware configuration - Config management - Database schemas - Default CSP, CSRF validation for forms - Environment variable handling - Alias imports (`@/` path resolution) ### Authentication System - JWT-based authentication middleware - Role-based access control - OAuth configured with Google login - Login/register templates wired with Better-Auth and Nodemailer ### Components - Form UI components - Form and input validation - Photo uploads and gallery management - File upload handling with storage providers (S3/R2, Bunny.net, local filesystem) - Image processing (optimization, cropping) ### Backend Utilities - CRUD abstraction helpers - Email notification components ### Admin App - Simple base you can extend as needed - Or ignore entirely ## The Philosophy DW codifies best practices in a way that others can understand and follow. Clear coding standards with enough examples between the codebase and docs to understand how to build with this toolkit. --- ## Vibes URL: https://darkwavejs.com/docs/vibes A meme is worth a thousand manifestos. ![every app is just crud & permissions](/images/crud-busmeme.jpg) ## Modular Building Blocks Pre-wired full-stack components with purpose-specific functionality. Designed to provide a productive, efficient workflow built on reliable technology. Building with DW should feel like assembling IKEA furniture: not always quick and easy, but achievable by one or two people who can follow directions and understand how things fit together. ## Electronics Kit Energy Did you ever play with one of these as a kid? ![](/images/metphor-electronics-kit.webp) I made an AM transmitter and pretended to have a radio show. It was a lot of fun. Imagine this concept, but for web apps:
--- ## AudioUpload URL: https://darkwavejs.com/docs/components/audioupload Audio file upload component with metadata extraction. ## Usage ```astro ``` ## Database Fields The component stores audio metadata using a column prefix. Required fields: | Field | Description | |-------|-------------| | `{prefix}_url` | Audio file URL | | `{prefix}_length` | File size in bytes | | `{prefix}_mime` | MIME type | | `{prefix}_duration` | Duration in seconds | For example, with `name="audio"`, your table needs: - `audio_url` - `audio_length` - `audio_mime` - `audio_duration` --- ## CheckboxGroup URL: https://darkwavejs.com/docs/components/checkboxgroup Multiple checkbox selection component. ## Usage ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `label` | string | Group label text | | `name` | string | Input name attribute | | `options` | array | Array of `{ value, label }` objects | | `value` | array | Array of selected values | --- ## DatePicker URL: https://darkwavejs.com/docs/components/datepicker Date and time selection component using [Flatpickr](https://flatpickr.js.org/). ## Basic Usage ```astro ``` ## Date and Time ```astro ``` ## Date Range ```astro ``` ## With Constraints ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `label` | string | Input label text | | `name` | string | Input name attribute | | `dateFormat` | string | Date format for value | | `altInput` | boolean | Show friendly display format | | `altFormat` | string | Display format | | `enableTime` | boolean | Enable time selection | | `mode` | string | `single`, `range`, or `multiple` | | `minDate` | string | Minimum selectable date | | `maxDate` | string | Maximum selectable date | | `inline` | boolean | Show inline calendar | | `weekNumbers` | boolean | Show week numbers | --- ## FullscreenSpinner URL: https://darkwavejs.com/docs/components/fulscreenspinner Full-screen loading indicator overlay. ## Usage ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `visible` | boolean | Whether spinner is visible | | `text` | string | Optional loading text | --- ## GenericCard URL: https://darkwavejs.com/docs/components/genericcard Card container component for content grouping. ## Usage ```astro

Card Title

Card content goes here.

``` ## With Header and Footer ```astro Action} >

Card content goes here.

``` ## Props | Prop | Type | Description | |------|------|-------------| | `title` | string | Card header title | | `footer` | node | Footer content | | `className` | string | Additional CSS classes | --- ## InputText URL: https://darkwavejs.com/docs/components/inputtext Text input component with validation support. ## Usage ```astro ``` ## Props | Prop | Type | Description | |------|------|-------------| | `label` | string | Input label text | | `name` | string | Input name attribute | | `type` | string | Input type (text, email, password, etc.) | | `placeholder` | string | Placeholder text | | `required` | boolean | Whether input is required | | `value` | string | Default value | --- ## Label URL: https://darkwavejs.com/docs/components/label Form label component with optional popover support. Most form components include a basic label. Use this component when you need additional features like popovers or custom styling. ## Usage ```astro