I created SolGuard AI to bring Solidity contract management and security review into one workspace. It lets developers upload source files, inspect potential issues, and explore suggestions for further analysis. This project showcases my work with Next.js, Supabase, and LLM integrations.
Important: Automated findings are not a security guarantee and may be incomplete or incorrect. Validate results with independent testing and qualified security review before deploying a contract.
The report score is a simple severity-weighted triage aid, not a probability of exploitation. Code metrics and gas/best-practice prompts are source-pattern estimates, not compiler or runtime analysis. Verify gas behavior with the target compiler and test environment.
The static scan is a bounded set of AST pattern checks, not a complete Solidity security analyzer or compiler. AI findings are produced by the configured OpenAI model, but still require manual verification. Gas suggestions are review prompts only; the app does not claim measured gas savings. Project deletion removes its contracts, audits, and associated reports.
- AI-assisted vulnerability review — submit the selected contract to OpenAI after explicit consent, and save the provider's findings and review prompts.
- Static Solidity analysis — parse Solidity syntax and report configured AST patterns with source locations; invalid source is rejected rather than shown as a clean scan.
- Structured audit reports — review searchable findings, severity triage, gas review prompts, best-practice suggestions, and downloadable JSON/Markdown reports.
- Conservative patching — preview and apply the SPDX-header fix only after choosing the correct license; other changes remain manual review items.
- Contract workspace — upload and manage Solidity (
.sol) files through a project dashboard. - Contextual findings — inspect highlighted code and review remediation suggestions.
- Authentication and persistence — use Supabase for authentication, database storage, and file storage.
- Modern web stack — built with Next.js, React, and Tailwind CSS.
| Area | Technology |
|---|---|
| Web application | Next.js 14, React, JavaScript, Node.js |
| Styling | Tailwind CSS |
| Database and storage | Supabase, PostgreSQL, Row Level Security (RLS) |
| AI review | OpenAI API / compatible LLM provider |
| Contract language | Solidity |
.
├── app/ or pages/ # Application routes and screens
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and shared clients
├── services/ # Business logic and API integrations
├── public/ # Static assets
├── supabase-schema.sql # Database schema and RLS policies
├── package.json # Dependencies and scripts
└── .env.local.example # Environment variable template
The exact directories may vary depending on the project version.
- Git
- Node.js LTS and npm
- A Supabase project
- An OpenAI API key or credentials for the configured LLM provider
-
Clone the repository and enter the project directory:
git clone git@github.com:fathiaomar/SolGuard-AI.git cd SolGuard-AI -
Install dependencies:
npm install
-
Create your local environment file:
cp .env.example .env.local
Set
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEYto your Supabase project values. SetOPENAI_API_KEYto an API key from your OpenAI project; keep it server-only and do not use aNEXT_PUBLIC_prefix.OPENAI_MODELdefaults togpt-4.1-mini. AI review cannot run until a valid provider key with available API quota is configured.Keep secrets private. Do not commit
.env.local, expose an LLM secret through aNEXT_PUBLIC_variable, or send privileged credentials to the browser. -
Configure Supabase by running the latest
supabase-schema.sqlin the Supabase SQL Editor. This creates or updates the workspace tables, saved analysis data, row-level policies, AI request quota, and atomic project deletion function. The application cannot persist reviews until this schema has been applied. -
In Supabase Authentication > Sign In / Providers, keep Email enabled and turn on Confirm email. In Authentication > URL Configuration, set the Site URL to your app origin and add the exact callback URL to Redirect URLs (for local development,
http://localhost:3000/auth/callback; add your deployedhttps://URL as well). Email-confirmed signups use this callback to establish the session. -
For real customer email delivery, configure and verify a custom SMTP sender in Supabase Authentication > SMTP Settings. The built-in sender is rate-limited and intended for testing. Send a test signup and confirm the message arrives before launch; spam filtering and sender-domain verification are controlled by your email provider.
-
Start the development server:
npm run dev
-
Open http://localhost:3000.
Run the checks supported by the repository before submitting changes:
npm run lint
npm test
npm run buildIf a script is not defined in package.json, use the available project-specific equivalent.
- Deploy to Vercel or another compatible Node.js hosting provider.
- Configure required environment variables in the host's secret settings.
- Apply and verify the Supabase schema, storage access, and RLS policies.
- Confirm the application uses HTTPS and server-side secrets are not exposed to clients.
- Test authentication, file handling, and analysis flows in the deployed environment.
- Treat AI results as triage guidance, not a substitute for audits, static analysis, tests, or manual review.
- Do not upload confidential or third-party contract source unless you are authorized to share it with configured services.
- Keep API keys and service-role credentials on the server; never commit them to source control.
- Review Supabase RLS and storage policies before making the application available to users.
Contributions, bug reports, and feature requests are welcome. To contribute:
- Fork the repository and create a feature branch.
- Make your changes and run relevant checks.
- Commit and push your branch.
- Open a pull request describing the change and any testing performed.
This project is distributed under the MIT License. See LICENSE for details.