Zanzibar Digital Freezone
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-digital-freezone.git cd zanzibar-digital-freezone - 
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/viewsdirectory - Add a new handler method in the appropriate controller
 - Add a new route in the 
src/routes/mod.rsfile 
Adding a New Model
- Create a new model file in the 
src/modelsdirectory - Add the model to the 
src/models/mod.rsfile 
License
This project is licensed under the MIT License - see the LICENSE file for details.