├── src
├── ui.rs
├── ui
│ ├── components
│ │ ├── home.rs
│ │ ├── layouts.rs
│ │ ├── login.rs
│ │ ├── comment.rs
│ │ ├── modals.rs
│ │ ├── post.rs
│ │ ├── communities.rs
│ │ ├── common.rs
│ │ ├── communities
│ │ │ ├── communities_page.rs
│ │ │ ├── create_community_page.rs
│ │ │ └── community_form.rs
│ │ ├── common
│ │ │ ├── markdown_content.rs
│ │ │ ├── sidebar
│ │ │ │ ├── user_stat_row.rs
│ │ │ │ ├── sidebar_data.rs
│ │ │ │ └── team_member_card.rs
│ │ │ ├── fedilink.rs
│ │ │ ├── filter_bar
│ │ │ │ ├── sort_type_link.rs
│ │ │ │ └── listing_type_link.rs
│ │ │ ├── creator_listing.rs
│ │ │ ├── community_listing.rs
│ │ │ ├── content_actions
│ │ │ │ ├── hide_post_button.rs
│ │ │ │ └── report_button.rs
│ │ │ ├── vote_buttons
│ │ │ │ └── vote_button.rs
│ │ │ ├── icon.rs
│ │ │ ├── filter_bar.rs
│ │ │ ├── vote_buttons.rs
│ │ │ ├── text_input.rs
│ │ │ ├── content_actions.rs
│ │ │ └── sidebar.rs
│ │ ├── login
│ │ │ ├── login_page.rs
│ │ │ └── login_form.rs
│ │ ├── comment
│ │ │ ├── comment_node.rs
│ │ │ └── comment_nodes.rs
│ │ ├── post
│ │ │ ├── post_listings.rs
│ │ │ ├── post_page.rs
│ │ │ ├── post_listing
│ │ │ │ └── thumbnail.rs
│ │ │ └── post_listing.rs
│ │ ├── layouts
│ │ │ ├── base_layout
│ │ │ │ ├── top_nav
│ │ │ │ │ ├── notification_bell.rs
│ │ │ │ │ ├── theme_select.rs
│ │ │ │ │ └── auth_dropdown.rs
│ │ │ │ ├── mobile_nav.rs
│ │ │ │ ├── top_nav.rs
│ │ │ │ └── side_nav.rs
│ │ │ └── base_layout.rs
│ │ ├── home
│ │ │ └── home_page.rs
│ │ └── modals
│ │ │ └── report_modal.rs
│ └── components.rs
├── contexts.rs
├── serverfns
│ ├── users.rs
│ ├── auth.rs
│ ├── theme.rs
│ ├── comments.rs
│ ├── communities.rs
│ ├── posts.rs
│ ├── theme
│ │ ├── get_theme.rs
│ │ └── set_theme.rs
│ ├── get_site.rs
│ ├── posts
│ │ ├── list_posts.rs
│ │ ├── get_post.rs
│ │ ├── report_post.rs
│ │ ├── hide_post.rs
│ │ ├── save_post.rs
│ │ └── vote_post.rs
│ ├── auth
│ │ ├── logout.rs
│ │ └── login.rs
│ ├── comments
│ │ ├── list_comments.rs
│ │ └── report_comment.rs
│ ├── communities
│ │ ├── list_communities.rs
│ │ └── create_community.rs
│ └── users
│ │ └── block_user.rs
├── utils
│ ├── traits.rs
│ ├── types.rs
│ ├── traits
│ │ ├── bool_option_str.rs
│ │ └── to_str.rs
│ ├── types
│ │ ├── dialog_types.rs
│ │ ├── server_action.rs
│ │ ├── theme.rs
│ │ └── content_action_types.rs
│ ├── derive_user_is_logged_in.rs
│ ├── get_client_and_session.rs
│ ├── markdown.rs
│ ├── get_time_since.rs
│ ├── apub_name.rs
│ ├── derive_query_param_type.rs
│ └── filetype.rs
├── serverfns.rs
├── constants.rs
├── contexts
│ ├── theme_resource_context.rs
│ └── site_resource_context.rs
├── cookie_middleware.rs
├── utils.rs
├── host.rs
├── main.rs
└── lib.rs
├── .prettierignore
├── end2end
├── playwright-report
│ └── .gitkeep
├── tsconfig.json
├── lemmy.hjson
├── package.json
├── tests
│ ├── desktop
│ │ ├── theme.spec.ts
│ │ ├── theme.hydrate.spec.ts
│ │ ├── auth.spec.ts
│ │ └── navigation.spec.ts
│ └── mobile
│ │ ├── theme.spec.ts
│ │ ├── theme.hydrate.spec.ts
│ │ └── navigation.spec.ts
├── docker-compose.yml
├── playwright.config.ts
└── pnpm-lock.yaml
├── .github
└── CODEOWNERS
├── scripts
├── format.sh
└── run_end2end_tests.sh
├── public
├── default-avatar.png
├── favicon.svg
└── icons.svg
├── .leptosfmt.toml
├── .rustfmt.toml
├── settings.json
├── renovate.json
├── .gitignore
├── package.json
├── Makefile.toml
├── docker
├── lemmy.hjson
├── nginx.conf
└── docker-compose.yml
├── pnpm-lock.yaml
├── Dockerfile
├── CONTRIBUTING.md
├── README.md
├── locales
└── en
│ └── main.ftl
├── Cargo.toml
├── .woodpecker.yml
└── style
└── tailwind.css
/src/ui.rs:
--------------------------------------------------------------------------------
1 | pub mod components;
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | pnpm-lock.yaml
2 |
--------------------------------------------------------------------------------
/end2end/playwright-report/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/ui/components/home.rs:
--------------------------------------------------------------------------------
1 | pub mod home_page;
2 |
--------------------------------------------------------------------------------
/src/ui/components/layouts.rs:
--------------------------------------------------------------------------------
1 | pub mod base_layout;
2 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @dessalines @SleeplessOne1917
2 |
--------------------------------------------------------------------------------
/src/ui/components/login.rs:
--------------------------------------------------------------------------------
1 | pub mod login_form;
2 | pub mod login_page;
3 |
--------------------------------------------------------------------------------
/src/ui/components/comment.rs:
--------------------------------------------------------------------------------
1 | pub mod comment_node;
2 | pub mod comment_nodes;
3 |
--------------------------------------------------------------------------------
/src/contexts.rs:
--------------------------------------------------------------------------------
1 | pub mod site_resource_context;
2 | pub mod theme_resource_context;
3 |
--------------------------------------------------------------------------------
/src/ui/components/modals.rs:
--------------------------------------------------------------------------------
1 | mod report_modal;
2 | pub use report_modal::ReportModal;
3 |
--------------------------------------------------------------------------------
/src/serverfns/users.rs:
--------------------------------------------------------------------------------
1 | mod block_user;
2 | pub use block_user::create_block_user_action;
3 |
--------------------------------------------------------------------------------
/end2end/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "types": ["node"]
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/scripts/format.sh:
--------------------------------------------------------------------------------
1 | leptosfmt -c .leptosfmt.toml src
2 | taplo format
3 | cargo +nightly fmt
4 | pnpm fmt
--------------------------------------------------------------------------------
/src/ui/components/post.rs:
--------------------------------------------------------------------------------
1 | pub mod post_listing;
2 | pub mod post_listings;
3 | pub mod post_page;
4 |
--------------------------------------------------------------------------------
/public/default-avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LemmyNet/lemmy-ui-leptos/main/public/default-avatar.png
--------------------------------------------------------------------------------
/src/ui/components/communities.rs:
--------------------------------------------------------------------------------
1 | pub mod communities_page;
2 | pub mod community_form;
3 | pub mod create_community_page;
4 |
--------------------------------------------------------------------------------
/src/utils/traits.rs:
--------------------------------------------------------------------------------
1 | mod bool_option_str;
2 | pub use bool_option_str::BoolOptionStr;
3 |
4 | mod to_str;
5 | pub use to_str::ToStr;
6 |
--------------------------------------------------------------------------------
/src/serverfns/auth.rs:
--------------------------------------------------------------------------------
1 | mod logout;
2 | pub use logout::create_logout_action;
3 |
4 | mod login;
5 | pub use login::create_login_action;
6 |
--------------------------------------------------------------------------------
/src/serverfns/theme.rs:
--------------------------------------------------------------------------------
1 | mod get_theme;
2 | pub use get_theme::get_theme;
3 |
4 | mod set_theme;
5 | pub use set_theme::create_set_theme_action;
6 |
--------------------------------------------------------------------------------
/.leptosfmt.toml:
--------------------------------------------------------------------------------
1 | max_width = 100
2 | tab_spaces = 2
3 | attr_value_brace_style = "WhenRequired" # "Always", "AlwaysUnlessLit", "WhenRequired" or "Preserve"
4 |
--------------------------------------------------------------------------------
/.rustfmt.toml:
--------------------------------------------------------------------------------
1 | tab_spaces = 2
2 | edition = "2021"
3 | imports_layout = "HorizontalVertical"
4 | imports_granularity = "Crate"
5 | group_imports = "One"
6 |
--------------------------------------------------------------------------------
/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "rust-analyzer.procMacro.ignored": {
3 | "leptos_macro": ["server"]
4 | },
5 | "rust-analyzer.cargo.features": ["ssr"]
6 | }
7 |
--------------------------------------------------------------------------------
/src/serverfns.rs:
--------------------------------------------------------------------------------
1 | pub mod auth;
2 | pub mod comments;
3 | pub mod communities;
4 | pub mod get_site;
5 | pub mod posts;
6 | pub mod theme;
7 | pub mod users;
8 |
--------------------------------------------------------------------------------
/src/serverfns/comments.rs:
--------------------------------------------------------------------------------
1 | mod list_comments;
2 | pub use list_comments::list_comments;
3 |
4 | mod report_comment;
5 | pub use report_comment::create_report_comment_action;
6 |
--------------------------------------------------------------------------------
/src/ui/components.rs:
--------------------------------------------------------------------------------
1 | pub mod comment;
2 | pub mod common;
3 | pub mod communities;
4 | pub mod home;
5 | pub mod layouts;
6 | pub mod login;
7 | pub mod modals;
8 | pub mod post;
9 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": ["config:recommended"],
4 | "schedule": ["before 4am on the first day of the month"]
5 | }
6 |
--------------------------------------------------------------------------------
/src/constants.rs:
--------------------------------------------------------------------------------
1 | pub const INTERNAL_HOST: &str = "localhost:8536";
2 | pub const HTTPS: bool = false;
3 | pub const AUTH_COOKIE: &str = "jwt";
4 | pub const DEFAULT_AVATAR_PATH: &str = "/default-avatar.png";
5 |
--------------------------------------------------------------------------------
/src/serverfns/communities.rs:
--------------------------------------------------------------------------------
1 | mod create_community;
2 | pub use create_community::{create_community, CommunityResponse, CreateCommunityBody};
3 |
4 | mod list_communities;
5 | pub use list_communities::list_communities;
6 |
--------------------------------------------------------------------------------
/src/utils/types.rs:
--------------------------------------------------------------------------------
1 | mod theme;
2 | pub use theme::Theme;
3 |
4 | mod server_action;
5 | pub use server_action::*;
6 |
7 | mod dialog_types;
8 | pub use dialog_types::*;
9 |
10 | mod content_action_types;
11 | pub use content_action_types::*;
12 |
--------------------------------------------------------------------------------
/src/utils/traits/bool_option_str.rs:
--------------------------------------------------------------------------------
1 | pub trait BoolOptionStr {
2 | fn then_str(self) -> Option<&'static str>;
3 | }
4 |
5 | impl BoolOptionStr for bool {
6 | fn then_str(self) -> Option<&'static str> {
7 | self.then_some("true")
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/traits/to_str.rs:
--------------------------------------------------------------------------------
1 | pub trait ToStr {
2 | fn to_str(self) -> &'static str;
3 | }
4 |
5 | impl ToStr for bool {
6 | fn to_str(self) -> &'static str {
7 | if self {
8 | "true"
9 | } else {
10 | "false"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/ui/components/common.rs:
--------------------------------------------------------------------------------
1 | pub mod community_listing;
2 | pub mod content_actions;
3 | pub mod creator_listing;
4 | pub mod fedilink;
5 | pub mod filter_bar;
6 | pub mod icon;
7 | pub mod markdown_content;
8 | pub mod sidebar;
9 | pub mod text_input;
10 | pub mod vote_buttons;
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ide config
2 | .idea
3 | .vscode
4 |
5 | # build
6 | target
7 | node_modules
8 | dist
9 |
10 | # test
11 | docker/volumes
12 | end2end/test-results
13 | end2end/playwright-report/**
14 | !end2end/playwright-report/.gitkeep
15 |
16 | # local woodpecker exec
17 | .cargo/**
--------------------------------------------------------------------------------
/src/ui/components/communities/communities_page.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 | use leptos_fluent::move_tr;
3 |
4 | #[component]
5 | pub fn CommunitiesPage() -> impl IntoView {
6 | view! {
7 | {move_tr!("communities")}
9 |