A decentralized application for news token creation and trading, built on Solana.
News.fun is a platform that allows users to create and trade tokens related to news articles and topics. The platform leverages Solana blockchain technology to enable:
- Creation of bonding curves for news-related tokens
- Trading of tokens through both bonding curves and liquidity pools
- Article and topic indexing with connections to Wikipedia information
- Seamless user experience through a modern React frontend
The project consists of multiple components working together to provide a complete decentralized news token trading experience.
The project follows a monorepo structure with the following components:
- Modern React application built with Vite
- Provides user interface for token creation, trading, and management
- Connects to backend services via tRPC
- Server: Provides API endpoints for the frontend, handling communication with the blockchain
- Indexer: Processes and indexes news articles and blockchain data
- Solana Programs: Smart contracts that implement bonding curves and token functionality
- Leverages the Pump Science protocol for bonding curve mechanics
- Common types and functions used across frontend and backend components
- Node.js (v16 or later)
- pnpm for package management
- Solana CLI tools for blockchain interaction
- Supabase account for database services
-
Clone the repository:
git clone https://github.com/0xhank/profiteer.git cd profiteer -
Install dependencies:
pnpm install -
Set up environment variables:
cp .env.example .envEdit the
.envfile with your specific configuration settings. -
Generate database types (if using Supabase):
pnpm gen:db-types
pnpm node
pnpm dev:server
pnpm dev:react
pnpm dev:indexer
pnpm dev
profiteer/
├── apps/
│ ├── react/ # Frontend application
│ ├── server/ # Backend API server
│ └── indexer/ # Data indexing service
├── packages/
│ ├── programs/ # Solana programs (smart contracts)
│ └── shared/ # Shared utilities and types
└── .tsconfigs/ # TypeScript configurations
- Make changes to your code
- Test changes locally with
pnpm dev - Commit and push your changes
- Deploy to your target environment
Each component has its own testing methodology:
- Frontend: Component and integration tests
- Backend: API and service tests
- Solana Programs: Unit and integration tests using the Anchor framework
The React app can be deployed using Vercel or any other static site hosting platform:
cd apps/react
pnpm build
The server and indexer can be deployed using Docker:
# Server
cd apps/server
docker build -t profiteer-server .
# Indexer
cd apps/indexer
docker build -t profiteer-indexer .
Deploy Solana programs to the desired network (devnet or mainnet):
cd packages/programs
anchor deploy
The backend provides a tRPC API with endpoints for:
- Authentication
- Token creation and management
- Swapping and trading
- Article information retrieval
- Blockchain interaction
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.