An open API service indexing awesome lists of open source software.

https://github.com/lfortin/vite-backbone

Starter template for Backbone.
https://github.com/lfortin/vite-backbone

backbone backbonejs boilerplate bootstrap frontend handlebars javascript jquery starter template underscore vite

Last synced: about 2 months ago
JSON representation

Starter template for Backbone.

Awesome Lists containing this project

README

          

# vite-backbone

> ๐Ÿ“ฆ Starter template for Backbone.js apps using Vite, Bootstrap 5, Handlebars, jQuery, and Underscore.

[![Vite](https://img.shields.io/badge/Vite-^8.0-blueviolet?logo=vite)](https://vitejs.dev/)
[![Backbone.js](https://img.shields.io/badge/Backbone.js-^1.6-blue?logo=javascript)](https://backbonejs.org/)
[![License: MIT-0](https://img.shields.io/badge/License-MIT--0-yellow.svg)](LICENSE)
[![Vitest](https://img.shields.io/badge/Vitest-^4.0-729b1b?logo=vitest)](https://vitest.dev/)
[![Oxc](https://img.shields.io/badge/Oxc-Rust--Powered-orange?logo=rust)](https://oxc.rs/)

---

## ๐Ÿš€ Features

- โœ… Backbone Views, Models, Collections, and Routers
- ๐ŸŽจ Bootstrap 5 layout & styling
- ๐Ÿ“ Handlebars.js for logic-less templating
- โšก Vite for modern development and lightning-fast builds
- ๐Ÿงช Unit testing with Vitest
- ๐Ÿ“ Oxlint pre-configured for common globals
- ๐ŸŒ Globals for `$`, `_`, `Backbone`, `Handlebars`
- ๐Ÿ”ง Easily configurable and extendable

---

[![vite-backbone screenshot](https://github.com/lfortin/vite-backbone/blob/main/public/screenshot.png?raw=true)](https://github.com/lfortin/vite-backbone/blob/main/public/screenshot.png?raw=true)

Try it out online:
๐Ÿ‘‰ [Live Demo](https://lfortin.github.io/vite-backbone-demo)

---

## ๐Ÿ“‚ Template Structure

```text
โ”œโ”€โ”€ index.html # Main app page
โ”œโ”€โ”€ index-cdn.html # CDN-specific app page
โ”œโ”€โ”€ public/ # Static assets
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ collections/ # Backbone Collections
โ”‚ โ”œโ”€โ”€ data/ # Static data files
โ”‚ โ”œโ”€โ”€ models/ # Backbone Models
โ”‚ โ”œโ”€โ”€ routers/ # Backbone Routers
โ”‚ โ”œโ”€โ”€ styles/
โ”‚ โ”‚ โ””โ”€โ”€ style.scss # Custom styles
โ”‚ โ”œโ”€โ”€ views/ # Backbone Views
โ”‚ โ”œโ”€โ”€ main.js # App entry point & Router init
โ”‚ โ””โ”€โ”€ main-cdn.js # App entry point for CDN-specific build
โ””โ”€โ”€ tests/ # Unit tests
```

## ๐Ÿ› ๏ธ Usage

### 1. Clone & Install

```bash
git clone https://github.com/lfortin/vite-backbone.git
cd vite-backbone
npm install
```

### 2. Start Development Server

```bash
npm run dev
```

### 3. Build for Production

```bash
npm run build
```

### Using CDN links for external dependencies

```bash
npm run dev:cdn
npm run build:cdn
```

## ๐Ÿงช Running Tests

This project uses [Vitest](https://vitest.dev/) for unit testing.

To run all tests:

```bash
npm run test
```

---

## ๐Ÿ“ Linting Code

This project uses [Oxlint](https://oxc.rs/docs/guide/usage/linter.html) with a modern configuration tailored for Backbone, Handlebars, jQuery, Underscore and Vitest.

To run the linter:

```bash
npm run lint
```

---

## ๐Ÿ“„ License

MIT-0 ยฉ [lfortin](https://github.com/lfortin)