Skip to content

donedgardo/moon_phase

Repository files navigation

Moon Phase 🌕🌖🌗🌘🌑

Continuous Deployment

Overview

The Moon Phase Demo is a web development project designed to showcase the power of modern web technologies like HTMX and Rust. This project serves as a playground for sharpening skills with these new tools, offering a practical example of how they can be used in tandem to create a dynamic and efficient web application.

🔗 Live Demo: https://moon.edgardocarreras.com/

Table of Contents

Technologies

Rust 🦀

  • File: Cargo.toml, src/lib.rs, src/main.rs
  • Purpose: Rust is used for the backend logic, offering memory safety and blazing speed. The project uses Rust's package manager, Cargo, to manage dependencies and build the project.

HTMX 🌐

  • File: src/main.rs, src/router/mod.rs
  • Purpose: HTMX allows you to access AJAX, CSS Transitions, WebSockets, and Server Sent Events directly in HTML, without requiring any JavaScript. It's used here to create a dynamic and interactive frontend.

Tailwind CSS 💨

  • File: tailwind.config.js, package.json
  • Purpose: Tailwind CSS is a utility-first CSS framework for rapidly building custom user interfaces. It's configured via tailwind.config.js and managed through npm as seen in package.json.

CSS Builder 🎨

  • File: src/bin/build-css.rs
  • Purpose: A custom Rust script to build and optimize the CSS for the project.

Getting Started

  1. Clone the Repository

    git clone https://github.com/donedgardo/moon_phase_demo.git
  2. Install Rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  3. Install Node.js and npm

    # Using nvm
    nvm install node
  4. Run the Project

    cargo run 

Development Tools

For automatic css build, formatting on change of files install cargo-watch, leptosfmt and cargo-make and use this command. It will build css and re-compile

cargo watch -x 'make dev' -i static/**

For automatic testing I like to run them on a separate terminal

cargo watch -x 'test --bins -lib'

Usage

To view the moon phases, simply navigate to http://localhost:8000/.

Contributing

Feel free to contribute to this project. Fork it, create a new branch, commit your changes, and create a pull request.

License

This project is licensed under the MIT License.


Created by Edgardo Carreras to explore and demonstrate the capabilities of HTMX and Rust in modern web development.

About

A Rust and HTMX-powered web application that dynamically displays moon phases. Designed as a playground for exploring modern web technologies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published