Commit Graph

328 Commits

Author SHA1 Message Date
Christomatt bb9245ab99 feat(admin): Enhance Turnstile configuration UI and add GitHub commit links
- Move Turnstile status indicator above input fields for better visibility
- Mask secret key input with placeholder dots when already configured
- Update secret key helper text to indicate configuration status
- Enhance version API endpoint to include GitHub commit URL
- Add githubUrl field to version response for direct commit linking
- Implement emoji sizing styles for post content and compose input
- Update RightSidebar version state type to include githubUrl
- Add clickable GitHub commit link in version display when available
- Improve security by hiding sensitive Turnstile secret key values
2026-01-26 19:11:09 +01:00
Christomatt a3b158099d feat(admin): Add version API endpoint and refactor admin/moderation layouts
- Create new `/api/version` endpoint to retrieve git commit count and hash information
- Simplify admin page layout by removing unnecessary nested divs and card wrapper
- Refactor moderation page tab navigation with improved button styling using btn-sm and btn-primary classes
- Consolidate padding and styling in moderation page for cleaner component structure
- Add word-break and overflow-wrap styles to report content display for better text handling
- Improve responsive design by adding minWidth: 0 to flex containers in report cards
- Streamline conditional rendering in admin settings to reduce DOM nesting depth
2026-01-26 18:58:34 +01:00
Christomatt 02e7987512 refactor(admin): Extract moderation features into dedicated page
- Move reports, posts, and users management to new moderation page
- Simplify admin page to focus on node settings configuration only
- Remove unused types (AdminUser, AdminPost, Report) from admin page
- Remove report resolution, post actions, and user moderation handlers
- Remove tab navigation and related state management from admin page
- Update sidebar navigation to include moderation page link
- Consolidate moderation dashboard functionality into separate component
- Improve code organization by separating concerns between admin and moderation
2026-01-26 18:30:33 +01:00
Christomatt 052c5909c6 Fixed build error 2026-01-26 18:15:19 +01:00
Christomatt 5b0269af34 feat(auth): Integrate Cloudflare Turnstile bot protection and enhance swarm tracking
- Add Cloudflare Turnstile integration for login and registration forms
- Create turnstile verification utility with server-side token validation
- Add turnstile_site_key and turnstile_secret_key fields to nodes table
- Implement admin panel UI for configuring Turnstile keys in settings
- Update login and register API routes to verify Turnstile tokens
- Expose turnstile_site_key via GET /api/node endpoint for frontend
- Add admin endpoint to save and update Turnstile configuration
- Create remote_likes and remote_reposts tables for federated interaction tracking
- Add swarm reply metadata fields (swarm_reply_to_id, swarm_reply_to_content, swarm_reply_to_author) to posts table
- Add comprehensive TURNSTILE_SETUP.md documentation with setup instructions and security notes
- Create database migration 0007 with schema updates and indexes
- Protects against bot registrations and automated attacks on federated nodes
2026-01-26 18:10:48 +01:00
Christomatt cf0dfa4b66 feat: Implement dynamic node title metadata and enhance swarm user and post hydration. 2026-01-26 17:09:21 +01:00
Christomatt 3ba60cadf5 refactor: reformat PostCard component for improved readability and consistent styling. 2026-01-26 15:04:37 +01:00
Christomatt 38ddede873 feat: Enable deletion of swarm-originated posts and replies by propagating requests to remote nodes and improve swarm ID parsing. 2026-01-26 14:56:05 +01:00
Christomatt 74ec163625 feat: Implement infinite scrolling for posts and replies on the main feed and user profile pages using cursor-based pagination. 2026-01-26 14:34:45 +01:00
Christomatt a2ec470354 feat(posts): Add user replies tab and improve reply management
- Add "replies" tab to user profile page to display posts where user replied to others
- Implement replies fetching via new `type=replies` query parameter in posts API
- Add reply deletion permissions for parent post owners on their own posts
- Add swarm reply deletion notification to origin nodes when replies are deleted
- Pass `parentPostAuthorId` prop to PostCard for improved reply context tracking
- Update profile tab navigation to include replies tab for non-bot users
- Add loading and empty states for replies tab display
- Improve authorization logic to allow parent post owners to delete replies on their posts
2026-01-26 14:22:32 +01:00
Christomatt 141b99747a feat(posts): Add swarm reply tracking and thread visualization
- Add swarm reply metadata fields (swarmReplyToId, swarmReplyToContent, swarmReplyToAuthor) to posts table for tracking replies to federated posts
- Extend swarmReplyTo schema to include optional content and author information for context preservation
- Build synthetic replyTo objects from swarm reply metadata to unify local and federated reply handling
- Include media in replyTo relations across all post queries for complete reply context
- Add thread container styling with visual line connector between parent and child posts
- Implement thread parent display mode with reduced opacity and hidden actions for context
- Add showThread and isThreadParent props to PostCard for flexible thread rendering
- Enable inline parent post visualization when viewing post details to show conversation context
2026-01-26 13:50:15 +01:00
Christomatt 5d2c05dcbf fix(posts): Decode URL-encoded post IDs in API routes
- Add decodeURIComponent() to handle URL-encoded characters in post IDs
- Update like endpoint POST and DELETE handlers to decode rawId parameter
- Update repost endpoint POST and DELETE handlers to decode rawId parameter
- Update post retrieval GET handler to decode rawId parameter
- Fixes issues with special characters (e.g., %3A for colons) in post identifiers
2026-01-26 13:31:23 +01:00
Christomatt 9581fd2810 feat(swarm): Add real-time post fetching and reply aggregation for federated nodes
- Add swarm post ID parsing (format: swarm:domain:uuid) in local post endpoint
- Implement real-time fetching from origin node with 10s timeout
- Transform remote post data to match local format with swarm metadata
- Add reply aggregation from remote node with proper ID transformation
- Implement like status checking for authenticated users on remote posts
- Refactor swarm post endpoint to include reply data in response
- Add media transformation with swarm-prefixed IDs for remote posts
- Improve error handling with fallback to 404 for unreachable nodes
- Enable seamless cross-node post viewing with federated author information
2026-01-26 13:25:54 +01:00
Christomatt 08d507c196 feat(swarm): Add remote like tracking and federated like status queries
- Add remoteLikes table to track likes from federated nodes on local posts
- Implement deduplication logic in like/unlike endpoints to prevent duplicate remote likes
- Add GET endpoint at /api/swarm/posts/[id]/likes to query like status from origin nodes
- Enhance POST feed endpoint to separate local and swarm posts for interaction checks
- Query origin nodes in real-time to populate isLiked flag for federated posts in feeds
- Add error handling and 3-second timeout for remote like status queries
- Update schema to support remote like tracking with actor handle and domain
2026-01-26 13:16:59 +01:00
Christomatt f361e13e53 feat(swarm): Add direct swarm interaction delivery for likes, reposts, and unreosts
- Add swarm post handling to like endpoint with direct delivery to origin node
- Add swarm post handling to repost endpoint with direct delivery to origin node
- Add new unrepost endpoint for removing reposts from swarm posts
- Implement deliverSwarmUnrepost function in interactions library
- Extract swarm domain and post ID validation for all interaction types
- Return appropriate error responses for invalid swarm post IDs
- Log successful swarm interaction deliveries for debugging
- Improve separation between local post and swarm post handling logic
- Enable federated users to interact with remote swarm posts directly without local caching
2026-01-26 13:04:05 +01:00
Christomatt 12f515b7fb feat(notifications): Refactor notification system and consolidate interaction handlers
- Remove dedicated bot owner notification utility in favor of unified notification system
- Update all interaction endpoints (follow, like, mention, repost) to use consolidated notification flow
- Refactor notification route to handle all interaction types through single endpoint
- Update posts endpoints to trigger notifications through unified system
- Add database migration snapshot for notification schema changes
- Simplify notification logic by removing redundant bot owner notification module
- Improve notification consistency across all user interactions and post operations
2026-01-26 12:45:35 +01:00
Christomatt 17c68a99bf feat(notifications): Add notifications page with real-time updates and UI
- Implement notifications page component with loading and error states
- Add notification fetching from `/api/notifications` endpoint
- Create notification type interfaces (follow, like, repost, mention)
- Add "Mark all read" functionality to batch update notification status
- Implement NotificationItem component to display individual notifications
- Add relative time formatting (e.g., "5m", "2h", "3d")
- Display unread notifications with distinct background styling
- Add user avatar and profile links for notification actors
- Show post content preview for post-related notifications
- Handle authentication errors with appropriate user messaging
- Display empty state with icon when no notifications exist
2026-01-26 12:21:37 +01:00
Christomatt 8eee3b19c6 feat(users): Add remote placeholder refresh logic to user profile endpoint
- Add detection for remote placeholder users (handles containing @)
- Implement fresh data fetching from remote when placeholder is detected
- Refactor conditional logic to treat stale placeholders as missing users
- Only return 404 error if user is genuinely not found, not for refresh attempts
- Improves data freshness for federated user profiles by re-fetching from source
2026-01-26 12:10:46 +01:00
Christomatt 2fdcfce804 feat(db): Add favicon support and improve remote followers uniqueness constraint
- Add favicon_url column to nodes table for storing node instance favicons
- Replace actor_url unique constraint with composite unique index on (user_id, actor_url) in remote_followers table
- Update database schema and migration files to reflect new constraints
- Improve data integrity by ensuring remote followers are unique per user and actor combination
2026-01-26 11:20:32 +01:00
Christomatt a15933596c fix(swarm): Add error handling for notification creation in interactions
- Wrap notification creation in try-catch blocks for follow interactions
- Wrap notification creation in try-catch blocks for like interactions
- Wrap notification creation in try-catch blocks for repost interactions
- Add console logging for successful notification creation with interaction details
- Add error logging for failed notification creation to aid in debugging
- Prevent interaction failures from cascading due to notification errors
2026-01-26 11:12:32 +01:00
Christomatt 1c235e2027 feat(notifications): Add bot owner notifications for interactions
- Create new botOwnerNotify module with notifyBotOwnerForPost and notifyBotOwnerForFollow functions
- Add bot owner notifications to local post interactions (likes, reposts)
- Add bot owner notifications to swarm post interactions (likes, reposts, mentions)
- Add bot owner notifications to follow interactions (local and swarm)
- Implement mention notification creation for local mentions in post creation
- Notify bot owners when their bots receive interactions from other users
- Ensure bot owners are alerted to engagement on their bot accounts across federated network
2026-01-26 10:57:32 +01:00
Christomatt 5efd3adbfd feat(swarm): Add federated followers and following endpoints
- Create new swarm endpoints for fetching user followers list at /api/swarm/users/[handle]/followers
- Create new swarm endpoints for fetching user following list at /api/swarm/users/[handle]/following
- Add SwarmFollowerUser and SwarmFollowingUser interfaces for federated user data
- Implement local and remote follower/following aggregation in swarm endpoints
- Update local followers endpoint to fetch data from remote swarm nodes
- Update local following endpoint to fetch data from remote swarm nodes
- Add error handling and database availability checks for all endpoints
- Include node domain and timestamp metadata in swarm responses
- Support pagination with configurable limit parameter (max 100)
- Enable cross-node follower/following visibility for federated social graph
2026-01-26 10:43:08 +01:00
Christomatt fce820d59a feat(users): Add bot owner tracking to user profiles
- Add botOwnerHandle field to SwarmUserProfile interface to track bot ownership
- Include botOwner relationship in swarm user profile queries for bot users
- Populate botOwnerHandle in swarm profile responses when user is a bot
- Build botOwner object in local user profile endpoint when fetching remote bot profiles
- Include botOwner data in user profile responses for better bot attribution
- Enables tracking and displaying which user owns each bot across federated instances
2026-01-26 10:30:42 +01:00
Christomatt 728dda6b52 feat(timeline,background): Add live remote post fetching and background sync
- Implement live post fetching from followed remote users with parallel requests and timeouts
- Add remote-sync background task to periodically cache posts from followed remote users
- Optimize swarm node detection and prioritize swarm API over ActivityPub for faster responses
- Add timeout wrapper (5s per node) to prevent slow remote nodes from blocking timeline requests
- Enhance scheduler to support background sync tasks with configurable intervals
- Transform remote posts to match local format with proper media and author metadata
- Improve error handling and logging for remote user post fetching
- Replace cached-only approach with hybrid live/cached strategy for fresher content
2026-01-26 10:14:07 +01:00
Christomatt e98221e81a feat(bots): Consolidate bot posting into autonomous module and improve caching
- Remove scheduled posting logic and consolidate all bot posting into autonomous module
- Simplify cron endpoint to only call processAllAutonomousBots with cleaner response format
- Add background post caching for swarm follow operations via cacheSwarmUserPosts
- Update background scheduler to remove scheduled posting references and streamline logging
- Improve autonomous module documentation to clarify schedule-based posting with optional sources
- Enhance error tracking and reporting across bot task execution
- Reduce code duplication by eliminating separate scheduled/autonomous processing paths
2026-01-26 09:39:12 +01:00
root 731838dd48 Merge branch 'main' of https://github.com/cyph3rasi/Synapsis
commit
2026-01-26 08:36:08 +01:00
root 387314581f Initial commit 2026-01-26 08:34:48 +01:00
AskIt ac5e11ed38 Fix route issue 2026-01-26 07:24:08 +01:00
AskIt 599225a17d More 2026-01-26 06:07:38 +01:00
AskIt 2372f5c054 feat(swarm,interactions): Add federated interaction endpoints and update branding
- Add new swarm interaction endpoints for follow, unfollow, like, unlike, mention, and repost actions
- Create interactions.ts library module to handle federated interaction logic
- Add swarm post detail endpoint for retrieving individual post information
- Update post interaction routes to support federated operations
- Replace logo.svg with new logotext.svg for updated branding
- Update login page and sidebar components with new branding assets
- Enhance swarm discovery and type definitions to support new interaction patterns
- Update user follow endpoint to work with federated swarm interactions
2026-01-26 06:01:27 +01:00
AskIt 5e75482ec1 feat(bots): Add initial post trigger and improve scheduler logging
- Add initial post trigger on bot creation to establish schedule reference point
- Implement background post creation in scheduled bot processor using triggerPost
- Add fresh content fetching before checking availability in scheduler
- Enhance scheduler logging with detailed skip reasons and error reporting
- Include autonomous bot skip reasons and scheduled bot status details in logs
- Add error tracking and reporting for failed bot post attempts
- Improve debugging visibility for bot task execution and failures
2026-01-26 05:23:43 +01:00
AskIt 76e7d7fd55 feat(swarm,profile): Add swarm user profile endpoint and improve navigation
- Create new GET /api/swarm/users/[handle] endpoint for federated user profile queries
- Add SwarmUserProfile and SwarmUserPost interfaces for standardized remote profile data
- Include user profile metadata (handle, displayName, bio, avatar, stats) in swarm responses
- Fetch and include user's recent posts with media and link preview data
- Implement fetchSwarmUserPosts helper to query remote Synapsis nodes via swarm API
- Update /api/users/[handle]/posts to prioritize swarm API for Synapsis node federation
- Replace profile page back navigation from Link to router.back() button for better UX
- Add proper error handling and suspended user filtering in swarm endpoint
- Support configurable post limit (max 50) for swarm profile queries
2026-01-26 04:49:03 +01:00
AskIt 498f6bfccf feat(ui): Add node info loading state and increase post character limit
- Add nodeInfoLoaded state to track when node NSFW status is fetched
- Display loading indicator while node information is being retrieved
- Ensure loading state is set in both success and error cases
- Increase maximum post character limit from 400 to 600 characters
- Add getProfileHandle utility function to properly construct federated user profile links
- Include node domain in profile links for remote swarm users
- Update avatar and handle links to use full federated profile handles
- Improves UX by preventing premature NSFW gate display and supporting longer-form content
2026-01-26 04:31:39 +01:00
AskIt 3a5ebb66db feat(swarm,timeline): Add debug logging and improve localhost protocol handling
- Add debug information to swarm posts API response including NSFW filter status, source count, and post filtering metrics
- Add filteredCount field to timeline sources to track posts removed by NSFW filtering
- Implement protocol detection logic to use http:// for localhost and 127.0.0.1, https:// for all other domains
- Add comprehensive console logging for timeline queries showing node count, NSFW filter status, and per-node filtering details
- Move NSFW filtering logic earlier in the timeline aggregation to improve code clarity and enable better debugging
- Improve observability of the swarm timeline fetching process for troubleshooting filtering behavior
2026-01-26 04:06:42 +01:00
AskIt f17ffd8c88 fix(swarm,timeline): Include node NSFW status in post filtering
- Add node NSFW status check to post filtering logic
- Filter posts where either the post itself or its parent node is marked NSFW
- Ensure comprehensive NSFW content filtering across both post and node levels
- Prevents NSFW content from NSFW nodes from appearing in filtered timelines
2026-01-26 03:53:25 +01:00
AskIt 53b573b28d fix(swarm,timeline): Remove node-level NSFW cascade from post filtering
- Update NSFW flag logic to only consider post and author NSFW status
- Remove nodeIsNsfw from post-level isNsfw calculation
- Ensure node-level NSFW filtering is applied separately at node selection
- Prevents double-filtering and maintains consistent NSFW handling across timeline
2026-01-26 03:42:50 +01:00
AskIt a6019844b4 refactor(swarm,timeline): Move NSFW filtering from node selection to post level
- Remove node-level NSFW filtering logic from timeline queries
- Query all nodes regardless of NSFW status for more comprehensive results
- Apply NSFW filtering at the post level instead of node level
- Update filtering logic to check both explicit post flags and source node NSFW status
- Improve filtering comment to clarify that posts are filtered, not nodes
- This change ensures users can access content from NSFW nodes while still respecting their content preferences at the post level
2026-01-26 03:36:52 +01:00
AskIt b7e8727986 feat(swarm,posts): Add NSFW filtering and link preview enrichment
- Add NSFW content filtering based on user's nsfwEnabled session setting
- Pass includeNsfw preference to fetchSwarmTimeline in curated and swarm feeds
- Remove in-memory caching from swarm API route to respect per-user preferences
- Add link preview enrichment for swarm posts with URLs but no preview data
- Implement extractFirstUrl utility to parse URLs from post content
- Implement fetchLinkPreview to fetch metadata from external URLs with 3s timeout
- Implement enrichPostsWithPreviews to enrich posts asynchronously
- Skip video URLs (YouTube, Vimeo) from preview enrichment as they use VideoEmbed
- Update swarm API documentation to reflect NSFW filtering behavior
- Improves content discovery by enriching posts with link metadata while respecting user content preferences
2026-01-26 03:27:14 +01:00
AskIt dc9ed98091 feat(swarm,posts): Add federated reply support for swarm posts
- Add new /api/swarm/replies endpoint to receive and store replies from remote nodes
- Implement swarm reply detection in post detail page to route replies to origin node
- Update POST /api/posts to handle swarmReplyTo payload and deliver replies to remote nodes
- Enhance swarm post transformation to include originalPostId for reply tracking
- Improve media and link preview handling in swarm post responses
- Add swarmReplyTo schema validation with postId and nodeDomain fields
- Store remote replies with swarm identifiers (swarm:domain:id format) to prevent duplicates
- Enable cross-node reply federation with async delivery to origin nodes
- Update PostCard and Compose components to support federated reply workflows
2026-01-26 03:18:49 +01:00
AskIt 302ee41cd8 fixed video blur 2026-01-26 02:58:05 +01:00
AskIt 3f79490d4d style(video): Refactor blurred video container layout and improve sync handling
- Remove max-height constraint from blurred-video-container for flexible sizing
- Simplify background video positioning from centered transform to full coverage
- Add scale transform to background video for better blur effect coverage
- Update background video to use full width/height instead of 110% dimensions
- Add opacity transition state for background video loading
- Improve event listener cleanup with named handler functions
- Add error handling for background video playback with catch fallback
- Add loadeddata event listener to track video loading state
- Override post-media-item video background for transparent blurred container
- Enhance video synchronization reliability between main and background layers
2026-01-26 02:52:28 +01:00
AskIt b7b6076846 feat(admin,branding): Add favicon support and video blur component
- Add favicon_url column to nodes table via database migration
- Create favicon upload endpoint with media handling
- Implement favicon upload UI in admin panel with preview
- Add favicon removal functionality in admin settings
- Create BlurredVideo component for improved video rendering
- Update PostCard to use new BlurredVideo component
- Update node schema to include favicon_url field
- Add favicon upload state management and error handling
- Enables customization of browser tab icon for node branding
2026-01-26 02:47:33 +01:00
AskIt 7a95086161 Fixed video aspect ratio 2026-01-26 02:39:35 +01:00
AskIt af93ac8f47 feat(api,media,auth): Add video upload support and improve media handling
- Add video upload support with separate size limits (100MB for videos, 10MB for images)
- Support MP4, WebM, and MOV video formats alongside existing image formats
- Add video styling to post cards and compose component with proper object-fit
- Improve storage URL configuration with fallback error handling for missing endpoints
- Auto-enable NSFW settings when importing accounts from NSFW nodes
- Add age verification requirement for importing accounts on NSFW nodes
- Allow empty string for avatar and header URLs in profile update validation
- Update login page to display node name in browser title
- Enhance media upload validation with type-specific error messages
2026-01-26 02:26:16 +01:00
AskIt 981441bfe5 feat(auth,explore): Add NSFW content gating and age verification
- Add automatic NSFW settings for users registering on NSFW nodes
- Implement age verification checkbox on registration form for NSFW nodes
- Add NSFW node detection on explore page with gated content access
- Restrict unauthenticated users from viewing posts on NSFW nodes
- Fetch and display node NSFW status in explore and login pages
- Update node info type to include isNsfw flag across auth flows
- Display age-gated content warning with EyeOff icon for restricted access
- Enforce age verification requirement before registration on adult nodes
2026-01-26 01:54:02 +01:00
AskIt 091c85080b feat(auth,ui): Add dynamic node branding and NSFW content gating
- Replace hardcoded SynapsisLogo with dynamic Image component for custom node logos
- Add logoUrl support to node info state with proper TypeScript typing
- Implement nodeInfoLoaded state to ensure proper rendering timing
- Add NSFW node detection and content gating for unauthenticated users
- Display custom node logo on login page when available, fallback to default
- Show adult content warning gate on home page for NSFW nodes
- Improve error handling in node info fetch with explicit state updates
- Add EyeOff icon for NSFW content warning display
- Enhance login page layout with minHeight for consistent spacing during load
2026-01-26 01:44:51 +01:00
AskIt ff891af927 feat(branding,auth): Update app description and improve authentication flow
- Update manifest.json and layout metadata with comprehensive Synapsis description emphasizing decentralized infrastructure and global signal layer concept
- Expand login page default node description to match updated branding messaging
- Replace Next.js router navigation with hard window.location.href redirect to ensure authentication cookies are properly picked up after login/import
- Remove unused router and ShieldAlert imports from login page
- Add accent color luminance detection to ToastContext for dynamic text color contrast
- Implement intelligent text color selection in success toasts based on accent color brightness to ensure readability
- These changes improve authentication reliability and ensure consistent branding messaging across the application
2026-01-26 01:03:55 +01:00
AskIt 87db418ade chore(config): Remove hardcoded PORT from start script
- Remove hardcoded port 3000 from start script
- Allow PORT environment variable to control server port
- Simplifies deployment configuration across different environments
2026-01-26 00:30:57 +01:00
AskIt 52e7360c1f chore(config): Remove PORT environment variable configuration
- Remove PORT environment variable comment from .env.example
- Update start script to use hardcoded port 3000 instead of environment variable
- Simplify server configuration by removing optional PORT override
2026-01-26 00:27:53 +01:00
AskIt e7342087a5 chore(config,manifest): Update start script with PORT environment variable and theme color to white
- Update start script to accept PORT environment variable with default fallback to 3000
- Change manifest theme color from teal (#00d4aa) to white (#ffffff) for consistent branding
- Align theme configuration with recent accent color updates across the application
2026-01-26 00:17:54 +01:00