OxidizedOasis-WebSands is a robust, high-performance web application built with Rust, focusing on efficient user management and authentication.
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.
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.
- 🔒 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
-
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:
-
Database:
- PostgreSQL - The World's Most Advanced Open Source Relational Database
-
Development & Deployment:
- Docker - For containerization and easy deployment
- GitHub Actions - For CI/CD pipelines
Before you begin, ensure you have the following installed:
- Rust (latest stable version)
- PostgreSQL (version 13 or later)
- Docker (optional, for containerized deployment)
- Trunk (
cargo install trunk
) - wasm32-unknown-unknown target (
rustup target add wasm32-unknown-unknown
)
-
Clone the repository:
git clone https://github.com/danbiocchi/oxidizedoasis-websands.git cd oxidizedoasis-websands
-
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.
-
Build the frontend:
cd frontend trunk build cd ..
-
Build the backend:
cargo build
-
Run the project:
cargo run
-
The application will automatically create the database if it doesn't exist, run all necessary migrations, and start the server.
-
Visit
http://localhost:8080
in your browser to access the application.
Refer to the Software Development Document for detailed configuration instructions and environment variable descriptions.
Refer to the User Guide for detailed information on how to use the application.
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.
Refer to the Software Development Document for detailed deployment instructions.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Please make sure to update tests as appropriate and adhere to the Rust Code of Conduct.
Daniel Biocchi
Project Link: https://github.com/danbiocchi/oxidizedoasis-websands
- Rust
- Actix-web
- Yew
- SQLx
- PostgreSQL
- JSON Web Tokens
- bcrypt
- Diablo 2
Made with ❤️ by the OxidizedOasis-WebSands Team