Skip to content

akashbiswas0/Arkgram

Repository files navigation

ArkGram

Arkgram is a decentralized social media platform built on Arkiv, enabling users to share posts, stories, and media content in a censorship-resistant environment. Users can create posts with images and captions, view real-time feeds, manage profiles, and engage with content through comments, all powered by Arkiv.

Architecture and user flow

What it does?

Core Functionality

  • Post Creation: Users can create posts with images, captions, and media content stored securely on the blockchain
  • Real-time Feed: Dynamic feed system that displays posts from followed users and trending content
  • Stories: Temporary content sharing with automatic 24 hours expiration for ephemeral storytelling

Project Setup and Initialization

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/akashbiswas0/arkgram.git
    cd arkgram
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Environment Configuration:

    Copy the example environment file and configure your variables:

    cp .env.example .env.local 

    Configure the following environment variables in your .env file:

    ARKIV_PRIVATE_KEY=your_arkiv_private_key_here

    Note: You'll need to obtain an Arkiv Network private key to interact with the blockchain. Contact the Arkiv team or check their documentation for setup instructions.

Development

  1. Start the development server:

    npm run dev
    # or
    yarn dev

    The application will be available at http://localhost:3000

Building for Production

  1. Build the application:

    npm run build
    # or
    yarn build
  2. Start the production server:

    npm start
    # or
    yarn start

Arkiv Features by Module

Based on codebase analysis, here's how ArkGram features leverage Arkiv capabilities:

CRUD Operations + Advanced Querying

  • Posts: Create entities with image, metadata, and post data; query by type and attributes
  • Feed: Complex queries with pagination, filtering by post type and timestamps
  • Stories: Entity creation with rich attributes, querying by story type and expiration
  • Profiles: User profile creation and querying with attribute-based filtering

TTL-Aware User Experience

  • Stories: Configurable TTL (1 minute, 5 minutes, 24 hours) for ephemeral content
  • Posts: 7-day TTL for regular content with automatic expiration
  • Media: TTL-based cleanup of images and metadata at blockchain level

Real-Time Subscriptions

  • Live Feed: Server-Sent Events for real-time post updates (currently polling-based)
  • Feed Streaming: Event-driven content delivery without page refreshes

Advanced JSON-RPC Integration

  • Wallet Connection: MetaMask integration for blockchain authentication
  • Transaction Handling: Multi-entity creation with receipt confirmation
  • Content Ownership: Cryptographic verification of user-generated content

Arkiv Network Modules Used

ArkGram leverages the following @arkiv-network/sdk modules (v0.4.4):

Core SDK Modules

  • @arkiv-network/sdk - Core client creation (createWalletClient, createPublicClient, http)
  • @arkiv-network/sdk/accounts - Account management (privateKeyToAccount)
  • @arkiv-network/sdk/chains - Network configuration (mendoza testnet)

Query & Data Modules

  • @arkiv-network/sdk/query - Query building (eq for equality operations)
  • @arkiv-network/sdk/utils - Utilities (ExpirationTime, jsonToPayload)
  • @arkiv-network/sdk/types - TypeScript types (Entity)

About

basic social media on Arkiv

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages