Skip to content

A high-performance web application using Actix-web in Rust

Notifications You must be signed in to change notification settings

danbiocchi/oxidizedoasis-websands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OxidizedOasis-WebSands

OxidizedOasis-WebSands is a robust, high-performance web application built with Rust, focusing on efficient user management and authentication.

Home Page Screenshot

Login Page Screenshot

Register Page Screenshot

Login Page Screenshot

Login Page Screenshot

🌟 About This Project

OxidizedOasis-WebSands is designed to provide a solid foundation for building scalable web applications with strong security features. Our goal is to showcase the capabilities of Rust in creating high-performance, secure web services while maintaining excellent developer ergonomics. This project demonstrates the power of Rust in full-stack web development, utilizing the Actix-web framework for the backend and Yew for a dynamic frontend.

📚 Documentation

Comprehensive documentation for OxidizedOasis-WebSands is available to help developers, administrators, and users understand and work with the system effectively:

  • Software Development Document: Detailed technical specifications, architecture overview, and development guidelines.
  • Security Audit Report: In-depth analysis of the project's security measures and recommendations for improvement.
  • Security Backlog: Ongoing security tasks and improvements planned for the project.
  • User Guide: Guide for end-users on how to use the application.
  • Project Structure: Overview of the project's directory structure and file organization.
  • Logging Plan: Detailed plan for implementing comprehensive logging in the project.
  • Testing Backlog: List of tests to be implemented as part of the test-driven development approach.

✨ Key Features

  • 🔒 Robust user authentication system with JWT (JSON Web Tokens)
  • ✉️ Secure user registration with email verification
  • 🔐 Password hashing using bcrypt for enhanced security
  • 🚀 High-performance database operations with SQLx and PostgreSQL
  • 🛡️ Cross-Site Scripting (XSS) protection with input sanitization
  • 🌐 Cross-Origin Resource Sharing (CORS) configuration for API security
  • 🔍 Comprehensive input validation and error handling
  • 📊 Efficient CRUD operations for user management
  • 🎨 Modern, responsive frontend with Yew framework
  • 📱 Mobile-friendly design for seamless user experience across devices
  • 🔧 Easily extensible architecture for adding new features
  • 🔄 Database migrations for easy schema management and updates
  • 🧪 Test-driven development approach for improved code quality and reliability

🛠️ Technology Stack

  • Backend:

    • Rust - A language empowering everyone to build reliable and efficient software
    • Actix-web - A powerful, pragmatic, and extremely fast web framework for Rust
    • SQLx - The Rust SQL Toolkit
    • jsonwebtoken - JWT implementation in Rust
    • bcrypt - Easily hash and verify passwords using bcrypt
  • Frontend:

    • Yew - A modern web framework for creating multi-threaded frontend apps with WebAssembly
    • Trunk - Build, bundle & ship your Rust WASM application to the web
  • Database:

    • PostgreSQL - The World's Most Advanced Open Source Relational Database
  • Development & Deployment:

