/rayspace.dev

🦀 My portfolio built with Rust and native web technologies.

Primary LanguageRustGNU Affero General Public License v3.0AGPL-3.0

rayspace.dev

🦀 My portfolio built with Rust and native web technologies.
Live Site: rayspace.dev

Overview

The design of this site is inspired by the work of Lee Robinson, but diverges in technical implementation.

This is a full stack application built with rust and core web technologies. It uses Actix Web for the backend and HTML/CSS/JavaScript for the frontend. The project also uses a PostgreSQL database for persistent storage, and utilizes SQLx as an async, pure Rust SQL crate.

For more information, check out the About This Site section on the live site.

This repository has been included in the Actix Examples repository, which features practical applications of Actix Web.

Technologies Used

Features

  • Single page application functionality with navigation handling and state persistence
  • Dynamic rendering of blog posts based on API response
  • Handling of guestbook comments with real-time updating
  • Management of blog post views
  • Syntax highlighting and clipboard functionality for code blocks
  • Input validation and sanitization
  • Dynamic meta tag updating
  • User authentication with GitHub OAuth
  • Secure user session management
  • Utilizing SQLx for secure database interactions

lighthouse

Running Locally

If you are familiar with Rust, you can build the app from source and run your own instance. To build and run the application locally, follow these steps:

  1. Ensure you have Rust installed. You can install Rust by following the official guide.

  2. Clone this repository.

git clone https://github.com/rx0a/rayspace.dev.git
cd rayspace.dev
  1. Setup PostgreSQL and create the tables.
CREATE TABLE comments (
    id SERIAL PRIMARY KEY,
    userid VARCHAR(255),
    name VARCHAR(255),
    comment TEXT,
    timestamp TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP);
CREATE TABLE posts (
    id SERIAL PRIMARY KEY,
    title TEXT NOT NULL,
    published_date DATE NOT NULL,
    views INTEGER NOT NULL);
  1. Set the required environment variables.
  • Create .env file at project root.
  • Required variables are within .env.example.
  1. Build and run the application.
cargo run
  1. The server will start, by default it runs on http://localhost:3000.

  2. (Optional) Create a systemd service to run your application persistently.

  3. (Optional) Install and configure a loadbalancer such as HAProxy for enabling features like HTTP/2 and rate limiting.

Contributing

Contributions to this project are welcome! Feel free to open issues or submit pull requests.