Skip to content

dedzec/assets-store

Repository files navigation

🎯 Assets Store

Professional Asset Management System - A modern desktop application for managing Unity, Unreal Engine, and general web assets with an elegant and intuitive interface.

Electron TypeScript Vite better--sqlite3 Lucide Vitest


πŸ“‹ Table of Contents


🌟 Overview

Assets Store is a cross-platform desktop application built with Electron that helps developers and content creators organize and manage their digital assets efficiently. Whether you're working with Unity assets, Unreal Engine content, or general web resources, Assets Store provides a centralized, searchable database with a beautiful user interface.

Key Highlights

  • 🎨 Professional UI - Clean, modern interface with sidebar navigation
  • 🌍 Multilingual - Full support for Portuguese (pt-BR) and English (en-US)
  • 🎨 Themeable - Three beautiful themes (Default/Purple, Light/Blue, Dark/Purple)
  • πŸ”’ Secure - Proper IPC communication with contextBridge
  • πŸ“¦ Type-Safe - 100% TypeScript with strict mode
  • ⚑ Fast - Vite bundler + better-sqlite3 sync API
  • πŸ§ͺ Tested - Vitest unit tests for utilities

πŸš€ Features

Core Functionality

Feature Description
βœ… CRUD Operations Full Create, Read, Update, Delete operations for assets
πŸ” Real-time Search Instantly filter assets by title as you type
πŸ–ΌοΈ Image Preview Upload and preview images using secure base64 encoding
πŸ”— Clickable URLs Unity, Unreal Engine, and general links open in external browser
πŸ’Ύ Local Storage SQLite database stored locally in project directory
πŸ“Š Asset Listing Paginated view with asset cards showing all details
✏️ Easy Editing Double-click any asset to edit its details
πŸ—‘οΈ Safe Deletion Confirmation dialog before deleting assets
πŸ“₯ Import / Export Import and export assets as JSON files
πŸ–±οΈ Drag & Drop Drag images directly onto the form to upload

User Experience

Feature Description
🎨 Theme System Choose from 3 pre-configured themes
🌐 i18n Support Switch between Portuguese and English seamlessly
πŸ“± Responsive Adapts to different window sizes (min: 800x600)
🎯 Intuitive Navigation Sidebar menu for quick page switching
πŸ’‘ Visual Feedback Hover effects, active states, and smooth transitions
⚑ Performance Efficient rendering and minimal resource usage
🌟 Lucide Icons Professional SVG icon library instead of emojis
πŸ“£ Toast Notifications Non-blocking success/error feedback
πŸ’¬ Custom Modals Styled confirm/alert dialogs replacing native popups
⏳ Loading Skeletons Animated placeholders during data loading
🎬 Page Transitions Smooth fade-in animations between pages
πŸ–₯️ Custom Titlebar Frameless window with styled min/max/close buttons
⌨️ Keyboard Shortcuts Ctrl+N new, Ctrl+F search, Escape cancel
πŸ“„ Pagination Navigate large asset collections page by page

πŸ› οΈ Tech Stack

Core Technologies

Technology Version Purpose
Electron 39.1.2 Cross-platform desktop framework
TypeScript 5.9 Type-safe JavaScript (strict mode)
Vite 5.4.21 Fast bundler and dev server
better-sqlite3 12.8 Synchronous SQLite engine
Lucide latest SVG icon library
electron-log latest Persistent file logging
Node.js Latest LTS Runtime environment

Development Tools

Tool Version Purpose
Electron Forge 7.10.2 Build and packaging
Vitest 4.1 Unit testing framework
ESLint 8.57.1 Code linting
TypeScript ESLint 8.20 TypeScript linting rules

Architecture Pattern

  • Main Process: Handles system operations, database, IPC
  • Renderer Process: UI rendering and user interactions
  • Preload Script: Secure IPC bridge via contextBridge
  • Modular Structure: Organized into config, core, components, pages, types, utils

πŸ“ Project Structure

