Compare commits
2 Commits
58e8faa11c
...
4137ded856
Author | SHA1 | Date |
---|---|---|
Ryan Mwangi | 4137ded856 | |
Ryan Mwangi | ba95f7b914 |
|
@ -23,31 +23,31 @@
|
||||||
<component name="ProblemsViewState">
|
<component name="ProblemsViewState">
|
||||||
<option name="showPreview" value="true" />
|
<option name="showPreview" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectColorInfo"><![CDATA[{
|
<component name="ProjectColorInfo">{
|
||||||
"associatedIndex": 8
|
"associatedIndex": 8
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="ProjectId" id="2pngw94pMiCvlaySWR2RUofHfwc" />
|
<component name="ProjectId" id="2pngw94pMiCvlaySWR2RUofHfwc" />
|
||||||
<component name="ProjectViewState">
|
<component name="ProjectViewState">
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"RunOnceActivity.rust.reset.selective.auto.import": "true",
|
"RunOnceActivity.rust.reset.selective.auto.import": "true",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "main",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",
|
"org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",
|
||||||
"org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",
|
"org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",
|
||||||
"org.rust.first.attach.projects": "true",
|
"org.rust.first.attach.projects": "true",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RunManager" selected="Cargo.Run compareware">
|
<component name="RunManager" selected="Cargo.Run compareware">
|
||||||
<configuration name="Run compareware" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
<configuration name="Run compareware" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||||
<option name="buildProfileId" value="dev" />
|
<option name="buildProfileId" value="dev" />
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
<option name="number" value="Default" />
|
<option name="number" value="Default" />
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1733407491778</updated>
|
<updated>1733407491778</updated>
|
||||||
<workItem from="1733407498746" duration="4156000" />
|
<workItem from="1733407498746" duration="5306000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -504,8 +504,9 @@ dependencies = [
|
||||||
"leptos_meta",
|
"leptos_meta",
|
||||||
"leptos_router",
|
"leptos_router",
|
||||||
"serde",
|
"serde",
|
||||||
"uuid 0.8.2",
|
"uuid",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1381,7 +1382,7 @@ dependencies = [
|
||||||
"server_fn_macro",
|
"server_fn_macro",
|
||||||
"syn 2.0.90",
|
"syn 2.0.90",
|
||||||
"tracing",
|
"tracing",
|
||||||
"uuid 1.11.0",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2535,12 +2536,6 @@ version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
|
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "uuid"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.11.0"
|
version = "1.11.0"
|
||||||
|
@ -2580,9 +2575,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.95"
|
version = "0.2.96"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e"
|
checksum = "21d3b25c3ea1126a2ad5f4f9068483c2af1e64168f847abe863a526b8dbfe00b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
@ -2591,9 +2586,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-backend"
|
name = "wasm-bindgen-backend"
|
||||||
version = "0.2.95"
|
version = "0.2.96"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358"
|
checksum = "52857d4c32e496dc6537646b5b117081e71fd2ff06de792e3577a150627db283"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"log",
|
"log",
|
||||||
|
@ -2618,9 +2613,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.95"
|
version = "0.2.96"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56"
|
checksum = "920b0ffe069571ebbfc9ddc0b36ba305ef65577c94b06262ed793716a1afd981"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
|
@ -2628,9 +2623,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.95"
|
version = "0.2.96"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
|
checksum = "bf59002391099644be3524e23b781fa43d2be0c5aa0719a18c0731b9d195cab6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -2641,9 +2636,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.95"
|
version = "0.2.96"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d"
|
checksum = "e5047c5392700766601942795a436d7d2599af60dcc3cc1248c9120bfb0827b0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-streams"
|
name = "wasm-streams"
|
||||||
|
|
|
@ -15,9 +15,10 @@ leptos = { version = "0.6" }
|
||||||
leptos_meta = { version = "0.6" }
|
leptos_meta = { version = "0.6" }
|
||||||
leptos_actix = { version = "0.6", optional = true }
|
leptos_actix = { version = "0.6", optional = true }
|
||||||
leptos_router = { version = "0.6" }
|
leptos_router = { version = "0.6" }
|
||||||
wasm-bindgen = "=0.2.95"
|
wasm-bindgen = "=0.2.96"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
uuid = "0.8"
|
uuid = { version = "1.0", features = ["v4"] }
|
||||||
|
web-sys = { version = "0.3", features = ["Event"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"]
|
csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"]
|
||||||
|
|
98
README.md
98
README.md
|
@ -1,72 +1,46 @@
|
||||||
<picture>
|
# CompareWare
|
||||||
<source srcset="https://raw.githubusercontent.com/leptos-rs/leptos/main/docs/logos/Leptos_logo_Solid_White.svg" media="(prefers-color-scheme: dark)">
|
|
||||||
<img src="https://raw.githubusercontent.com/leptos-rs/leptos/main/docs/logos/Leptos_logo_RGB.svg" alt="Leptos Logo">
|
|
||||||
</picture>
|
|
||||||
|
|
||||||
# Leptos Starter Template
|
CompareWare is an open-source platform for comparing tools (software, hardware, etc.) with structured, crowdsourced data. It combines **Leptos** for a modern, reactive frontend and **Nostr** for decentralized data storage.
|
||||||
|
|
||||||
This is a template for use with the [Leptos](https://github.com/leptos-rs/leptos) web framework and the [cargo-leptos](https://github.com/akesson/cargo-leptos) tool.
|
## **Features**
|
||||||
|
- **Item Management**: Add, view, and manage items with metadata and key-value tags.
|
||||||
|
- **Nostr Integration**:
|
||||||
|
- Store and share data as Nostr events.
|
||||||
|
- Authenticate users with Nostr keys.
|
||||||
|
- **Future Features**: Reviews and a Web of Trust for collaborative insights.
|
||||||
|
|
||||||
## Creating your template repo
|
|
||||||
|
|
||||||
If you don't have `cargo-leptos` installed you can install it with
|
## **Getting Started**
|
||||||
|
|
||||||
`cargo install cargo-leptos --locked`
|
### Prerequisites
|
||||||
|
- Rust (latest stable version)
|
||||||
|
- Leptos framework
|
||||||
|
|
||||||
Then run
|
### Installation
|
||||||
|
1. Clone the repository:
|
||||||
|
```bash
|
||||||
|
git clone https://forge.ftt.gmbh/ryanmwangi/Compware.git
|
||||||
|
cd compareware
|
||||||
|
```
|
||||||
|
2. Run the development server:
|
||||||
|
```bash
|
||||||
|
cargo leptos serve
|
||||||
|
```
|
||||||
|
3. Open your browser at [http://localhost:3000](http://localhost:3000)
|
||||||
|
|
||||||
`cargo leptos new --git leptos-rs/start`
|
## **Roadmap**
|
||||||
|
|
||||||
to generate a new project template (you will be prompted to enter a project name).
|
1. **Item Management** (In progress)
|
||||||
|
- Implement a form (`item_form.rs`) to allow users to add new items with metadata and key-value tags.
|
||||||
|
- Create a listing component (`items_list.rs`) to display and manage added items.
|
||||||
|
- Add backend functionality to validate and persist items using the Leptos framework.
|
||||||
|
|
||||||
`cd {projectname}`
|
2. **Review System** (To be implemented)
|
||||||
|
- Design a data model to handle reviews, including ratings, comments, and reviewer metadata.
|
||||||
|
- Build a user interface for submitting and viewing reviews linked to specific items.
|
||||||
|
- Integrate filters and sorting to display reviews based on relevance and ratings.
|
||||||
|
|
||||||
to go to your newly created project.
|
3. **Nostr Integration** (To be integrated)
|
||||||
|
- Use Nostr events for decentralized data storage, mapping item data to specific Nostr event types.
|
||||||
Of course, you should explore around the project structure, but the best place to start with your application code is in `src/app.rs`.
|
- Authenticate users through their Nostr keys for secure and decentralized access.
|
||||||
|
- Enable data sharing and synchronization with Nostr-compatible clients.
|
||||||
## Running your project
|
|
||||||
|
|
||||||
`cargo leptos watch`
|
|
||||||
By default, you can access your local project at `http://localhost:3000`
|
|
||||||
|
|
||||||
## Installing Additional Tools
|
|
||||||
|
|
||||||
By default, `cargo-leptos` uses `nightly` Rust, `cargo-generate`, and `sass`. If you run into any trouble, you may need to install one or more of these tools.
|
|
||||||
|
|
||||||
1. `rustup toolchain install nightly --allow-downgrade` - make sure you have Rust nightly
|
|
||||||
2. `rustup target add wasm32-unknown-unknown` - add the ability to compile Rust to WebAssembly
|
|
||||||
3. `cargo install cargo-generate` - install `cargo-generate` binary (should be installed automatically in future)
|
|
||||||
4. `npm install -g sass` - install `dart-sass` (should be optional in future)
|
|
||||||
|
|
||||||
## Executing a Server on a Remote Machine Without the Toolchain
|
|
||||||
After running a `cargo leptos build --release` the minimum files needed are:
|
|
||||||
|
|
||||||
1. The server binary located in `target/server/release`
|
|
||||||
2. The `site` directory and all files within located in `target/site`
|
|
||||||
|
|
||||||
Copy these files to your remote server. The directory structure should be:
|
|
||||||
```text
|
|
||||||
leptos_start
|
|
||||||
site/
|
|
||||||
```
|
|
||||||
Set the following environment variables (updating for your project as needed):
|
|
||||||
```sh
|
|
||||||
export LEPTOS_OUTPUT_NAME="leptos_start"
|
|
||||||
export LEPTOS_SITE_ROOT="site"
|
|
||||||
export LEPTOS_SITE_PKG_DIR="pkg"
|
|
||||||
export LEPTOS_SITE_ADDR="127.0.0.1:3000"
|
|
||||||
export LEPTOS_RELOAD_PORT="3001"
|
|
||||||
```
|
|
||||||
Finally, run the server binary.
|
|
||||||
|
|
||||||
## Notes about CSR and Trunk:
|
|
||||||
Although it is not recommended, you can also run your project without server integration using the feature `csr` and `trunk serve`:
|
|
||||||
|
|
||||||
`trunk serve --open --features csr`
|
|
||||||
|
|
||||||
This may be useful for integrating external tools which require a static site, e.g. `tauri`.
|
|
||||||
|
|
||||||
## Licensing
|
|
||||||
|
|
||||||
This template itself is released under the Unlicense. You should replace the LICENSE for your own application with an appropriate license if you plan to release it publicly.
|
|
Loading…
Reference in New Issue