Casper Onchain Surveys is a survey platform built on top of the Casper blockchain. This project allows users to create and participate in surveys while ensuring the data is securely stored on the blockchain.
This project is divided into two parts: a client-side React application and a server-side Node.js application.
NOTE: YOU MUST HAVE AN ACTIVE ACCOUNT IN CASPER BLOCK CHAIN TO USE THIS APPLICATION!
To get started, follow these steps:
- Clone the repository.
- Install dependencies for both the client and the server.
- Create environment file for the server.
- Launch a MongoDB
- Run the client and the server.
git clone https://github.com/yunusem/onchainsurveys.git
cd onchainsurveys
# Install client dependencies
cd client
npm install
# Install server dependencies
cd ../server
npm install
# Create .env file under server directory
cd server
touch .env
Include the following variables in the .env file:
MONGODB_URI=mongodb://localhost:27017/onchainsurveys
JWT_SECRET=your_jwt_secret
PORT=3001
RPC=http://3.136.227.9:7777/rpc
- Install MongoDB on your local machine following the official documentation.
- Start the MongoDB service.
- Update the MONGODB_URI in the server's .env file with your local MongoDB connection string:
MONGODB_URI=mongodb://localhost:27017/onchainsurveys
- Create a free account on MongoDB Atlas.
- Set up a new cluster.
- Obtain the connection string for your cluster.
- Update the MONGODB_URI in the server's .env file with the obtained connection string:
MONGODB_URI=your_mongodb_atlas_connection_string
Client
cd client
npm start
This will start the client-side React application at http://localhost:3000
Server
cd ../server
npm start
This will start the server-side Node.js application at http://localhost:3001
Simply run:
npm install --only=dev
npm test
for each module inside both client
and server
directories.
You can set fee amount per question storage and the commition rate under cost of the services. Simply update the .admin file under your server root:
FEE=10
CRATE=9
the reading of the values is dynamic you can edit them in runtime.