# DEV PATCH-001
## Base URL & Development Bootstrap

You are implementing Development Patch-001 for the INVEETAIRE platform.

This is NOT a feature.

This is NOT an Alpha Patch.

This patch improves the local development environment while preserving production compatibility.

---

# Current Status

ALPHA BASELINE COMPLETE

All business modules are complete.

This patch affects ONLY application bootstrapping and URL generation.

---

# Current Development Environment

Project location:

http://localhost/inveetaire/

Production target:

https://inveetaire.com/

The same repository must support BOTH environments without source code modification.

Changing source code during deployment is NOT acceptable.

---

# Objective

Implement environment-aware base URL handling.

The application must automatically work in:

Development

http://localhost/inveetaire/

Production

https://inveetaire.com/

without changing application code.

---

# Scope

Implement ONLY:

Base URL detection

Application URL generation

Asset URL generation

Redirect URL generation

Router base-path support

Development bootstrap compatibility

---

# Required Behaviour

The application must correctly detect:

Protocol

Host

Subfolder (if any)

Base Path

Application URL

Examples:

Development

APP_URL

http://localhost/inveetaire

Base Path

/inveetaire

Production

APP_URL

https://inveetaire.com

Base Path

/

No hardcoded "/inveetaire" anywhere.

---

# URL Helpers

Ensure every helper consistently generates URLs using the detected base path.

Including:

asset()

url()

redirect()

route()

public invitation links

QR URLs

Messaging links

Authentication redirects

Workspace redirects

Admin redirects

Crew redirects

Couple redirects

---

# Router

Router must correctly resolve requests regardless of:

/

or

/inveetaire/

The router must never require code changes when moving environments.

---

# Bootstrap

Verify:

index.php

autoload

environment loading

APP_URL

BASE_PATH

request URI normalization

Rewrite compatibility

---

# .htaccess

Review RewriteBase handling.

Support:

Development

/inveetaire/

Production

/

without editing source code.

If configuration changes are required,

keep them minimal.

Do NOT introduce duplicated rewrite rules.

---

# Constraints

Do NOT modify:

Business logic

Workspace

Invitation

Messaging

Guest

Operation

Authentication logic

Attendance

Database schema

No new features.

---

# Verification

Verify:

Development

http://localhost/inveetaire/

Development login

Development public invitation

Development assets

Production-compatible URL generation

Redirects

QR URLs

Messaging URLs

No duplicated slashes

No missing subfolder

PHP syntax passes.

---

# Acceptance Criteria

PASS only if:

The same codebase runs in localhost/inveetaire.

The same codebase runs in production root.

No hardcoded base paths.

All generated URLs are correct.

Assets load correctly.

Router resolves correctly.

PHP syntax passes.

---

# Output

Provide:

1. Files modified.

2. Base URL detection strategy.

3. Router normalization strategy.

4. URL helper strategy.

5. Verification results.

6. Acceptance checklist.

7. PHP syntax results.

Stop after implementation.

Wait for Human Approval.