Skip to content

Snap (Instagram-like)

Snap (Instagram-like)

Photo/video social media with posts, stories, likes, following/followers, private accounts, follow requests, live streaming with chat/reactions/moderation, proximity audio for lives, and discover feed.

Database Tables

TablePurpose
phone_snap_accountsUser profiles -- identifier, username, display_name, avatar, bio, verified, is_private, followers/following/posts counts
phone_snap_postsPosts -- account_id, media_url, media_type, caption, likes, is_live, live_viewers
phone_snap_storiesEphemeral stories -- account_id, media_url, media_type, expires_at, views
phone_snap_likesPost like relationships (post_id, account_id)
phone_snap_followingFollow relationships (follower_id, following_id)
phone_friend_requestsFollow requests for private accounts (type = 'snap')
phone_social_notificationsSocial notifications for follow events

Server Callbacks

CallbackPurpose
gcphone:snap:getAccountReturns the caller's Snap account
gcphone:snap:createAccountCreates a new Snap account
gcphone:snap:updateAccountToggles private mode
gcphone:snap:getFeedReturns the global post feed with like status
gcphone:snap:getStoriesReturns non-expired stories
gcphone:snap:getDiscoverAccountsDiscover other accounts with follow status
gcphone:snap:getDiscoverFeedDiscover feed with search support
gcphone:snap:publishPostPublishes a post (job-restricted)
gcphone:snap:publishStoryPublishes a story (24h expiry)
gcphone:snap:toggleLikeLikes/unlikes a post (syncs count)
gcphone:snap:deletePostDeletes own post
gcphone:snap:deleteStoryDeletes own story
gcphone:snap:startLiveStarts a live stream
gcphone:snap:endLiveEnds a live stream
gcphone:snap:getLiveStreamsReturns all active live streams
gcphone:snap:joinLiveJoins a live stream as viewer
gcphone:snap:leaveLiveLeaves a live stream
gcphone:snap:sendLiveMessageSends chat message in a live stream
gcphone:snap:sendLiveReactionSends emoji reaction in a live stream
gcphone:snap:removeLiveMessageHost removes a chat message
gcphone:snap:muteLiveUserHost mutes a viewer
gcphone:snap:getLiveAudioSessionReturns proximity audio config for a live stream
gcphone:snap:followFollow/unfollow (handles private accounts)
gcphone:snap:getPendingFollowRequestsGets incoming follow requests
gcphone:snap:getSentFollowRequestsGets outgoing follow requests
gcphone:snap:respondFollowRequestAccept/reject a follow request
gcphone:snap:cancelFollowRequestCancel a sent follow request
gcphone:snap:getProfileGets a user profile with posts and relationship

Config Options

lua
Config.Snap = {
    StoryDuration   = 86400,
    MaxPostsPerDay  = 50,
    AllowLive       = true,
    MaxLiveDuration = 3600,
    LiveAudio = {
        Enabled           = true,
        ListenDistance     = 25.0,
        LeaveBufferMeters = 2.0,
        MinVolume         = 0.08,
        MaxVolume         = 1.0,
        DistanceCurve     = 1.35,
        VolumeSmoothing   = 0.35,
        UseMumbleRangeClamp = true,
        UpdateIntervalMs  = 220,
    },
}

Config.PublishJobs.snap = {}
Config.Security.RateLimits.snap = 1500

Exports

None.

Released under GPL-3.0 License