AssetsStore/
β”‚
β”œβ”€β”€ πŸ“‚ data/                          # Database storage
β”‚   └── database.sqlite               # SQLite database file
β”‚
β”œβ”€β”€ πŸ“‚ src/                           # Source code
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ config/                    # Configuration files
β”‚   β”‚   β”œβ”€β”€ app.config.ts             # App settings (window, theme, i18n, upload)
β”‚   β”‚   └── constants.ts              # Global constants (IPC channels, routes, keys)
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ core/                      # Core application logic
β”‚   β”‚   β”œβ”€ database.ts               # SQLite database module (better-sqlite3)
β”‚   β”‚   β”œβ”€ i18n.ts                   # Internationalization manager
β”‚   β”‚   β”œβ”€ router.ts                 # Client-side page routing
β”‚   β”‚   β”œβ”€ theme.ts                  # Theme management system
β”‚   β”‚   └─ index.ts                  # Core exports
β”‚   β”‚
β”‚   β”œβ”€ πŸ“‚ components/                # Reusable UI components
β”‚   β”‚   β”œβ”€ modal.ts                  # Modal/dialog component
β”‚   β”‚   β”œβ”€ toast.ts                  # Toast notification component
β”‚   β”‚   └─ index.ts                  # Component exports
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ locales/                   # Translation files
β”‚   β”‚   β”œβ”€β”€ pt-BR.json                # Portuguese (Brazil) translations
β”‚   β”‚   └── en-US.json                # English (US) translations
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ pages/                     # Application pages
β”‚   β”‚   β”œβ”€β”€ ListPage.ts               # Asset list with search & cards
β”‚   β”‚   β”œβ”€β”€ FormPage.ts               # Add/Edit asset form
β”‚   β”‚   β”œβ”€β”€ SettingsPage.ts           # Theme & language settings
β”‚   β”‚   └── index.ts                  # Page exports
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ styles/                    # Stylesheets
β”‚   β”‚   └── main.css                  # Main CSS with theme variables
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ types/                     # TypeScript definitions
β”‚   β”‚   β”œβ”€β”€ asset.types.ts            # Asset, AssetInput, AssetUpdate
β”‚   β”‚   β”œβ”€β”€ api.types.ts              # ElectronAPI interface
β”‚   β”‚   β”œβ”€β”€ core.types.ts             # Router, I18n, ThemeManager, PageConstructor
β”‚   β”‚   └── index.ts                  # Type exports & global Window interface
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ utils/                     # Utility functions
β”‚   β”‚   β”œβ”€β”€ string.utils.ts           # String manipulation (escape, truncate, etc.)
β”‚   β”‚   β”œβ”€β”€ date.utils.ts             # Date formatting & relative time
β”‚   β”‚   β”œβ”€β”€ validation.utils.ts       # Input validation helpersβ”‚   β”‚   β”œβ”€ icons.ts                  # Lucide icon helpersβ”‚   β”‚   └── index.ts                  # Utility exports
β”‚   β”‚
β”‚   β”œβ”€β”€ main.ts                       # Electron main process (IPC handlers)
β”‚   β”œβ”€β”€ preload.ts                    # Preload script (contextBridge)
β”‚   β”œβ”€β”€ renderer.ts                   # Renderer entry point
β”‚   β”œβ”€β”€ env.d.ts                      # Environment type declarations
β”‚   └── vite-env.d.ts                 # Vite type declarations
β”‚
β”œβ”€β”€ πŸ“‚ node_modules/                  # Dependencies
β”œβ”€β”€ πŸ“‚ .vite/                         # Vite build output
β”‚
β”œβ”€β”€ πŸ“„ index.html                     # HTML entry point
β”œβ”€β”€ πŸ“„ package.json                   # Dependencies & scripts
β”œβ”€β”€ πŸ“„ tsconfig.json                  # TypeScript configuration
β”œβ”€β”€ πŸ“„ forge.config.ts                # Electron Forge config
β”œβ”€β”€ πŸ“„ vite.main.config.ts            # Vite config for main process
β”œβ”€β”€ πŸ“„ vite.preload.config.ts         # Vite config for preload
β”œβ”€β”€ πŸ“„ vite.renderer.config.ts        # Vite config for renderer
β”œβ”€β”€ πŸ“„ .eslintrc.json                 # ESLint configuration
β”œβ”€β”€ πŸ“„ .gitignore                     # Git ignore rules
β”œβ”€β”€ πŸ“„ README.md                      # This file
└── πŸ“„ CHANGELOG.md                   # Version history

