Skip to content
/ AstroX Public template

Astro.build + Actix combo + Tools: A πŸ¦€ Rust orientated monolithic template for building modern web applications.

Notifications You must be signed in to change notification settings

MassivDash/AstroX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AstroX (Actix + Astro.build)

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ

+

πŸ¦€ Rust orientated monolithic template for building modern web applications.

Version Documentation License: MIT Twitter: SpaceoutPl

CodeQLCICompliation!

Platforms

windows linux macOs

Monolithic repo for developing full stack application, using rust and cargo tools as primary development environment.

Frontend is a standalone astro.build application that will create the frontend bundle served by rust actix server.

Rust + Astro web development boilerplate.

To start developing with AstroX you will need rustc > 1.74 and node > 18.14. Clone the project and execute;

cargo run

That's all you need to get started, the interactive cli will guide you through installation process.

Features

CLI

Rust written command line interface starts, serves and tests the astro x project. Fast and efficient with only few dependencies will create a professional development environment for rust opinionated project.

Cli Project Runner

Handles installation and system checks, it will check the astroX system prerequisites and either help you install or provide you with necessary information to start the project.

  • automatic development port rotation for frontend and backend
  • interactive mode, execute actions through cli gui
  • git hooks integration
  • build the packages
  • serve the bundle (with auto restart)
  • test the project
  • execute the project with cmd line arguments

Git hooks

Pre defined git hooks for quality code writing

  • commit msg via commitlint-rs
  • pre-commit (test and lint staged files)
  • pre-push (test all)

CLI arguments

Command list:
--help [print this help ]
--sync-git-hooks [copy git_hooks folder contents to .git/hooks]
--remove-git-hooks [remove hooks from .git/hooks folder]
--build [build production bundle for frontend and backend]
--serve [start the production server with the frontend build]
--test [run the tests]
--create-toml [create a new Astrox.toml file]
--interactive [start the interactive mode]
--system-checks [run the system checks]
--coverage [run cli and backend coverage]


Cli arguments:
--host="127.0.0.1" [ip address]
--port=8080 [actix port number]
--env=prod / dev [environment]
--astro-port=4321 [astro development port number]
--prod-astro-build=true / false [Build astro during cli prod start]
--set-public-api=https://custom.api/api [cli to astro env creation, used for static server url call building]

Actix backend

https://actix.rs/docs/getting-started/

Rust based server from Actix framework.

  • serve static astro x files
  • 3rd api call example
  • logging
  • graphql [coming soon]
  • ssr [coming soon]

Astro

https://astro.build/

Astro is a frontend framework that focuses on mainly on delivering html first, the fastest and most versatile of the frameworks allows to incorporate any of the major UI frameworks such as React, Svelte, Vue, Solid.js and others ...

The boilerplate provides and example of the Astro 4.0 transition capabilities.

Project Structure

AstroX
β”œβ”€ .github //workflows and ci/cd checks
β”œβ”€ └─ workflows
β”œβ”€ └─ β”œβ”€ codeql-analysis.yml
β”œβ”€ └─ β”œβ”€ pr.yml
β”œβ”€ └─ └─ relase.yml
β”œβ”€ git_hooks // set up git hooks for development
β”œβ”€ β”œβ”€ commit-msg
β”œβ”€ β”œβ”€ commit-msg-windows-example
β”œβ”€ β”œβ”€ pre-commit
β”œβ”€ └─ pre-push
β”œβ”€ src
β”œβ”€ β”œβ”€ backend //Actix backend, own rust project
β”œβ”€ β”œβ”€ β”œβ”€ src
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ api //Api routes examples
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ hello
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ get.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ post.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ space_x // server to server call
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ get.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ args
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ collect_args.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ auth // Simple auth route middleware
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ auth_middleware.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ login.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ cors
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ get_cors_options.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ session // Session middleware examples
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ flash_messages.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ session_middleware.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ validate_session.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ main.rs
β”œβ”€ β”œβ”€ └─ Cargo.toml
β”œβ”€ β”œβ”€ cli // AstroX project runner
β”œβ”€ β”œβ”€ β”œβ”€ cmds
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ tests
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ cmd_list_test.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ interactive_test.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ cmd_list.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ execute_cmd.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ interactive.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ config
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ tests
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ get_config_test.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ collect_args.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ create_dotenv.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ get_config.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ toml.rs
β”œβ”€ β”œβ”€ β”œβ”€ development
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ start_development.rs
β”œβ”€ β”œβ”€ β”œβ”€ pre_run
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ cargo
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ checks.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ validate.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ npm
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ checks.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ validate.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ utils
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ check_semver.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ git_hooks.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ execute.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ system_checks.rs
β”œβ”€ β”œβ”€ β”œβ”€ production
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ build_production.rs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ start_production.rs
β”œβ”€ β”œβ”€ β”œβ”€ tests
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ execute.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ utils
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ mod.rs
β”œβ”€ β”œβ”€ β”œβ”€ └─ terminal.rs
β”œβ”€ β”œβ”€ └─ mod.rs
β”œβ”€ β”œβ”€ frontend // Astro.Build project
β”œβ”€ β”œβ”€ β”œβ”€ .astro
β”œβ”€ β”œβ”€ β”œβ”€ └─ settings.json
β”œβ”€ β”œβ”€ β”œβ”€ public
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ astroStation.jpeg
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ bgAstro.png
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ bgPattern.png
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ favicon.svg
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ hero.jpeg
β”œβ”€ β”œβ”€ β”œβ”€ └─ herobc.jpeg
β”œβ”€ β”œβ”€ β”œβ”€ src
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ axiosInstance
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ axiosBackendInstance.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ axiosBackendInstance.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ components
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ navbar
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Navbar.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Navbar.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ NavbarItem.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ NavbarItem.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ spaceX
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ spacex.svelte
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ spacex.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ zoomImage
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ zoomImage.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ zoomImage.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Card.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Footer.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Hero.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ Section.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ layouts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Layout.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ Layout.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ pages
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ auth
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ protected.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ 404.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ actix.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ astro.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ cli.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ index.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ sections
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Home
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ HomeClone.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ HomeMiddleLinks.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ HomeSecondary.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ imgs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ β”œβ”€ actix.png
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ β”œβ”€ astro.jpeg
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ β”œβ”€ astro.png
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ β”œβ”€ astro2.jpeg
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ β”œβ”€ cli.png
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ └─ contact.jpeg
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ svgs
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Actix.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ AstroIcon.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ Github.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ RustIcon.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ Spaceout.astro
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ tests
β”œβ”€ β”œβ”€ β”œβ”€ β”œβ”€ └─ pages.test.ts
β”œβ”€ β”œβ”€ β”œβ”€ └─ env.d.ts
β”œβ”€ β”œβ”€ β”œβ”€ .eslintignore
β”œβ”€ β”œβ”€ β”œβ”€ .eslintrc.cjs
β”œβ”€ β”œβ”€ β”œβ”€ .gitignore
β”œβ”€ β”œβ”€ β”œβ”€ .nvmrc
β”œβ”€ β”œβ”€ β”œβ”€ astro.config.mjs
β”œβ”€ β”œβ”€ β”œβ”€ package.json
β”œβ”€ β”œβ”€ β”œβ”€ prettier.config.cjs
β”œβ”€ β”œβ”€ β”œβ”€ README.md
β”œβ”€ β”œβ”€ β”œβ”€ svelte.config.js
β”œβ”€ β”œβ”€ β”œβ”€ tsconfig.json
β”œβ”€ β”œβ”€ └─ vitest.config.ts
β”œβ”€ └─ main.rs
β”œβ”€ .gitignore
β”œβ”€ .nvmrc
β”œβ”€ Astrox.toml
β”œβ”€ Cargo.toml
└─ readme.md

Demo

https://astrox.spaceout.pl