feat: rename properties to projects

- Rename all DB tables: properties → projects, properties_addresses → projects_addresses, properties_models → projects_models, property_likes → projects_likes
- Add projects_likes as proper Drizzle schema table (was SQL-only before)
- Rename ID prefixes: property_xxx → project_xxx
- Rename auth_sessions column: active_property_id → active_project_id
- Simplify project creation: address is now optional (no longer required to get started)
- Update all actions, stores, types, components, and routes
- Rename route: /editor/[propertyId] → /editor/[projectId]
- Add SQL migration for table/column/index/policy/function renames
- Update RPC functions: increment_project_views, get_project_like_count
- Update storage bucket reference: project-thumbnails
- All types/exports follow existing Drizzle patterns (pgTable, relations, zod schemas)
This commit is contained in:
Anton Pascal
2026-02-17 20:40:52 +00:00
parent 77d64824e5
commit ee30f17129
35 changed files with 1376 additions and 1025 deletions
@@ -5,7 +5,7 @@ import { useRef, useState } from "react";
import { Button } from "@/components/ui/primitives/button";
import useEditor from "@/store/use-editor";
import { AudioSettingsDialog } from "./audio-settings-dialog";
import { usePropertyStore } from "@/features/community/lib/properties/store";
import { useProjectStore } from "@/features/community/lib/projects/store";
export function SettingsPanel() {
const fileInputRef = useRef<HTMLInputElement>(null);
@@ -16,11 +16,11 @@ export function SettingsPanel() {
const resetSelection = useViewer((state) => state.resetSelection);
const exportScene = useViewer((state) => state.exportScene);
const setPhase = useEditor((state) => state.setPhase);
const activeProperty = usePropertyStore((state) => state.activeProperty);
const activeProject = useProjectStore((state) => state.activeProject);
const [isGeneratingThumbnail, setIsGeneratingThumbnail] = useState(false);
const propertyId = activeProperty?.id;
const isLocalProperty = false; // Store only contains cloud properties
const projectId = activeProject?.id;
const isLocalProject = false; // Store only contains cloud projects
const handleExport = async () => {
if (exportScene) {
@@ -71,14 +71,14 @@ export function SettingsPanel() {
};
const handleGenerateThumbnail = () => {
if (!propertyId) {
console.error('❌ No property ID found');
if (!projectId) {
console.error('❌ No project ID found');
return;
}
console.log('🎯 Generate thumbnail clicked for property:', propertyId);
console.log('🎯 Generate thumbnail clicked for project:', projectId);
setIsGeneratingThumbnail(true);
emitter.emit('camera-controls:generate-thumbnail', { propertyId });
console.log('📤 Event emitted with property ID:', propertyId);
emitter.emit('camera-controls:generate-thumbnail', { projectId });
console.log('📤 Event emitted with project ID:', projectId);
// Reset loading state after a delay (thumbnail generation is async)
setTimeout(() => setIsGeneratingThumbnail(false), 3000);
};
@@ -100,8 +100,8 @@ export function SettingsPanel() {
</Button>
</div>
{/* Thumbnail Section (only for cloud properties) */}
{propertyId && !isLocalProperty && (
{/* Thumbnail Section (only for cloud projects) */}
{projectId && !isLocalProject && (
<div className="space-y-2">
<label className="font-medium text-muted-foreground text-xs uppercase">
Thumbnail