A modern, AI-powered smart contract generator that uses DeepSeek LLM to create intelligent contracts for ResilientDB based on natural language descriptions.
- AI-Powered Generation: Uses DeepSeek LLM to understand your requirements and generate appropriate smart contracts
- Dark Theme UI: Beautiful, modern interface that matches your development tools
- Modular Architecture: Clean, maintainable codebase with reusable components
- Detailed Contract View: Comprehensive contract analysis with method explanations
- ResilientDB Integration: Generates contracts in the correct format for ResilientDB
- Node.js 18+
- npm or yarn
- DeepSeek API key
- Clone the repository:
git clone <repository-url>
cd smart-contract-generator- Install dependencies:
npm install-
Configure your DeepSeek API key (see Configuration section below)
-
Start the development server:
npm run dev- Open your browser to
http://localhost:5173
-
Get your API key: Sign up at DeepSeek Platform and get your API key
-
Configure the API key in one of these ways:
Option A: Environment variables
# Create a .env file in the project root VITE_DEEPSEEK_API_KEY=your_actual_deepseek_api_key_here VITE_DEEPSEEK_BASE_URL=https://api.deepseek.com/v1 VITE_DEEPSEEK_MODEL=deepseek-chatOption B: Direct configuration
- Edit the relevant service file in
src/services/to include your API key (not recommended for production).
- Edit the relevant service file in
-
Describe Your Contract: Enter a natural language description of what you want your smart contract to do. For example:
"Create a contract where Alice and Bob need to approve before any changes can be made to the document" -
Generate: Click "Generate Contract" and wait for the AI to create your contract
-
Review: View the generated contract details, methods, and JSON format
-
Copy or Download: Use the generated Solidity or JSON in your ResilientDB application
- LandingPage: Intro and onboarding
- ChatbotPage: Main chat interface for contract generation
- Chatbot: The core chat and contract generation logic
- Footer: App footer and links
- Navbar: App navigation and branding
- UI assets: Custom CSS and SVGs for styling
- deepseekService.ts: Handles communication with DeepSeek API
- contractValidator.ts: Validates and analyzes generated contracts
src/
โโโ components/ # React components (Navbar, Footer, etc.)
โโโ Pages/ # Main pages (LandingPage, ChatbotPage)
โโโ services/ # Business logic (deepseekService, contractValidator, Chatbot)
โโโ assets/ # Images and SVGs
โโโ App.tsx # Main application (handles navigation)
โโโ main.tsx # Entry point
โโโ index.css # Global styles
โโโ components/ui/ # UI-specific CSS
- Navigation is handled via React state in
App.tsx.
The application is configured to use DeepSeek's API for smart contract generation. The integration includes:
- Automatic API calls to DeepSeek's chat completions endpoint
- Structured prompts optimized for smart contract generation
- Error handling with user feedback
- Response parsing to extract contract details and convert to ResilientDB format
The DeepSeek integration is configured via environment variables or directly in the service file:
VITE_DEEPSEEK_API_KEY=your_api_key_here
VITE_DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
VITE_DEEPSEEK_MODEL=deepseek-chatThe application uses Tailwind CSS with a custom dark theme. You can customize:
- Colors in
tailwind.config.js - Global styles in
src/index.css - Component-specific styles in each component
Modify the system prompt in the DeepSeek service to change how contracts are generated.
npm run buildThe built files in dist/ can be deployed to any static hosting service:
- Vercel
- Netlify
- GitHub Pages
- AWS S3
- etc.
Important: For production deployment, use environment variables to configure your API key instead of hardcoding it in the source code.
We're excited to participate in Hacktoberfest 2025! This is a great opportunity for developers of all skill levels to contribute to open source projects and earn some awesome swag.
-
Sign up for Hacktoberfest 2025
- Visit hacktoberfest.com
- Register with your GitHub account
- Choose between contributing to open source or planting trees
-
Find Issues to Work On
- Look for issues labeled with
hacktoberfestin our repository - Check out
good first issuelabels for beginner-friendly tasks - Browse our Issues page for available tasks
- Look for issues labeled with
-
Contribution Guidelines
- Fork this repository
- Create a new branch for your contribution:
git checkout -b feature/your-feature-name - Make your changes following our coding standards
- Test your changes thoroughly
- Submit a pull request with a clear description
- ๐ข Good First Issues: Perfect for first-time contributors
- ๐ก Intermediate: For developers with some experience
- ๐ด Advanced: For experienced developers looking for a challenge
- ๐ Documentation: Help improve our docs and guides
- ๐ Bug Fixes: Help us squash bugs and improve stability
- New Features: Add functionality to improve the smart contract generator
- UI/UX Improvements: Enhance the user interface and experience
- Documentation: Improve guides, tutorials, and code comments
- Testing: Add unit tests, integration tests, or end-to-end tests
- Bug Fixes: Help identify and fix issues
- Performance: Optimize code and improve application performance
- Accessibility: Make the application more accessible to all users
To ensure your contribution is accepted:
- Your code follows our existing style and conventions
- You've tested your changes locally
- Your pull request includes a clear description of changes
- You've linked any related issues
- Your commits are well-documented with clear messages
All valid contributions will be:
- Reviewed promptly by our maintainers
- Merged if they meet our quality standards
- Counted toward your Hacktoberfest 2025 progress
- Acknowledged in our contributors list
- Join our discussions in GitHub Discussions
- Check out our Contributing Guide for detailed information
- Feel free to ask questions in issue comments
Happy Hacking! ๐
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the browser console for errors
- Verify your DeepSeek API key is correct
- Ensure you have a stable internet connection
- Check the DeepSeek API status page
- Support for more contract frameworks (Ethereum, Solana, etc.)
- Contract validation and testing
- Template library for common contract patterns
- Integration with ResilientDB deployment
- Contract versioning and history
- Multi-language support
- Advanced contract analysis
- Support for other LLM providers (OpenAI, Anthropic, etc.)