Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video server #17

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

video server #17

wants to merge 28 commits into from

Conversation

aleeusgr
Copy link
Owner

@aleeusgr aleeusgr commented Dec 26, 2023

This version of the work is based on fission-codes template for axum web server.
A simple, high performance and secure live media server in Rust.

The default user test is at swagger-ui/, I added routes to /src/lib and /src/handlers.
Maybe it makes sense to have /src/lib/handlers? It depends.

aleeusgr

This comment was marked as outdated.

Copy link
Owner Author

@aleeusgr aleeusgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
defaultPackage = naersk-lib.buildPackage ./.;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is #19

flake.nix Show resolved Hide resolved
flake.nix Show resolved Hide resolved
src/router.rs Outdated Show resolved Hide resolved
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

axum settings.

deny.toml Outdated Show resolved Hide resolved
src/bin/openapi.rs Outdated Show resolved Hide resolved
@aleeusgr aleeusgr changed the title add fission-codes rust-template fix developer environment Dec 28, 2023
@aleeusgr aleeusgr marked this pull request as ready for review December 28, 2023 06:29
@aleeusgr aleeusgr changed the title fix developer environment add features from the tutorial Dec 28, 2023
@aleeusgr aleeusgr changed the title add features from the tutorial add features from the video Dec 28, 2023
@aleeusgr aleeusgr changed the title add features from the video add features from the videos Dec 28, 2023
@aleeusgr aleeusgr changed the title add features from the videos develop Dec 28, 2023
@aleeusgr
Copy link
Owner Author

aleeusgr commented Dec 31, 2023

total time ~15 hrs

Copy link
Owner Author

@aleeusgr aleeusgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Rust programming language, the keyword pub stands for "public." It is used in front of functions, structs, and modules to indicate that they are publicly accessible from outside their current scope. This means other parts of your code can call or use those public elements without needing an explicit reference or import statement. In contrast, private elements (denoted by 'pub(super)') are only visible within the local module and its children, while no keyword is needed for private elements in a single-module crate.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#35

src/bin/openapi.rs Outdated Show resolved Hide resolved
src/test_utils/rvg.rs Outdated Show resolved Hide resolved
src/test_utils/mod.rs Outdated Show resolved Hide resolved
src/settings.rs Outdated Show resolved Hide resolved
src/router.rs Outdated Show resolved Hide resolved
src/middleware/runtime.rs Outdated Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
src/headers/mod.rs Outdated Show resolved Hide resolved
@aleeusgr

This comment was marked as resolved.

@aleeusgr

This comment was marked as resolved.

@aleeusgr
Copy link
Owner Author

aleeusgr commented Jan 3, 2024

Seeking for the project to integrate into the application that I have.

The project must have functionality similar to the module I am replacing, ideally a video streaming service:
cargo run will produce an video or image in the browser at localhost:3000.

https://github.com/tokio-rs/axum/blob/main/ECOSYSTEM.md
axum-template: GraphQL and REST API, SurrealDb, JWT auth, direct error handling, request logs
axum-login: Session-based user authentication for axum.
ReductStore: A time series database for storing and managing large amounts of blob data
https://github.com/programatik29/axum-tutorial/blob/master/tutorial/02-layout.md

Copy link
Owner Author

@aleeusgr aleeusgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ building a web server, a database,
https://rust-lang.github.io/async-book/

src/main.rs Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
@aleeusgr aleeusgr changed the title develop efected Jan 8, 2024
@aleeusgr aleeusgr changed the title efected xiu Jan 8, 2024
@aleeusgr aleeusgr changed the title xiu xiu and rhea Jan 8, 2024
@aleeusgr

This comment was marked as resolved.

@aleeusgr aleeusgr added this to the 3. Project Execution milestone Jan 8, 2024
@aleeusgr

This comment was marked as resolved.

@aleeusgr aleeusgr changed the title xiu and rhea rhea Jan 8, 2024
@aleeusgr aleeusgr changed the title rhea video server Jan 9, 2024
@aleeusgr aleeusgr mentioned this pull request Jan 9, 2024
@aleeusgr

This comment was marked as outdated.

@aleeusgr

This comment was marked as resolved.

@aleeusgr
Copy link
Owner Author

aleeusgr commented Jan 9, 2024

  • add system test #22
    To implement the video streaming server using Rust and Axum, you would follow these general steps:
  • Create a new Rust project using Cargo (the Rust package manager).
  • Add dependencies for Axum and any other required libraries such as tokio (for async I/O) or tower-http (for middleware support).
  • Set up the main function, which initializes the server and starts listening on a specified port.
  • Define routes for your video streaming service using Axum's routing functions. These may include endpoints for listing available videos, playing specific videos, or managing user accounts (if authentication is required).
    let app = Router::new()
        .nest_service("/assets/", static_file_router())
        .route("/favicon.ico", get(favicon))
        .route("/video/:video_id", get(video_handler))
        .route("/", get(index))
        .route("/reload", post(reload))
        .route("/healthcheck", get(health_check))
        .layer(TraceLayer::new_for_http())
        .with_state(state);
  • Implement handlers for each route that perform the necessary operations to serve the requested content. For example, a handler might read video data from a file system or database and stream it directly to the client using Axum's built-in support for streaming responses.
  • Add any desired middleware components (such as authentication, rate limiting, or logging) to enhance your server's functionality and security.
  • Test and optimize your video streaming server by running it locally and checking its performance under various load conditions using tools like wrk or Siege. Make necessary adjustments based on the results to ensure optimal throughput and low latency for all users.
  • Deploy your Rust-Axum video streaming server to a production environment, such as AWS or Google Cloud Platform, by following best practices for containerization (e.g., Docker) and configuration management tools like Ansible or Terraform.

https://swagger.io/tools/swagger-ui/

https://github.com/aalekhpatel07/static-video-server/blob/master/src/main.rs#L135-L143

@srgoogle23
Copy link

Subject: Your Dream Job Awaits: Apply Now to Join GitHub as a Developer!

Hey there,

We've got some thrilling news for you! GitHub is currently looking for skilled Developers to join our team. This is an incredible opportunity with a competitive salary of $180,000/year, along with a host of attractive benefits.

Interested in taking your career to the next level? Don't miss out! Click here to apply and secure your spot.

Looking forward to potentially welcoming you aboard!

Best regards,
GitHub Recruitment Team
priyakumari02, @Parsaloi, @denis256, @IliasKar, @erichocean, @NAMUORI00, @Abdulbois, @chenpeigen1, @Silassentinel, @manolaz, @pradeepranasinghe, @kapendat, @dhiran-gen, @kengeo, @tarunjainsagar, @AnishDabhane, @cmjagtap, @vin6158, @clkz, @LyMarita

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants