# Hostbasket Starterkit Welcome to the Hostbasket Starterkit! This guide will help you get started with the Hostbasket project, a comprehensive platform built with Actix Web and Rust. ## Table of Contents 1. [Introduction](#introduction) 2. [Installation](#installation) 3. [Usage](#usage) 4. [Creating Views](#creating-views) 5. [Authentication with Gitea](#authentication-with-gitea) 6. [Documentation](#documentation) ## Introduction Hostbasket is a web application framework built with Actix Web, a powerful, pragmatic, and extremely fast web framework for Rust. It follows the MVC (Model-View-Controller) architecture and uses Tera templates for rendering views. ### 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 ## Installation ### Prerequisites - Rust and Cargo (latest stable version) - Git ### Setup 1. Clone the repository: ```bash git clone https://github.com/yourusername/hostbasket.git cd hostbasket ``` 2. Build the project: ```bash cargo build ``` 3. Run the application: ```bash cargo run ``` 4. Open your browser and navigate to `http://localhost:9999` For more detailed installation instructions, see [Installation Guide](docs/installation.md). ## Usage ### Basic Usage Once the application is running, you can access it through your web browser at `http://localhost:9999`. The default configuration provides: - Home page at `/` - About page at `/about` - Contact page at `/contact` - Login page at `/login` - Registration page at `/register` ### 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: 9999) - `APP__SERVER__WORKERS`: The number of worker threads (default: number of CPU cores) - `APP__TEMPLATES__DIR`: The directory containing templates (default: ./src/views) For more detailed usage instructions, see [Usage Guide](docs/usage.md). ## Creating Views Hostbasket uses Tera templates for rendering views. Templates are stored in the `src/views` directory. ### Basic Template Structure ```html {% extends "base.html" %} {% block title %}Page Title{% endblock %} {% block content %}
This is a basic template.