οΏ½ Installation

Prerequisites

  • Node.js (LTS version recommended)
  • npm or yarn

Steps

  1. Clone or download the repository
cd /path/to/AssetsStore
  1. Install dependencies
npm install
  1. Database initialization

The database will be automatically created in the data/ directory on first run.


πŸƒ Usage

Development Mode

Start the application in development mode with hot reload:

npm run start

This will:

  • Launch the Electron application
  • Start Vite dev server on http://localhost:5173/
  • Enable hot module replacement
  • Type rs in terminal to restart main process

Available Scripts

Script Command Description
Start npm run start Run in development mode
Package npm run package Package app for current platform
Make npm run make Create distributable installers
Publish npm run publish Publish to distribution channels
Lint npm run lint Run ESLint on TypeScript files
Test npm run test Run unit tests with Vitest
Test Watch npm run test:watch Run tests in watch mode

Keyboard Shortcuts

Shortcut Action
Ctrl+N Navigate to Add New Asset form
Ctrl+F Focus the search input (on list page)
Escape Cancel current form / clear search / go back to list

βš™οΈ Configuration

Application Settings

Edit src/config/app.config.ts to customize:

export const APP_CONFIG = {
  // Application Info
  name: 'Assets Store',
  version: '1.0.0',
  
  // Window Settings
  window: {
    width: 1135,      // Default width
    height: 860,      // Default height
    minWidth: 800,    // Minimum width
    minHeight: 600,   // Minimum height
  },
  
  // Database Settings
  database: {
    name: 'database.sqlite',
    directory: 'data',
  },
  
  // Theme Settings
  theme: {
    default: 'default',
    available: ['default', 'light', 'dark'],
    storageKey: 'assetsstore-theme',
  },
  
  // Internationalization
  i18n: {
    defaultLocale: 'pt-BR',
    availableLocales: ['pt-BR', 'en-US'],
    storageKey: 'assetsstore-locale',
  },
  
  // File Upload
  upload: {
    allowedExtensions: ['jpg', 'jpeg', 'png', 'gif', 'svg', 'webp'],
    maxFileSize: 10 * 1024 * 1024, // 10MB
  },
};

Global Constants

Edit src/config/constants.ts for IPC channels, routes, and storage keys:

export const IPC_CHANNELS = {
  ASSETS_GET_ALL: 'assets:getAll',
  ASSETS_GET_BY_ID: 'assets:getById',
  ASSETS_CREATE: 'assets:create',
  ASSETS_UPDATE: 'assets:update',
  ASSETS_DELETE: 'assets:delete',
  READ_IMAGE: 'readImage',
  OPEN_EXTERNAL: 'openExternal',
};

�️ Database Schema

Assets Table

CREATE TABLE assets (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  title TEXT NOT NULL,              -- Asset title
  image TEXT,                        -- Image path or base64
  unity TEXT,                        -- Unity asset URL
  unreal TEXT,                       -- Unreal Engine asset URL
  link TEXT,                         -- General web link
  createdAt TEXT DEFAULT (datetime('now', 'localtime'))
);

TypeScript Types

interface Asset {
  id: number;
  title: string;
  image: string;
  unity: string;
  unreal: string;
  link: string;
  createdAt: string;
}

πŸ—οΈ Architecture

IPC Communication Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Renderer       β”‚         β”‚   Preload        β”‚         β”‚   Main          β”‚
β”‚  Process        β”‚         β”‚   Script         β”‚         β”‚   Process       β”‚
β”‚  (UI/Pages)     β”‚         β”‚  (contextBridge) β”‚         β”‚  (Database/IPC) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                            β”‚                            β”‚
        β”‚  window.api.getAssets()    β”‚                            β”‚
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€>β”‚                            β”‚
        β”‚                            β”‚  ipcRenderer.invoke()      β”‚
        β”‚                            β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€>β”‚
        β”‚                            β”‚                            β”‚
        β”‚                            β”‚         Query SQLite       β”‚
        β”‚                            β”‚                            β”‚
        β”‚                            β”‚  <─────────────────────────
        β”‚  <──────────────────────────                            β”‚
        β”‚         Return data        β”‚                            β”‚
        β”‚                            β”‚                            β”‚

