- Add Rollup configuration for building and serving the application. - Implement logo scanning script to generate logos.json from logo files. - Create main App component to manage logo display and search functionality. - Develop LogoGrid and LogoList components for different viewing modes. - Add LogoModal component for logo preview with details. - Implement URL copying and logo downloading features. - Style components for improved user experience and responsiveness.
3.5 KiB
Logo Gallery - Developer Documentation
This document provides instructions for developers working on the Logo Gallery project.
Project Overview
Logo Gallery is a web application that displays a collection of company and brand logos with the following features:
- Grid and list views of logos
- Search functionality
- Direct URL copying for each logo
- Download capability
- Responsive design
The project is built with:
- Svelte for the front-end UI
- Node.js for script automation
- Docker for containerization
- GitHub Pages for deployment
Development Environment Setup
Prerequisites
- Docker and Docker Compose
- Git
No local Node.js installation is required as all operations run inside Docker containers.
Getting Started
-
Clone the repository:
git clone https://github.com/yourusername/logos.git cd logos -
Build and start the application:
make build make start -
Access the application at http://localhost:5005
Common Development Tasks
Adding New Logos
- Add logo files (SVG or PNG preferred) to the
public/logos/directory - Scan the logos directory and update the data file:
(This runs
make scan-logos-devnpm run scan-logosinside the dev container) - The application will automatically rebuild with the new logos
Modifying the UI
- Edit files in the
src/directory - The changes will require a rebuild:
make rebuild
Running Custom Commands
To run any npm or shell command inside the Docker container:
make run CMD="your-command-here"
Examples:
- List logo files:
make run CMD="ls -la public/assets/logos" - Run a specific npm script:
make run CMD="npm run some-script"
Project Structure
logos/
├── public/ # Static assets
│ ├── assets/
│ │ └── logos/ # Logo files (SVG, PNG)
│ ├── data/ # JSON data files
│ ├── build/ # Compiled JS/CSS (generated)
│ └── global.css # Global styles
├── src/ # Application source code
│ ├── components/ # Svelte components
│ ├── App.svelte # Main app component
│ └── main.js # App entry point
├── scripts/ # Utility scripts
├── Dockerfile # Docker configuration
├── compose.yml # Docker Compose configuration
├── Makefile # Development commands
└── README.md # Project overview
Deployment to GitHub Pages
To deploy the application to GitHub Pages:
-
Build the application:
make build -
The
public/directory contains all files needed for deployment -
Push the contents of the
public/directory to thegh-pagesbranch of your repository
Available Make Commands
Run make help to see all available commands:
make build- Build the Docker containermake start- Start the applicationmake stop- Stop the applicationmake restart- Restart the applicationmake logs- View the application logsmake run CMD=<cmd>- Run a command in the containermake generate-logos- Generate logos.json from assets directorymake clean- Clean up build artifactsmake rebuild- Completely rebuild from scratch
Troubleshooting
If you encounter issues:
- Check the logs:
make logs - Try a complete rebuild:
make rebuild - Ensure the Docker service is running
- Verify your logo files are in the correct format and location