Chakra Drive is a decentralized file storage and sharing platform built on the Solana blockchain.
It's end-to-end encrypted (on private files) and free-to-use up to 10GBs, powered by Irys Network.
- Prerequisites
- Installation
- Database Setup
- Environment Configuration
- Running the Application
- API Endpoints
- Testing
- Troubleshooting
- Encryption Scheme
Before you begin, ensure you have the following installed:
- Node.js (v14 or later)
- npm (v6 or later)
- PostgreSQL (v12 or later)
- Solana CLI tools
- Git
-
Clone the repository:
git clone https://github.com/yourusername/chakra-drive.git cd chakra-drive -
Install dependencies:
npm install
-
Install PostgreSQL if you haven't already.
-
Create a new database for Chakra Drive:
createdb chakra_drive -
The application uses Prisma as an ORM. To set up the database schema, run:
npx prisma migrate devThis command will create the necessary tables in your database.
-
Create a
.envfile in the root directory of the project. -
Add the following environment variables to the
.envfile:DATABASE_URL="postgresql://username:password@localhost:5432/chakra_drive" JWT_SECRET="your-secret-key" NEXT_PUBLIC_IRYS_NODE_URL="https://node1.irys.xyz" NEXT_PUBLIC_RPC_URL="https://api.mainnet-beta.solana.com" NEXT_PUBLIC_APP_URL="http://localhost:3000"Replace
username,password, and other placeholder values with your actual configuration.
-
Start the development server:
npm run dev -
Open your browser and navigate to
http://localhost:3000.
The application provides several API endpoints for file and user management. Here are some key endpoints:
POST /api/user/login: User loginGET /api/file: List filesPOST /api/file: Upload a fileGET /api/folder: List foldersPOST /api/folder: Create a new folder
For a complete list of endpoints and their usage, refer to the API documentation or the route files in the src/app/api directory.
To run the test suite:
npm test
This will execute the tests defined in src/test/test.ts.
- If you encounter database connection issues, ensure that your PostgreSQL server is running and that the
DATABASE_URLin your.envfile is correct. - For Solana-related issues, make sure your wallet is properly funded and that the
SOLANA_PRIVATE_KEY_PATHis correct. - If you have issues with Irys uploads, check that your Solana wallet has sufficient balance and that the
IRYS_NODE_URLis accessible.
For more detailed troubleshooting, refer to the error messages in the console or server logs.
For details on how our encryption scheme works with Lit Protocol, please check out the Lit_Protocol.MD file
For additional help or to report issues, please open an issue on the GitHub repository.