Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Commit

Permalink
chore: scaffold monorepo (#4)
Browse files Browse the repository at this point in the history
* chore: move rs code into `apps/server`

* chore: scaffold vite/react app

* feat: render raw html served by rust server in react app

* chore: use `just` as tasks runner

* doc: add main README

* fix `dev-client` just script

* refactor: write default config dirs relatively to exec bin
  • Loading branch information
sripwoud authored Dec 13, 2024
1 parent ecab14e commit 479e295
Show file tree
Hide file tree
Showing 107 changed files with 997 additions and 335 deletions.
24 changes: 15 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/target
/freedit.db*
/certs
/static/imgs
.rustc_info.json
.rustdoc_fingerprint.json
config.toml
/snapshots
/tantivy
.DS_Store
.envrc
.tool-versions

apps/server/freedit.db
apps/server/config.toml
apps/server/static/imgs
apps/server/snapshots
apps/server/tantivy
certs
target

bun.lockb
node_modules
*.tsbuildinfo
yarn.lock
41 changes: 41 additions & 0 deletions .justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export PATH := "./node_modules/.bin:" + env_var('PATH')

default:
@just --choose

build:
#!/usr/bin/env -S parallel --shebang --ungroup --jobs {{ num_cpus() }}
just build-client
just build-server

[working-directory: 'apps/client']
build-client:
@bun tsc -b
bun vite build

[working-directory: 'apps/server']
build-server:
@cargo build -r

clean-server:
@rm -fr apps/server/{config.toml,freedit.db,snapshots,static/imgs,tantivy,target}

dev:
@just dev-client & just dev-server

[working-directory: 'apps/client']
dev-client:
@bun vite dev

[working-directory: 'apps/server']
dev-server:
@cargo run

start:
@just start-server & just start-client

start-server:
@./apps/server/target/release/freedit

start-client:
@vite preview
Loading

0 comments on commit 479e295

Please sign in to comment.