Last Updated: 3/6/2026
LinkAce Developer Instructions
LinkAce is a self-hosted bookmark manager built with Laravel PHP framework. It supports multiple databases, features advanced tagging and categorization, and provides both web interface and API access.
ALWAYS follow these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Working Effectively
Bootstrap, Build, and Test the Repository
-
Environment Setup (Required for all development):
# Copy environment file and set up basic configuration cp .env.example .env # Modify .env for local development: # - Set APP_ENV=local # - Set APP_DEBUG=true # - For SQLite: Set DB_CONNECTION=sqlite and DB_DATABASE=/absolute/path/to/database.sqlite -
Install Dependencies:
# Install PHP dependencies - takes 2-3 minutes composer install --no-interaction # Install Node.js dependencies - takes 30 seconds npm install -
Application Configuration:
# Generate Laravel application key php artisan key:generate # Create database file for SQLite (if using SQLite) mkdir -p database && touch database/database.sqlite # Create testing database touch database/testing.sqlite # Run database migrations php artisan migrate --force -
Build Assets:
# Development build (for active development) npm run dev # Production build - takes 15 seconds. NEVER CANCEL. npm run production -
Run Tests and Linting:
# Run linting - takes 5 seconds. NEVER CANCEL. composer run lint # Run test suite - takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds. composer run test
Run the Application
ALWAYS complete the bootstrapping steps above first.
Local Development Server:
# Start PHP development server on port 8000
php artisan serve --host=0.0.0.0 --port=8000
# Application will be available at http://localhost:8000Docker Development (Alternative):
# IMPORTANT: Docker setup may fail due to package availability issues
# Use native PHP setup (above) if Docker build fails
# Copy Docker development environment
cp .env.dev .env
# Start Docker services - takes 6+ minutes, may fail. NEVER CANCEL. Set timeout to 15+ minutes.
docker compose up -d --build
# If successful, run inside PHP container:
docker compose exec -it php composer install
docker compose exec -it php php artisan key:generate
docker compose exec -it php php artisan migrateValidation
Manual Testing Requirements
- ALWAYS test complete user workflows after making changes
- ALWAYS run both linting and tests before committing
- Test the application setup process by accessing http://localhost:8000
- Verify the setup wizard redirects properly (should redirect to /setup/start)
- Create a test user:
php artisan registeruser --admin testuser test@example.com - Test login functionality through the web interface
Required Validation Steps
# Before any commit, ALWAYS run:
composer run lint # Must pass without errors
composer run test # 438 tests, may have warnings about coverage (acceptable)
npm run production # Must complete successfullyCommon Tasks
User Management
# Create new admin user
php artisan registeruser --admin username email@example.com
# Create regular user
php artisan registeruser username email@example.com
# Complete setup if wizard fails
php artisan setup:completeDatabase Operations
# Run migrations
php artisan migrate
# Reset database completely
php artisan migrate:fresh
# Check migration status
php artisan migrate:statusAsset Management
# Watch for changes during development
npm run watch
# One-time development build
npm run dev
# Production build (for deployment)
npm run productionBuild and Test Timing
- Composer install: 2-3 minutes (production), 3-4 minutes (with dev dependencies)
- npm install: 30 seconds
- npm run production: 15 seconds - NEVER CANCEL
- composer run lint: 5 seconds - NEVER CANCEL
- composer run test: 50 seconds - NEVER CANCEL. Set timeout to 90+ seconds
- Docker build: 6+ minutes, may fail - NEVER CANCEL. Set timeout to 15+ minutes
Technology Stack
- Backend: Laravel 10.x (PHP 8.1+)
- Frontend: Laravel Mix, Bootstrap 5, TomSelect
- Database: MySQL/MariaDB, PostgreSQL, SQLite
- Cache: Redis (optional)
- Node.js: Version 22 LTS (minimum 20 LTS)
- Development: Docker Compose (optional), PHP built-in server
Project Structure
Key Directories
app/- Laravel application code (Models, Controllers, Commands)resources/assets/- Frontend assets (JS, SCSS)public/assets/dist/- Compiled assetsdatabase/- Migrations, factories, seedstests/- PHPUnit test suite (438 tests)config/- Laravel configuration filesresources/docker/- Docker configuration files
Important Files
composer.json- PHP dependencies and scriptspackage.json- Node.js dependencies and build scriptswebpack.mix.js- Asset compilation configurationphpunit.xml- Test configurationphpcs.xml- Code style configuration.env.example- Environment configuration templateCONTRIBUTING.md- Development setup guide
Environment Configuration
Required Environment Variables
APP_ENV=local # Set to local for development
APP_DEBUG=true # Enable debug mode for development
APP_KEY= # Generated by artisan key:generate
DB_CONNECTION=sqlite # or mysql/pgsql
DB_DATABASE=/path/to/database # Absolute path for SQLiteDatabase Configuration Examples
# SQLite (recommended for development)
DB_CONNECTION=sqlite
DB_DATABASE=/home/user/LinkAce/database/database.sqlite
# MySQL
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=linkace
DB_USERNAME=linkace
DB_PASSWORD=password
# PostgreSQL
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=linkace
DB_USERNAME=linkace
DB_PASSWORD=passwordCommon Issues and Solutions
Docker Build Failures
- Issue: Package availability errors in Alpine Linux
- Solution: Use native PHP setup instead of Docker
Test Failures
- Issue: Database file does not exist
- Solution:
touch database/testing.sqlite
Permission Errors
- Issue: SQLite database not writable
- Solution:
chmod 664 database/database.sqlite && chmod 775 database/
Asset Build Issues
- Issue: Mix compilation errors
- Solution: Delete
node_modules/and runnpm installagain
CI/CD Pipeline
The repository uses GitHub Actions for testing:
- Node.js asset build: Tests on Node 22, uploads build artifacts
- PHP testing: Tests on PHP 8.1, 8.2, 8.3, 8.4 across Ubuntu
- Artifacts: Built assets are shared between build and test jobs
CI Commands (matches local development)
npm ci && npm run production # Asset building
composer install --prefer-dist # Dependency installation
composer run lint # Code style checking
composer run test # Test suite executionSetup Process Flow
- Fresh clone → Copy
.env.exampleto.env - Install Composer dependencies →
composer install - Generate app key →
php artisan key:generate - Install Node dependencies →
npm install - Build assets →
npm run production - Set up database → Create database file/connection
- Run migrations →
php artisan migrate - Create user →
php artisan registeruser --admin - Start server →
php artisan serve - Test application → Access setup wizard at http://localhost:8000
Important Notes
- NEVER CANCEL long-running commands - builds and tests can take up to several minutes
- ALWAYS use absolute paths for SQLite database configuration
- Docker setup is optional - native PHP setup is more reliable
- Test database required -
database/testing.sqlitemust exist for tests - Admin user creation - Use
--adminflag for admin privileges - Setup wizard - Application redirects to
/setup/startuntil configuration is complete