raoul2000 / fs-explorer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FS-Explorer

This project is a basic file system explorer implemented as a fullstack clojure(script) application. Its real purpose is not actually to explore a file system (there are plenty of application that do this very well) but to explore clojure(script) related technologies, library and tools to build fullstack application.

It is derivated from a similar project called clostack.

See User documentation.

Requirements

Note that the project may also run on previous versions, but these are the ones it has been developed on.

  • node
$ node -v
v16.13.1
  • Java
$ java -version
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
  • Clojure
$ clojure --version
Clojure CLI version 1.10.3.1029

Recommended:

Getting started

  • install project
$ git clone https://github.com/raoul2000/fs-explorer.git
$ cd fs-explorer
$ npm install

Work on the Frontend

Powered by shadow-cljs.

Since August 2022, shadow-cljs required Java 11 or greater (see shadow-cljs stop working with java 1.8). If you still want to stick to your old Java 8, install Java 11 but don't change your $PATH environment variable. Then do :

$ export PATH="/c/Program Files/Java/jdk-17.0.1/bin:$PATH"
$ npx shadow-cljs watch app

This way, another Java version (here 17) will be used only for shadow-cljs and everyone is happy.

Same applies to all shadow-cljs commands.

  • start shadow-cljs server and watch changes on the main application
$ npx shadow-cljs watch app
or
$ npm run watch-app

By default, following URL are availables :

Work on the Backend

The backend is an HTTP server powered by Pedestal. It exposes several REST endpoints that are consumed by the front end app.

  • run the project directly
$ clojure -M:run-m
# with options ...
$ clojure -M:run-m --help
  • run tests
$ clojure -T:build test
  • build final jar into the ./target folder
$ clojure -T:build ci
  • Run uberjar:
$ java -jar target/fs-explorer-X.X.X.jar 

Build for Production

  • first build the frontend app
$ npx shadow-cljs release app
or
$ npm run release
  • then build final jar into the ./target folder
$ clojure -T:build ci

VSCode REST client

This project includes the REST Client extension for VSCode. It requires minimal configuration to add to the .vscode/settings.json configuration file.

"rest-client.environmentVariables": {
	"local": {
		"version": "v2",
		"baseUrl": "http://localhost:8890"
	}
}

Update baseUrl property to match your settings customization.

REST scripts are stored in test/bask/http.

About


Languages

Language:Clojure 98.8%Language:JavaScript 0.6%Language:HTML 0.3%Language:Shell 0.3%Language:CSS 0.0%