Module Organization

  • Config: Centralized settings and constants
  • Core: Essential services (database, i18n, router, theme)
  • Components: Reusable UI components (modal, toast)
  • Types: TypeScript interfaces and type definitions
  • Utils: Reusable helper functions + Lucide icon wrappers
  • Pages: UI components for each route
  • Locales: Translation JSON files
  • Styles: CSS with theme variables, animations, and component styles

🎨 Customization

Adding a New Theme

  1. Edit src/core/theme.ts
private themes = {
  'mytheme': {
    '--primary-color': '#FF6B6B',
    '--secondary-color': '#4ECDC4',
    // ... more variables
  }
};
  1. Update src/config/app.config.ts
theme: {
  available: ['default', 'light', 'dark', 'mytheme'],
}
  1. Add UI option in SettingsPage.ts

Adding a New Language

  1. Create translation file src/locales/es-ES.json
{
  "app": {
    "title": "Tienda de Activos"
  },
  // ... translations
}
  1. Update src/core/i18n.ts
import esES from '../locales/es-ES.json';

this.translations = {
  'pt-BR': ptBR,
  'en-US': enUS,
  'es-ES': esES,
};
  1. Update src/config/app.config.ts
i18n: {
  availableLocales: ['pt-BR', 'en-US', 'es-ES'],
}

Adding a New Page

  1. Create page file src/pages/MyPage.ts
export class MyPage {
  constructor(private container: HTMLElement) {}
  
  async render(params?: any) {
    this.container.innerHTML = `<h1>My Page</h1>`;
  }
}
  1. Register in router src/core/router.ts
import { MyPage } from '../pages/MyPage';

this.pages = new Map<string, PageConstructor>([
  // ... existing pages
  ['mypage', MyPage as PageConstructor],
]);
  1. Add navigation menu item in src/renderer.ts

πŸ“¦ Build & Distribution

Package for Current Platform

npm run package

Output: out/AssetsStore-{platform}-{arch}/

Create Installers

npm run make

Supported makers (configured in forge.config.ts):

  • Windows: Squirrel (.exe installer)
  • macOS: ZIP (.app bundle)
  • Linux: DEB (.deb package) and RPM (.rpm package)

Output: out/make/

Distribution Files

Platform Output
Windows Assets Store Setup.exe
macOS Assets Store.app.zip
Linux (Debian) assets-store_1.0.0_amd64.deb
Linux (RedHat) assets-store-1.0.0-1.x86_64.rpm

πŸ’» Development

File Structure Best Practices

  • One responsibility per file
  • Clear naming conventions
  • JSDoc comments for documentation
  • Export from index files for clean imports

Code Style

  • TypeScript strict mode
  • ESLint rules enforced
  • Consistent formatting
  • Type safety throughout

Adding New Features

  1. Types: Define in src/types/
  2. Logic: Implement in src/core/ or src/utils/
  3. UI: Create page in src/pages/
  4. IPC: Add handlers in src/main.ts and expose in src/preload.ts
  5. Styles: Add to src/styles/main.css

Testing

The project uses Vitest for unit testing. Tests cover utility functions (string, date, validation).

# Run tests once
npm run test

# Run in watch mode
npm run test:watch

Test files are located in the tests/ directory:

  • string.utils.test.ts β€” escapeHtml, truncate, capitalize, toKebabCase
  • date.utils.test.ts β€” formatDate with locale support
  • validation.utils.test.ts β€” URL validation, empty checks, file extensions, file size

πŸ“ License

MIT License

Copyright (c) 2025 Assets Store

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


πŸ‘¨β€πŸ’» Author

dedzec


πŸ™ Acknowledgments

Built with modern web technologies:

  • Electron - Build cross-platform desktop apps
  • TypeScript - JavaScript with syntax for types
  • Vite - Next generation frontend tooling
  • better-sqlite3 - Fast, synchronous SQLite3
  • Lucide - Beautiful & consistent SVG icons
  • Vitest - Blazing fast unit test framework

πŸ“š Additional Resources


Made with ❀️ and modern web technologies

⭐ Star this project if you find it useful!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors