Skip to content

Senneseph/a-icon.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

a-icon.com

A modern favicon generator and management platform built with Angular and NestJS.

🎯 Overview

a-icon.com is a web service that allows users to:

  • Upload images and convert them into multi-size favicon sets (.ico, .png)
  • Create favicons from scratch using a built-in drawing canvas
  • Browse a directory of published favicons with sorting options
  • Get unique URLs for each generated favicon set

πŸ—οΈ Architecture

Tech Stack

  • Frontend: Angular 20 with Server-Side Rendering (SSR)
  • Backend: NestJS 11 with TypeScript
  • Database: SQLite (better-sqlite3)
  • Image Processing: Sharp
  • Containerization: Docker & Docker Compose
  • Infrastructure: DigitalOcean (Terraform)

Project Structure

a-icon.com/
β”œβ”€β”€ a-icon-api/          # NestJS backend API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ favicon/     # Favicon generation & management
β”‚   β”‚   β”œβ”€β”€ storage/     # File storage service
β”‚   β”‚   β”œβ”€β”€ directory/   # Directory listing
β”‚   β”‚   └── database/    # SQLite database module
β”‚   └── Dockerfile
β”œβ”€β”€ a-icon-web/          # Angular frontend with SSR
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ upload/      # Upload component
β”‚   β”‚   β”‚   └── directory/   # Directory listing component
β”‚   β”‚   └── server.ts        # SSR Express server
β”‚   └── Dockerfile
β”œβ”€β”€ terraform/           # Infrastructure as Code
β”œβ”€β”€ docker-compose.yml   # Local development
└── docker-compose.prod.yml  # Production deployment

πŸš€ Quick Start

Prerequisites

  • Node.js 22.12+
  • Docker & Docker Compose
  • Git

Local Development

  1. Clone the repository

    git clone https://github.com/Senneseph/a-icon.com.git
    cd a-icon.com
  2. Start the services

    docker-compose up
  3. Access the application

Development Without Docker

Backend (API)

cd a-icon-api
npm install
npm run start:dev

Frontend (Web)

cd a-icon-web
npm install
npm start

πŸ“¦ Deployment

Production Deployment to DigitalOcean

  1. Set up environment variables

    # Create .env file (not tracked in git)
    DO_TOKEN="your_digitalocean_token"
  2. Deploy from GitHub

    .\deploy-from-github.ps1

This script will:

  • Clone the repository on the droplet
  • Build Docker images on the server
  • Start the containers with production configuration

Static Site Hosting

The a-icon.com droplet can also host multiple static websites with automatic SSL:

# Add a static site
.\add-static-site.ps1 -Domain "iffuso.com"

# Add a subdomain
.\add-static-site.ps1 -Domain "iffuso.com" -Subdomain "angular-press" -SourcePath "./dist"

# List all sites
.\list-static-sites.ps1

# Remove a site
.\remove-static-site.ps1 -Domain "iffuso.com"

See STATIC-HOSTING.md for complete documentation.

Manual Deployment

See DEPLOYMENT.md for detailed deployment instructions.

πŸ”§ Configuration

Environment Variables

API (a-icon-api)

  • NODE_ENV: Environment (development/production)
  • PORT: API port (default: 3000)
  • DB_PATH: SQLite database file path
  • STORAGE_ROOT: File storage directory

Web (a-icon-web)

  • NODE_ENV: Environment (development/production)
  • PORT: Web server port (default: 4000)
  • API_URL_SSR: Server-side API URL for SSR (e.g., http://api:3000)

πŸ§ͺ Testing

API Tests

cd a-icon-api
npm test
npm run test:e2e

Web Tests

cd a-icon-web
npm test

πŸ“ API Endpoints

Favicon Management

  • POST /api/favicons/upload - Upload image and generate favicon
  • POST /api/favicons/canvas - Create favicon from canvas data
  • GET /api/favicons/:slug - Get favicon metadata

Directory

  • GET /api/directory - List all favicons (supports sorting)
    • Query params: sortBy (createdAt/slug), order (asc/desc)

Storage

  • GET /api/storage/* - Serve generated favicon files

Health

  • GET /api/health - Health check endpoint

🐳 Docker

Build Images

docker-compose build

Production Build

docker-compose -f docker-compose.prod.yml build

πŸ” Security

  • All services run in hardened Docker containers
  • Non-root users in containers
  • Environment-based configuration (no hardcoded secrets)
  • Input validation and sanitization
  • CORS configuration

πŸ“„ License

UNLICENSED - Private project

πŸ‘€ Author

Benjamin Hill (Senneseph)

πŸ”— Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published