Skip to content

Commit

Permalink
docs: Add example for integrating with Leptos (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencewenski authored Jun 30, 2024
1 parent 4ecb8d7 commit 880d850
Show file tree
Hide file tree
Showing 33 changed files with 1,360 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ serde_with = { version = "3.0.0", features = ["macros", "chrono_0_4"] }
strum = "0.26.0"
strum_macros = "0.26.0"
itertools = "0.13.0"
serde_json = "1.0.85"
serde_json = "1.0.96"
toml = "0.8.0"
url = { version = "2.2.2", features = ["serde"] }
uuid = { version = "1.1.2", features = ["v4", "serde"] }
futures = "0.3.19"
futures-core = "0.3.19"
futures-core = "0.3.28"
chrono = { version = "0.4.34", features = ["serde"] }
byte-unit = { version = "5.0.0", features = ["serde"] }
convert_case = "0.6.0"
const_format = "0.2.0"
const_format = "0.2.30"
typed-builder = "0.18.0"
num-traits = "0.2.14"
validator = { version = "0.18.0", features = ["derive"] }
thiserror = "1.0.35"
thiserror = "1.0.38"
# Add latest version of `time` to resolve a build error on nightly
# https://github.com/time-rs/time/issues/681
time = "0.3.36"
Expand Down
7 changes: 7 additions & 0 deletions config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Leptos Example Config

The `cargo leptos watch` command changes directories to the root of the `roadster` project, so we need to put the
config files for our leptos examples here in the root dir.

Similarly, if you use a `.env` file, you need to put it at the root of the `roadster` project (if running one of
our Leptos examples).
17 changes: 17 additions & 0 deletions config/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[app]
name = "Leptos Example"

[tracing]
level = "debug"

[database]
auto-migrate = true
connect-timeout = 5000
acquire-timeout = 5000
idle-timeout = 60
min-connections = 0
max-connections = 10

[service.http]
host = "127.0.0.1"
port = 3000
5 changes: 5 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[auth.jwt]
secret = "secret-dev"

[database]
uri = "postgres://roadster:roadster@localhost:5432/leptos_dev"
5 changes: 5 additions & 0 deletions config/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[auth.jwt]
secret = "secret-test"

[database]
uri = "postgres://roadster:roadster@localhost:5433/leptos_test"
225 changes: 225 additions & 0 deletions examples/leptos-ssr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# tmp files
*~*

env*/
/target
gen/

# Ignore Cargo.lock because this is a lib crate
Cargo.lock

# Generated by Cargo
# will have compiled files and executables
/target/
pkg

# These are backup files generated by rustfmt
**/*.rs.bk

# node e2e test tools and outputs
node_modules/
test-results/
../end2end/playwright-report/
playwright/.cache/

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
Loading

0 comments on commit 880d850

Please sign in to comment.