Show HN: Capsule – Single-file web apps that save their data into SQLite

Published 2026-09-16 · Updated 2026-09-16

Show HN: Capsule – Single-file web apps that save their data into SQLite

In the ever-evolving world of web development, there are always new and innovative approaches to creating engaging applications. One such approach is the concept of "single-file web apps," which are standalone applications that can be easily shared and deployed. Capsule, a new project by developer [Nicolas Couturier](https://twitter.com/nicolas_couturier), takes this concept to the next level by allowing developers to create single-file web apps that store their data directly into SQLite databases.

Single-file web apps: The future of web development?

Single-file web apps have gained popularity in recent years due to their simplicity and portability. Unlike traditional web applications that require a server to run, single-file web apps can be executed directly from their file system. This makes them ideal for developers who want to share their work with others without the need for additional infrastructure.

Capsule aims to simplify the development process for single-file web apps by providing a comprehensive solution that includes a user interface, data storage, and deployment capabilities. By eliminating the need for additional libraries or frameworks, Capsule allows developers to focus on building their applications without getting bogged down by technical details.

Benefits of Capsule:

1. **Simple and efficient:** Capsule provides a user-friendly interface that allows developers to create and manage their single-file web apps without the need for complex setup or configuration. This makes it an excellent choice for both experienced developers and beginners looking to get started with single-file web apps.

2. **SQLite integration:** Capsule leverages the power of SQLite, a popular lightweight database engine, to store data for your single-file web apps. By storing data directly in SQLite databases, Capsule ensures efficient data management and seamless integration with your application's logic.

3. **Deployment made easy:** Capsule simplifies the deployment process by providing a built-in package manager that allows you to easily distribute your single-file web apps. This means that developers can share their work with others without the need for additional tools or infrastructure.

Building Single-File Web Apps with Capsule

Capsule provides a straightforward way to create single-file web apps, allowing developers to focus on building their applications without getting bogged down by technical details. Here's a step-by-step guide to get started with Capsule:

1. **Install Capsule:** To get started, head over to the [Capsule GitHub repository](https://github.com/nicolas-couturier/capsule) and clone the project. You can install Capsule using npm:

```bash

npm install capsule

```

2. **Create a new project:** To create a new project using Capsule, run the following command:

```bash

capsule init my-app

```

This will create a new directory called `my-app` with all the necessary files and folders for your single-file web app.

3. **Build your application:** Inside the `my-app` directory, you can start building your single-file web app using your favorite development tools and technologies. Capsule provides a basic template that includes a basic HTML file, CSS, and JavaScript files, allowing you to focus on building your application without worrying about the underlying framework or technology stack.

4. **Connect your application to Capsule:** Once you have built your application, you need to connect it to Capsule. To do this, create a new file called `capsule.js` in the root directory of your project. In this file, you'll define the necessary configurations and dependencies for your application. Here's an example configuration:

```javascript

// capsule.js

const Capsule = require('capsule');

const app = new Capsule();

// Configure Capsule with your application's settings

app.set('port', 8080);

app.set('views', path.join(__dirname, 'views'));

// Define your application's routes

app.get('/', (req, res) => {

res.render('index', { title: 'My Single-File Web App' });

});

// Start the Capsule server

app.listen(app.get('port'), () => {

console.log('Server listening on port', app.get('port'));

});

```

In the above example, we're configuring Capsule with the necessary settings and defining the application's routes. When you run your application, it will listen on port 8080 and serve the "index.ejs" file located in the "views" directory. The "index.ejs" file is a basic HTML template that will serve as the starting point for your single-file web app.

5. **Build your single-file web app:** With your Capsule configuration set up, it's time to build your single-file web app. Start by creating the necessary HTML and JavaScript files, and configure your application's routes. In this example, we'll create a simple web app that displays a welcome message and a link to the "about" page:

```html

<!DOCTYPE html>

<html


Frequently Asked Questions

What is the most important thing to know about Show HN: Capsule – Single-file web apps that save their data into SQLite?

The core takeaway about Show HN: Capsule – Single-file web apps that save their data into SQLite is to focus on practical, time-tested approaches over hype-driven advice.

Where can I learn more about Show HN: Capsule – Single-file web apps that save their data into SQLite?

Authoritative coverage of Show HN: Capsule – Single-file web apps that save their data into SQLite can be found through primary sources and reputable publications. Verify claims before acting.

How does Show HN: Capsule – Single-file web apps that save their data into SQLite apply right now?

Use Show HN: Capsule – Single-file web apps that save their data into SQLite as a lens to evaluate decisions in your situation today, then revisit periodically as the topic evolves.