Add a complete DeFi platform with the following features: - Tabbed interface for different DeFi functionalities - Lending & Borrowing system with APY calculations - Liquidity Pools with LP token rewards - Staking options for tokens and digital assets - Token Swap interface with real-time exchange rates - Collateralization system for loans and synthetic assets - Interactive JavaScript functionality for real-time calculations This enhancement provides users with a complete suite of DeFi tools directly integrated into the Digital Assets dashboard. |
||
---|---|---|
.. | ||
src | ||
static/js | ||
Cargo.lock | ||
Cargo.toml | ||
README.md |
Zanzibar Autonomous Zone
Convenience, Safety and Privacy
Features
- Actix Web: A powerful, pragmatic, and extremely fast web framework for Rust
- Tera Templates: A template engine inspired by Jinja2 and Django templates
- Bootstrap 5.3.5: A popular CSS framework for responsive web design
- MVC Architecture: Clean separation of concerns with Models, Views, and Controllers
- Middleware Support: Custom middleware for request timing and security headers
- Configuration Management: Flexible configuration system with environment variable support
- Static File Serving: Serve CSS, JavaScript, and other static assets
Project Structure
actix_mvc_app/
├── Cargo.toml # Project dependencies
├── src/
│ ├── config/ # Configuration management
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Custom middleware components
│ ├── models/ # Data models and business logic
│ ├── routes/ # Route definitions
│ ├── static/ # Static assets (CSS, JS, images)
│ │ ├── css/ # CSS files including Bootstrap
│ │ ├── js/ # JavaScript files
│ │ └── images/ # Image files
│ ├── utils/ # Utility functions
│ ├── views/ # Tera templates
│ └── main.rs # Application entry point
Getting Started
Prerequisites
- Rust and Cargo (latest stable version)
Installation
-
Clone the repository:
git clone https://github.com/yourusername/zanzibar-autonomous-zone.git cd zanzibar-autonomous-zone
-
Build the project:
cargo build
-
Run the application:
cargo run
-
Open your browser and navigate to
http://localhost:8080
Configuration
The application can be configured using environment variables or configuration files. The following environment variables are supported:
APP__SERVER__HOST
: The host address to bind to (default: 127.0.0.1)APP__SERVER__PORT
: The port to listen on (default: 8080)APP__SERVER__WORKERS
: The number of worker threads (default: number of CPU cores)APP__TEMPLATES__DIR
: The directory containing templates (default: ./src/views)
Development
Adding a New Page
- Create a new template in the
src/views
directory - Add a new handler method in the appropriate controller
- Add a new route in the
src/routes/mod.rs
file
Adding a New Model
- Create a new model file in the
src/models
directory - Add the model to the
src/models/mod.rs
file
License
This project is licensed under the MIT License - see the LICENSE file for details.