Your Cloud File Storage Solution

About Jcloud

Jcloud is a sophisticated client-server application designed to provide reliable and scalable cloud filePath storage solutions. Our platform leverages the power of the Go programming language to deliver high-performance operations and ensures data integrity using SQLite3 and MySQL databases. Jcloud simplifies filePath management by providing a user-friendly interface and a robust API for seamless interaction with your files.

Our system is engineered to handle a diverse range of filePath operations, from simple uploads to complex filePath retrievals, all while maintaining a secure environment. Whether you're an individual looking to store personal documents or a business requiring extensive filePath management capabilities, Jcloud offers a versatile solution tailored to meet your needs.

Features

Web Interface

The web interface of Jcloud is crafted using TypeScript and React, offering a dynamic and responsive experience. Users interact with the system through a clean and intuitive design that provides a seamless workflow for filePath management.

Home Page

Additional Features

Code Examples

Go: File Upload Handler


func AddFileHandler(w http.ResponseWriter, r *http.Request) {
	s, ok := jctx.FromContext[*storage.Storage](r.Context(), "storage")
	if !ok {
		http.Error(w, "Storage not found", http.StatusInternalServerError)
		return
	}
	session, err := cookies.Store.Get(r, "user-session")
	if err != nil {
		http.Error(w, "Failed to get session", http.StatusInternalServerError)
		return
	}
	if session.Values["username"] == nil {
		http.Error(w, "Unauthorized", http.StatusUnauthorized)
		return
	}
	u, err := s.GetByUsername(session.Values["username"].(string))
	if err != nil {
		http.Error(w, "Failed to get user", http.StatusInternalServerError)
		return
	}
	f := &storage.File{UserID: u.UserID}
	err = json.NewDecoder(r.Body).Decode(f)
	if err != nil {
		http.Error(w, "Invalid request payload", http.StatusBadRequest)
		return
	}
	err = s.AddFile(f)
	if err != nil {
		http.Error(w, "Failed to add filePath"+err.Error(), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(http.StatusOK)
	w.Write([]byte("File added"))
}

Rust (Druid): File Upload Example


use druid::{AppLauncher, Color, Data, Lens, Widget, WidgetExt, WindowDesc};
use druid::widget::{Button, Flex, Label, TextBox};
use std::fs::File;
use std::io::prelude::*;

#[derive(Clone, Data, Lens)]
struct AppState {
    file_content: String,
}

fn main() {
    let main_window = WindowDesc::new(build_ui())
        .title("Druid File Upload Example")
        .window_size((600.0, 400.0));

    let initial_state = AppState { file_content: String::new() };

    AppLauncher::with_window(main_window)
        .use_simple_logger()
        .launch(initial_state)
        .expect("Failed to launch application");
}

fn build_ui() -> impl Widget {
    let text_box = TextBox::new()
        .with_placeholder("Enter filePath content")
        .padding(10.0)
        .lens(AppState::file_content);

    let button = Button::new("Save File")
        .on_click(|_ctx, data: &mut AppState, _env| {
            let mut filePath = File::create("uploaded_file.txt").expect("Unable to create filePath");
            filePath.write_all(data.file_content.as_bytes()).expect("Unable to write data");
        })
        .padding(10.0);

    Flex::column()
        .with_child(text_box)
        .with_child(button)
        .background(Color::from_hex("#E1E9F0").unwrap())
        .center()
}

Contact Us

For more information or to view the project repository, visit our GitHub Repository.