chore: untrack binaries and update README
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
Remove compiled binaries (main, terminalShop, api/main, api/api-server) and server.go.old from git tracking. Add them to .gitignore. Update README to reflect current project state accurately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -12,8 +12,13 @@
|
||||
*.so
|
||||
*.dylib
|
||||
terminalshop
|
||||
terminalShop
|
||||
server_bin
|
||||
terminalshop_*
|
||||
server.go.old
|
||||
main
|
||||
api/main
|
||||
api/api-server
|
||||
|
||||
# Go test/coverage files
|
||||
*.test
|
||||
|
||||
44
README.md
44
README.md
@@ -1,6 +1,6 @@
|
||||
# Terminal Coffee Shop
|
||||
|
||||
A terminal-based coffee shop, accessible over SSH. Built with Go, Bubbletea, Wish, Chi, PostgreSQL, Stripe, and Shippo.
|
||||
A coffee shop you access over SSH. Built with Go, Bubbletea, Wish, Chi, PostgreSQL, Stripe, and Shippo.
|
||||
|
||||
```bash
|
||||
ssh localhost -p 23456
|
||||
@@ -9,7 +9,7 @@ ssh localhost -p 23456
|
||||
## Running locally
|
||||
|
||||
```bash
|
||||
# Copy and fill in env vars
|
||||
# Copy and fill in your env vars
|
||||
cp .env.example .env
|
||||
|
||||
# Start the API server
|
||||
@@ -32,31 +32,27 @@ go run main.go
|
||||
|
||||
## What's working
|
||||
|
||||
- SSH server — key-based auth, auto user creation
|
||||
- Shop page — browse products with live detail panel
|
||||
- Cart — add/remove items, synced to API
|
||||
- SSH server — key-based auth, auto user creation on first connect
|
||||
- Splash screen with animated blinking cursor while auth + data loads
|
||||
- Shop page — browse products with a live detail panel on the right
|
||||
- Cart — add/remove items, synced to the API
|
||||
- Checkout flow — shipping address → payment → confirmation
|
||||
- Saved addresses and cards
|
||||
- Order history in account view
|
||||
- Save/delete shipping addresses and payment cards
|
||||
- Order history in the account view
|
||||
- FAQ page
|
||||
- Responsive layout (small/medium/large terminal sizes)
|
||||
- Help page
|
||||
- Responsive layout across small, medium, and large terminals
|
||||
- Centralized theme system (no more scattered hex values)
|
||||
- Token refresh
|
||||
|
||||
## Known bugs
|
||||
|
||||
- Address delete has an off-by-one slice bug in `shipping_form.go:386`
|
||||
- Account page has a leftover placeholder menu item somewhere in the models
|
||||
|
||||
## TODO
|
||||
|
||||
**Features missing vs reference (terminal.shop):**
|
||||
- [ ] Splash/loading screen on connect
|
||||
- [ ] Animated logo with blinking cursor
|
||||
- [ ] API token management page
|
||||
- [ ] OAuth app management page
|
||||
- [ ] About page
|
||||
- [ ] Theme system — currently 40+ hardcoded hex colors scattered across files
|
||||
- [ ] Viewport-based scrolling — currently manual scroll math with hardcoded heights
|
||||
|
||||
**Known bugs:**
|
||||
- [ ] Address delete slice bug in `shipping_form.go:386` — `[m.AddressCursor+1:]...` missing
|
||||
- [ ] Account page has a placeholder "something" menu item in `models/coffee.go`
|
||||
|
||||
**Code quality:**
|
||||
- [ ] Nested state structs (reference uses `state.shop`, `state.cart`, etc. vs flat Model)
|
||||
- [ ] Centralized styles file
|
||||
- Viewport-based scrolling (currently manual scroll math with hardcoded heights)
|
||||
- API token management page
|
||||
- OAuth app management page
|
||||
- About page
|
||||
|
||||
BIN
api/api-server
BIN
api/api-server
Binary file not shown.
@@ -1,61 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/ssh"
|
||||
"github.com/charmbracelet/wish"
|
||||
"github.com/charmbracelet/wish/bubbletea"
|
||||
"github.com/charmbracelet/wish/logging"
|
||||
)
|
||||
|
||||
const (
|
||||
host = "localhost"
|
||||
port = "23457"
|
||||
)
|
||||
|
||||
func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) {
|
||||
m := InitialModel(s.User())
|
||||
return m, []tea.ProgramOption{tea.WithAltScreen()}
|
||||
}
|
||||
|
||||
func main() {
|
||||
s, err := wish.NewServer(
|
||||
wish.WithAddress(fmt.Sprintf("%s:%s", host, port)),
|
||||
wish.WithHostKeyPath(".ssh/term_info_ed25519"),
|
||||
wish.WithMiddleware(
|
||||
bubbletea.Middleware(teaHandler),
|
||||
logging.Middleware(),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
done := make(chan os.Signal, 1)
|
||||
signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
log.Printf("Starting SSH server on %s:%s", host, port)
|
||||
log.Printf("Connect with: ssh %s -p %s", host, port)
|
||||
|
||||
go func() {
|
||||
if err = s.ListenAndServe(); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}()
|
||||
|
||||
<-done
|
||||
log.Println("Stopping SSH server")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
if err := s.Shutdown(ctx); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
BIN
terminalShop
BIN
terminalShop
Binary file not shown.
Reference in New Issue
Block a user