https://github.com/cwithmichael/clj-shopping
A Clojure clone of a Javascript Shopping Cart app with Lit on the frontend
https://github.com/cwithmichael/clj-shopping
clojure lit redis typescript
Last synced: 3 months ago
JSON representation
A Clojure clone of a Javascript Shopping Cart app with Lit on the frontend
- Host: GitHub
- URL: https://github.com/cwithmichael/clj-shopping
- Owner: cwithmichael
- License: mit
- Created: 2024-04-25T16:58:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-28T18:50:45.000Z (over 1 year ago)
- Last Synced: 2025-02-10T10:23:27.192Z (11 months ago)
- Topics: clojure, lit, redis, typescript
- Language: TypeScript
- Homepage:
- Size: 4.29 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-shopping
This project is based off of the [Redis Shopping Cart app tutorial](https://github.com/redis-developer/basic-redis-shopping-chart-nodejs).
## To Run locally
### Make sure you have
- a local Redis instance running on port 6379
- Java installed
- Clojure installed
#### Start the Server
`clj -T:build all && java -jar target/clj-shopping-standalone.jar`
#### Start the Client in a different terminal window
`cd client`
`npm install`
`npm run dev`
The Swagger API will be at
http://localhost:3000/api/index.html#/

The UI should be running at
http://localhost:5173/



## TODO
- Add proper error handling
- Add tests
- Improve documentation
- Rethink architecture on client side
## Local Clojure Development
Start a [REPL](#repls) in your editor or terminal of choice.
Start the server with:
```clojure
(go)
```
The default API is available under http://localhost:3000/api
System configuration is available under `resources/system.edn`.
To reload changes:
```clojure
(reset)
```
## REPLs
### Cursive
Configure a [REPL following the Cursive documentation](https://cursive-ide.com/userguide/repl.html). Using the default "Run with IntelliJ project classpath" option will let you select an alias from the ["Clojure deps" aliases selection](https://cursive-ide.com/userguide/deps.html#refreshing-deps-dependencies).
### CIDER
Use the `cider` alias for CIDER nREPL support (run `clj -M:dev:cider`). See the [CIDER docs](https://docs.cider.mx/cider/basics/up_and_running.html) for more help.
Note that this alias runs nREPL during development. To run nREPL in production (typically when the system starts), use the kit-nrepl library through the +nrepl profile as described in [the documentation](https://kit-clj.github.io/docs/profiles.html#profiles).
### Command Line
Run `clj -M:dev:nrepl` or `make repl`.
Note that, just like with [CIDER](#cider), this alias runs nREPL during development. To run nREPL in production (typically when the system starts), use the kit-nrepl library through the +nrepl profile as described in [the documentation](https://kit-clj.github.io/docs/profiles.html#profiles).