A decentralized social media platform built on the NEAR Protocol, featuring real-time posting, likes, comments, and user profiles.
- 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
- 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
-
Clone the repository
git clone <repository-url> cd wenear
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:12000
The smart contract is written in Rust and provides the following functionality:
create_post(content: String)- Create a new postget_posts(limit: Option<u32>)- Retrieve recent postslike_post(post_id: String)- Like a specific postadd_comment(post_id: String, content: String)- Add a comment to a postfollow_user(account_id: AccountId)- Follow another userupdate_profile(name: String, bio: String, avatar: String)- Update user profileget_user_profile(account_id: AccountId)- Get user profile information
-
Install Rust and wasm32 target
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup target add wasm32-unknown-unknown
-
Build the contract
cd contract ./build.sh
-
Install NEAR CLI
npm install -g near-cli
-
Login to NEAR
near login
-
Deploy the contract
near deploy --accountId your-contract.testnet --wasmFile out/wenear_contract.wasm
-
Initialize the contract
near call your-contract.testnet new '{}' --accountId your-account.testnet
- Click "Connect Wallet" in the header
- Choose your preferred NEAR wallet
- Approve the connection
- Start posting and interacting!
- Connect your wallet
- Type your message in the post form
- Click "Post" to publish to the blockchain
- Your post will appear in the feed
- Like: Click the heart icon to like posts
- Comment: Click the comment icon and add your thoughts
- Share: Share posts with others (coming soon)
- Visit user profiles
- Click "Follow" to stay updated with their posts
- View your following list in the sidebar
The app uses Tailwind CSS for styling. You can customize the appearance by:
- Modifying the Tailwind configuration in
tailwind.config.js - Updating component styles in the respective component files
- Adding custom CSS in
src/app/globals.css
The modular architecture makes it easy to add new features:
- New Components: Add to
src/components/ - New Pages: Add to
src/app/ - Contract Methods: Update
src/lib/near.tsand the Rust contract - Types: Update
src/types/index.ts
- 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
The app is currently configured for NEAR Testnet:
- Network: Testnet
- RPC URL: https://rpc.testnet.near.org
- Wallet URL: https://testnet.mynearwallet.com/
- Explorer: https://testnet.nearblocks.io
To switch to Mainnet, update the configuration in src/lib/near.ts.
The application is fully responsive and works on:
- Desktop browsers
- Mobile browsers
- Tablet devices
- Progressive Web App (PWA) support coming soon
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is open source and available under the MIT License.
- Documentation: NEAR Docs
- Community: NEAR Discord
- Issues: Create an issue in this repository
- Connect your GitHub repository to Vercel
- Configure environment variables if needed
- Deploy automatically on push to main
The app can be deployed to any platform that supports Next.js:
- Netlify
- AWS Amplify
- Railway
- DigitalOcean App Platform
- 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