🚀 Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/danbiocchi/oxidizedoasis-websands.git
    cd oxidizedoasis-websands
  2. Set up the environment variables: Create two files in the project root: .env for development and .env.test for testing.

    .env file content:

    # Environment Configuration
     ENVIRONMENT=development
     PRODUCTION_URL=https://yourdomain.com
     DEVELOPMENT_URL=http://localhost:8080
     RUN_MIGRATIONS=true
     
     # Application Information
     APP_NAME=OxidizedOasis
     APP_VERSION=0.1.0
     APP_DOMAIN=yourdomain.com
     
     # Server Configuration
     SERVER_HOST=127.0.0.1
     SERVER_PORT=8080
     
     # Database Configuration
     DB_NAME=oxidizedoasis_db
     DB_HOST=localhost
     DB_USER=your_db_user
     DB_PASSWORD=your_db_password
     DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}
     
     # Superuser Database Configuration
     SU_DB_USER=your_su_db_user
     SU_DB_PASSWORD=your_su_db_password
     SU_DATABASE_URL=postgres://${SU_DB_USER}:${SU_DB_PASSWORD}@${DB_HOST}/${DB_NAME}
     
     # JWT Configuration
     JWT_SECRET=your_jwt_secret_key
     
     # Email Configuration
     SMTP_USERNAME=your_smtp_username
     SMTP_PASSWORD=your_smtp_password
     SMTP_SERVER=your_smtp_server
     FROM_EMAIL=noreply@yourdomain.com
     SUPPORT_EMAIL=support@yourdomain.com
     EMAIL_FROM_NAME="${APP_NAME} Support"
     EMAIL_VERIFICATION_SUBJECT="Verify Your ${APP_NAME} Account"
     EMAIL_PASSWORD_RESET_SUBJECT="Reset Your ${APP_NAME} Password"
     
     # Logging Configuration
     RUST_LOG=debug
     
     # Additional configurations...
    

    .env.test file content:

     # Test Environment Configuration
     ENVIRONMENT=development
     PRODUCTION_URL=https://yourdomain.com
     DEVELOPMENT_URL=http://localhost:8080
     RUN_MIGRATIONS=true
     
     # Test Application Information
     TEST_APP_NAME=OxidizedOasis-Test
     TEST_APP_VERSION=0.1.0
     TEST_APP_DOMAIN=yourdomain.com
     
     # Test Server Configuration
     TEST_SERVER_HOST=127.0.0.1
     TEST_SERVER_PORT=8080
     
     # Test Database Configuration
     TEST_DB_NAME=test_oxidizedoasis_db
     TEST_DB_HOST=localhost
     TEST_DB_USER=your_test_db_user
     TEST_DB_PASSWORD=your_test_db_password
     TEST_DATABASE_URL=postgres://${TEST_DB_USER}:${TEST_DB_PASSWORD}@${TEST_DB_HOST}/${TEST_DB_NAME}
     
     # Test Superuser Database Configuration
     TEST_DB_SUPERUSER=your_test_su_db_user
     TEST_DB_SUPERUSER_PASSWORD=your_test_su_db_password
     TEST_SU_DATABASE_URL=postgres://${TEST_DB_SUPERUSER}:${TEST_DB_SUPERUSER_PASSWORD}@${TEST_DB_HOST}/${TEST_DB_NAME}
     
     # Test JWT Configuration
     TEST_JWT_SECRET=your_test_jwt_secret_key
     
     # Test Email Configuration
     TEST_SMTP_USERNAME=your_test_smtp_username
     TEST_SMTP_PASSWORD=your_test_smtp_password
     TEST_SMTP_SERVER=your_test_smtp_server
     TEST_FROM_EMAIL=test_noreply@yourdomain.com
     TEST_SUPPORT_EMAIL=test_support@yourdomain.com
     TEST_EMAIL_FROM_NAME="${TEST_APP_NAME} Support"
     TEST_EMAIL_VERIFICATION_SUBJECT="Verify Your ${TEST_APP_NAME} Account"
     TEST_EMAIL_PASSWORD_RESET_SUBJECT="Reset Your ${TEST_APP_NAME} Password"
     
     # Logging Configuration
     RUST_LOG=debug
     
     # Additional test configurations...
    

    Replace both files placeholders(.env and .env.test) with your actual database, SMTP, and other credentials.

  3. Build the frontend:

    cd frontend
    trunk build
    cd ..
  4. Build the backend:

    cargo build
  5. Run the project:

    cargo run
  6. The application will automatically create the database if it doesn't exist, run all necessary migrations, and start the server.

  7. Visit http://localhost:8080 in your browser to access the application.

🔧 Configuration

Refer to the Software Development Document for detailed configuration instructions and environment variable descriptions.

📚 Usage

Refer to the User Guide for detailed information on how to use the application.

🧪 Testing

We follow a test-driven development (TDD) approach. To run the tests:

cargo test

For more information on our testing strategy and backlog, refer to the Testing Backlog.

🚢 Deployment

Refer to the Software Development Document for detailed deployment instructions.

🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please make sure to update tests as appropriate and adhere to the Rust Code of Conduct.

📬 Contact

Daniel Biocchi

Project Link: https://github.com/danbiocchi/oxidizedoasis-websands

🙏 Acknowledgements


Made with ❤️ by the OxidizedOasis-WebSands Team

About

A high-performance web application using Actix-web in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published