Skip to content

sunglow666/WeNEAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

WeNEAR - Web3 Social Platform

A decentralized social media platform built on the NEAR Protocol, featuring real-time posting, likes, comments, and user profiles.

๐ŸŒŸ Features

  • Decentralized Social Network: Built on NEAR Protocol for true ownership of data
  • Wallet Integration: Connect with NEAR wallets (MyNearWallet, HereWallet, Meteor)
  • Real-time Posting: Create and share posts with the community
  • Social Interactions: Like posts, add comments, and follow users
  • User Profiles: Customizable profiles with bio, avatar, and stats
  • Responsive Design: Modern UI that works on all devices
  • Low Gas Fees: Leverage NEAR's efficient blockchain for minimal transaction costs

๐Ÿš€ Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
  • Blockchain: NEAR Protocol
  • Smart Contract: Rust
  • Wallet Integration: NEAR Wallet Selector
  • Icons: Lucide React
  • Styling: Tailwind CSS with custom components

๐Ÿ“ฆ Installation

  1. Clone the repository

    git clone <repository-url>
    cd wenear
  2. Install dependencies

    npm install
  3. Start the development server

    npm run dev
  4. Open your browser Navigate to http://localhost:12000

๐Ÿ”ง Smart Contract

The smart contract is written in Rust and provides the following functionality:

Contract Methods

  • create_post(content: String) - Create a new post
  • get_posts(limit: Option<u32>) - Retrieve recent posts
  • like_post(post_id: String) - Like a specific post
  • add_comment(post_id: String, content: String) - Add a comment to a post
  • follow_user(account_id: AccountId) - Follow another user
  • update_profile(name: String, bio: String, avatar: String) - Update user profile
  • get_user_profile(account_id: AccountId) - Get user profile information

Building the Contract

  1. Install Rust and wasm32 target

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup target add wasm32-unknown-unknown
  2. Build the contract

    cd contract
    ./build.sh

Deploying the Contract

  1. Install NEAR CLI

    npm install -g near-cli
  2. Login to NEAR

    near login
  3. Deploy the contract

    near deploy --accountId your-contract.testnet --wasmFile out/wenear_contract.wasm
  4. Initialize the contract

    near call your-contract.testnet new '{}' --accountId your-account.testnet

๐ŸŒ Usage

Connecting Your Wallet

  1. Click "Connect Wallet" in the header
  2. Choose your preferred NEAR wallet
  3. Approve the connection
  4. Start posting and interacting!

Creating Posts

  1. Connect your wallet
  2. Type your message in the post form
  3. Click "Post" to publish to the blockchain
  4. Your post will appear in the feed

Interacting with Posts

  • Like: Click the heart icon to like posts
  • Comment: Click the comment icon and add your thoughts
  • Share: Share posts with others (coming soon)

Following Users

  • Visit user profiles
  • Click "Follow" to stay updated with their posts
  • View your following list in the sidebar

๐ŸŽจ Customization

Styling

The app uses Tailwind CSS for styling. You can customize the appearance by:

  1. Modifying the Tailwind configuration in tailwind.config.js
  2. Updating component styles in the respective component files
  3. Adding custom CSS in src/app/globals.css

Adding Features

The modular architecture makes it easy to add new features:

  1. New Components: Add to src/components/
  2. New Pages: Add to src/app/
  3. Contract Methods: Update src/lib/near.ts and the Rust contract
  4. Types: Update src/types/index.ts

๐Ÿ”’ Security

  • All transactions are signed by the user's wallet
  • Smart contract code is open source and auditable
  • No private keys are stored in the application
  • All data is stored on the NEAR blockchain

๐ŸŒ Network Configuration

The app is currently configured for NEAR Testnet:

To switch to Mainnet, update the configuration in src/lib/near.ts.

๐Ÿ“ฑ Mobile Support

The application is fully responsive and works on:

  • Desktop browsers
  • Mobile browsers
  • Tablet devices
  • Progressive Web App (PWA) support coming soon

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“„ License

This project is open source and available under the MIT License.

๐Ÿ†˜ Support

๐Ÿš€ Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure environment variables if needed
  3. Deploy automatically on push to main

Other Platforms

The app can be deployed to any platform that supports Next.js:

  • Netlify
  • AWS Amplify
  • Railway
  • DigitalOcean App Platform

๐Ÿ”ฎ Roadmap

  • Direct messaging
  • Image and video uploads
  • NFT integration
  • Token rewards for engagement
  • Advanced search and filtering
  • Mobile app (React Native)
  • Push notifications
  • Content moderation tools

Built with โค๏ธ on NEAR Protocol

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors