Skip to content

Stark Overflow is a decentralized Q&A platform inspired by Stack Overflow, built on the StarkNet blockchain. This project aims to provide a transparent, community-driven knowledge-sharing space with financial incentives for those who contribute quality answers.

Notifications You must be signed in to change notification settings

Kaylahray/stark_overflow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stark Overflow

Stark Overflow is a decentralized application (dApp) inspired by the concept of Stack Overflow, but with a financial incentive system. Using Starknet technology, this project allows users to ask questions and offer cryptocurrency rewards for the best answers.

🚀 Features

  • Gamified question-and-answer system.
  • Cryptocurrency deposits linked to each question.
  • Additional contributions from other users to increase the reward.
  • Automatic payment for the answer selected as the solution.
  • Frontend built with React and Typescript.
  • Smart Contracts written in Cairo for execution on Starknet.

📂 Project Structure

/stark_overflow
│
├── frontend/                                 # User interfaces
│   |── landing/                              # Landing page of the app
|   |
│   └── react/                                # The frontend of the app made in React
│       |── src/
│       |   |── @types
│       |   |── assets/                       # Images and icons
│       |   |── components/                   # Reusable components
│       |   |── hooks/                        # Custom hooks
│       |   |   |── useStatusMessage.ts       # Hook for managing status messages
│       |   |   └── useWallet.ts              # Hook for managing wallet connection
│       |   |── pages/                        # Main pages of the app
│       |   |   |── Home/                     # Main page of the app
│       |   |   |── Forum/                    # Page for viewing app's forums
│       |   |   |── QuestionPage/             # Page for asking a question
|       |   |   └── AnswerPage/               # Page for viewing answers to a question and give a new answer
│       |   |── providers/                    # General context providers for state management
│       |   |── services/                     # API services
│       |   |── styles/                       # Global styles and themes
│       |   └── utils/                        # Utility functions
│       |── App.tsx                           # Main application component
│       |── main.tsx                          # Entry point of the React app
|       └── router.tsx                        # Routes of the app
|
├── smartcontract/                            # Smart contracts written in Cairo
│   ├── src/                                  # Contract source code
│   │   ├── events.cairo                      # Event definitions
│   │   ├── lib.cairo                         # Entrypoint of the smart contract
│   │   ├── StarkOverflow.cairo               # Main contract logic
│   │   ├── structs.cairo                     # Struct definitions
│   │   |── types.cairo                       # Type definitions
│   |   └── tests/                            # Contract tests
│   │       ├── common.cairo                  # Common test functions
|   |       └── StarkOverflowTest.cairo       # Test cases for the main contract
│   └── Scarb.toml                            # Scarb project configuration
│
└── README.md                                 # General project documentation

⚙️ Installation

Prerequisites

1. Clone the repository

 git clone https://github.com/your-username/stark-overflow.git
 cd stark-overflow

2. Frontend Setup

cd frontend
npm install
# or
yarn install

3. Smart Contracts Setup

cd smartcontract
scarb build

🔍 How to Use

Starting the Frontend

cd frontend
npm start
# or
yarn start

Running Smart Contract Tests

cd smartcontract
scarb test

Deploying Contracts in Starknet Devnet

Linux:

  1. Install starknet-devnet. tutorial
  2. Install starknet foundry. tutorial
  3. Runs starknet-devnet with seed 0: starknet-devnet seed=0
    1. sncast --profile=devnet declare --contract-name=StarkOverflowToken
    2. sncast --profile=devnet declare --contract-name=StarkOverflow
  4. Deploy the contracts tutorial
    1. sncast --profile=devnet deploy --clash-hash=[StarkOverflowToken class hash] --salt=0 --arguments "'18', '100000000000000000000', [recipient address], [owner address], '1000000000000000000000'"
    2. sncast --profile=devnet deploy --clash-hash=[StarkOverflow class hash] --salt=0 --arguments "[StarkOverflowToken address]"

Windows:

  1. Install starknet-devnet via Docker. tutorial
  2. Install starknet foundry. tutorial
  3. Runs the container docker with starknet-devnet seed 0
    1. sncast --profile=devnet declare --contract-name=StarkOverflowToken
    2. sncast --profile=devnet declare --contract-name=StarkOverflow
  4. Deploy the contracts tutorial
    1. sncast --profile=devnet deploy --clash-hash=[StarkOverflowToken class hash] --salt=0 --arguments "'18', '100000000000000000000', [recipient address], [owner address], '1000000000000000000000'"
    2. sncast --profile=devnet deploy --clash-hash=[StarkOverflow class hash] --salt=0 --constructor-calldata=[StarkOverflowToken address]

🛠️ Technologies Used

  • React.js
  • Typescript
  • Styled-Components
  • Cairo (Starknet Language)
  • Scarb (Package manager for Cairo projects)

🤝 Contribution

  1. Fork the project
  2. Create a branch (git checkout -b feature/MyFeature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/MyFeature)
  5. Open a Pull Request to the development branch

📜 License

This project is licensed under the MIT License.

📧 Contact

Müller Esposito Nunes
LinkedIn Email

Community

Telegram

About

Stark Overflow is a decentralized Q&A platform inspired by Stack Overflow, built on the StarkNet blockchain. This project aims to provide a transparent, community-driven knowledge-sharing space with financial incentives for those who contribute quality answers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.2%
  • Cairo 14.5%
  • Other 1.3%