WStack3
DeFi app with PHP, JS, Web3, 1inch, Server-Side API Proxy Architecture, and API calls aggregator.
Problem Statement
Secure Server-Optimized DeFi Web Application This project is a secure, performance-optimized DeFi web application built with Laravel (PHP), JavaScript, Web3, and the 1inch API. It combines the decentralization of blockchain-based authentication with the security and scalability of a server-driven architecture.🚀 Key FeaturesWallet-Based Authentication (No Passwords):Users authenticate by signing a message with their crypto wallet (e.g., MetaMask), enabling frictionless login/registration without traditional credentials.Eliminates the need for password storage and enhances security through decentralized identity verification.Real-Time DeFi Data & Interactions:Display of live wallet balances and gas fees across supported blockchain networks.Integration with the 1inch DEX API enables token lookup and swap execution directly from the app.Server-Side API Proxy Architecture:All interactions with third-party APIs (e.g., 1inch) are routed through a Laravel backend, protecting API keys and enforcing:CSRF protectionCORS policiesRate limiting and request validation⚙️ Backend Optimizations Efficient API Request Handling:Backend acts as a proxy and cache layer, aggregating and caching:Token lists (cached for 20 hours)Token prices (cached for 30 seconds)Benefits:Reduces redundant client-side API callsMinimizes load on 1inch and other servicesImproves performance and scalabilityEnables centralized control over data consistency and update intervals🛡️ Security & Scalability Backend-managed API access ensures that sensitive keys are never exposed to the frontend.Selective caching and validation of data improves speed while maintaining trustworthiness.Session-less authentication via wallet signature reduces attack surface compared to traditional login methods.
Solution
This project is built as a full-stack decentralized finance (DeFi) web application using a combination of modern web and blockchain technologies. Here’s a breakdown of the architecture and how all the pieces fit together:🧩 Technologies Used Laravel (PHP): Laravel powers the backend API layer. It handles routing, request validation, security enforcement (CSRF, CORS), and acts as a secure proxy for third-party API calls like 1inch. Laravel also serves as the caching layer for token prices and token lists, dramatically improving performance and reducing unnecessary API hits.PHP & MySQL: PHP (via Laravel) drives the backend logic. MySQL is optionally used for storing logs, application settings, or non-sensitive user data (like app preferences or session metadata, not wallet secrets).JavaScript + Web3.js: The frontend is written in pure JavaScript and leverages Web3.js for wallet interaction. Wallet-based login is handled through message signing (e.g., MetaMask), removing the need for traditional username/password systems and enabling a more secure, decentralized authentication method.
Hackathon
ETHGlobal Prague
2025
Contributors
- amakarem
177 contributions