A revolutionary AI-powered contract management system that transforms the way organizations handle agreements. By combining the power of OpenAI's language models with DocuSign's eSignature capabilities, this solution streamlines the entire contract lifecycle from drafting to signing.
- Smart Clause Review: Automatically analyzes contract clauses for potential issues
- Language Optimization: Suggests clearer, more precise wording
- Risk Assessment: Color-coded risk scores with detailed clause-by-clause analysis
- Policy Compliance: Ensures alignment with organization policies
- Real-time Collaboration: Multiple parties can review and suggest changes
- Version Control: Track all modifications with detailed audit trail
- Change Impact Analysis: AI evaluates the implications of proposed changes
- Smart Suggestions: Context-aware recommendations for alternative clauses
- Secure eSignature Flow: Seamless integration with DocuSign's eSignature API
- Multiple Signer Support: Configurable signing order and roles
- Template Management: Save and reuse common contract templates
- Document Generation: Automatic PDF conversion with Unicode support
- Authentication: Secure JWT-based authentication
Before running the application, you'll need to update the server URLs in three files: They are currently set to my test for the hackathon.
-
app.py (line 77): CORS(app, resources={r"/*": {"origins": "http://127.0.0.1:5000"}})
-
static/js/app.js (line 7): const API_BASE_URL = 'http://127.0.0.1:5000';
-
static/js/config.js (line 7): export const SERVER_URL = 'http://127.0.0.1:5000';
Update these URLs to match your server configuration. For local development, use 127.0.0.1:5000 or your preferred local server address.
- Python 3.8+
- DocuSign Developer Account
- OpenAI API Key (GPT-4 access required)
- Node.js and npm
- Clone the repository:
git clone https://github.com/RealShocky/docusign.git
cd docusign- Install Python dependencies:
pip install -r requirements.txt-
Configure environment variables:
- Copy
.env.exampleto.env - Fill in your API keys and configuration:
OPENAI_API_KEY=your_openai_api_key DOCUSIGN_AUTH_SERVER=account-d.docusign.com DOCUSIGN_BASE_PATH=https://demo.docusign.net/restapi DATABASE_URL=sqlite:///contracts.db FLASK_APP=app.py
- Copy
-
Set up DocuSign Integration:
- Create a DocuSign Developer Account at developers.docusign.com
- Create an Integration Key (Client ID)
- Generate RSA Keypair
- Save private key as 'private.key'
- Add public key to DocuSign
- Grant consent to the application
-
Initialize the database:
# Run the database migration script
python migrations/add_invitations.py
# Verify the database was created
# You should see a new contracts.db file in your project directory- Start the application:
python app.py- Flask: Python web framework
- SQLAlchemy: Database ORM
- OpenAI GPT-4: AI-powered analysis and risk assessment
- DocuSign eSignature API: Digital signature integration
- FPDF: PDF generation with Unicode support
- React: Dynamic UI components
- Tailwind CSS: Modern, responsive design
- JavaScript: Interactive features
- Fetch API: Asynchronous data handling
- JWT Authentication: Secure API access
- Environment Variables: Protected credentials
- CORS: Controlled resource sharing
POST /api/analyze
Content-Type: application/json
{
"content": "Contract text here"
}
Response:
{
"analysis": {
"summary": "...",
"suggestions": [...],
"risks": [...]
}
}POST /api/analyze/risks
Content-Type: application/json
{
"content": "Contract text here"
}
Response:
{
"overall_risk_score": 5,
"risk_summary": "...",
"clauses": [
{
"clause": "...",
"risk_level": "high|medium|low",
"details": "..."
}
]
}POST /api/send
Content-Type: application/json
{
"contract": "Contract text",
"signers": [
{
"name": "John Doe",
"email": "john@example.com"
}
]
}-
Enhanced Risk Assessment:
- Added color-coded risk levels (red, yellow, green)
- Implemented detailed clause-by-clause analysis
- Added overall risk score calculation
- Improved risk analysis UI with modern design
-
PDF Generation Improvements:
- Added Unicode character support
- Fixed special character handling
- Improved formatting consistency
-
UI Enhancements:
- Added ContractIQ logo
- Improved layout and responsiveness
- Removed duplicate UI elements
- Enhanced modal designs
- Fixed PDF generation Unicode encoding issues
- Resolved duplicate UI elements in contract analysis
- Fixed risk assessment display issues
- Improved error handling in API endpoints
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- DocuSign Developer Team
- OpenAI API Team
- Flask Framework Community
- All contributors and testers
For support, please:
- Check the Issues page
- Review existing documentation
- Create a new issue if needed
Built with for the DocuSign Good Code Hackathon 2024