Skip to content

eloiweb3/journey

Repository files navigation

Description

Journey is a Solana blockchain application that enables users to create, update, and delete personal journal entries. Each entry consists of a title and message, with entries stored securely on the Solana blockchain. This document provides a high-level overview of the Journey program architecture, core components, and their interactions.

System architecture

The App follows a layered architecture pattern that separates concerns across multiple components:

image

Core components

Solana Program

Journey Solana program is implemented in Rust using the Anchor framework. It serves as the backend for the application, handling all data storage and transaction logic.

The program provides three main instructions:

image

Each entry is stored in a JourneyEntryState account, which contains:

  • Owner (the user's public key)
  • Title (limited to 50 characters)
  • Message (limited to 1000 characters)

Account structure

The program uses Program Derived Addresses (PDAs) to deterministically generate account addresses based on the title and owner. This ensures:

  1. Each user can only have one entry with a given title
  2. Entries can be easily located given the title and owner
image

Data flow

The following sequence diagram illustrates the flow of data when creating a new journey entry:

image

UI Components

The Journey application provides several UI components for interaction:

image

The UI components interact with the Solana program through custom React hooks that handle data fetching and mutation.

image

Technical Implementation

The Journey program uses several key technologies:

Solana Blockchain: For secure, decentralized storage of journal entries Anchor Framework: Simplifies Solana program development React: For building the user interface Next.js: For the web application framework Key technical aspects include:

Program ID: The Solana program has a unique identifier specified in declare_id! Account Space Management: The program pre-allocates space for each entry account Owner Verification: Only the owner of an entry can update or delete it PDA Derivation: Accounts are derived using the entry title and owner public key

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published