Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
leomorpho committed Sep 20, 2024
1 parent ff8a671 commit 052888c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 39 deletions.
39 changes: 0 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ up: ## Start the Docker containers
$(DCO_BIN) up -d --remove-orphans
sleep 3

.PHONY: stop
stop: ## Stop the Docker containers
$(DCO_BIN) stop

.PHONY: down
down: ## Stop the Docker containers
$(DCO_BIN) down
Expand All @@ -137,24 +133,10 @@ down: ## Stop the Docker containers
down-volume: ## Stop the Docker containers
$(DCO_BIN) down --volumes

.PHONY: reseed
cycle: ## kill and restart entire system
make down-volume
make up
sleep 3
make watch

.PHONY: seed
seed: ## Seed with data (must be clean to begin with or will die)
go run cmd/seed/main.go

.PHONY: reseed
reseed: ## kill everything and reseed
make down-volume
make up
make seed
make watch

.PHONY: reset
reset: ## Rebuild Docker containers to wipe all data
$(DCO_BIN) down
Expand Down Expand Up @@ -241,22 +223,6 @@ tailwind-watch: ## Start a Tailwind watcher
tailwind-compile: ## Compile and minify your CSS for production
./tailwindcss -i input.css -o static/output.css --minify

.PHONY: docker-build
docker-build: ## Build docker container
go mod tidy
docker build --tag docker-cherie .

.PHONY: docker-push
docker-push: ## Push new image to registry
docker build . -t ghcr.io/leomorpho/fireside:0.0.1
docker push ghcr.io/leomorpho/fireside

docker-run-web: ## Run web docker container
docker run --env-file .env -p 8002:8002 docker-cherie web

docker-run-worker: ## Run worker docker container
docker run --env-file .env.local docker-cherie worker

.PHONY: deploy-cherie
deploy-goship: ## Deploy new Goship version
kamal deploy -c deploy.yml
Expand Down Expand Up @@ -289,11 +255,6 @@ js-reinstall: ## Reinstall all JS dependencies
rm -rf node_modules package-lock.json
npm install

.PHONY: update
update: ## Pull latest changes from my improved Pagoda repo
git pull pragmatic pragmatic
git merge pragmatic/pragmatic

.PHONY: doc
pkgsite: ## Create pkgsite docs
pkgsite -open .
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,52 @@ See [goship.run](https://goship.run). NOTE: it's currently being actively develo

This documentation will eventually be moved to [goship.run](https://goship.run).

## Makefile

The Makefile is the main entry point for the project. It is used to build the project, run the project, and deploy the project.

The following commands are the most useful ones:
```bash
make init # Initializes the project
make watch # Runs the project in watch mode, rebuilding assets as you go (JS, CSS, Templ, etc)
make test # Runs the tests
make e2eui # Runs the interactive e2e tests with Playwright #
make cover # Shows a Go coverage report of the tests

# DB specific commands
make ent-new name=YourModelName # Creates a new ent schema file
make makemigrations # Creates a new migration file
make ent-gen # Generates the ent code from the schema
make migrate # Applies migrations
make inspecterd # Shows you a view of all your tables in a UI
make schema

# Docker commands
make up # Starts the docker containers
make down # Stops the docker containers
make down-volume # Stops the docker containers and removes the volumes
make reset # Stops the docker containers and removes the volumes, then rebuilds the docker containers

# Assets
make build-js # Builds the JS assets
make watch-js # Watches the JS assets and rebuilds them on change
make build-css # Builds the CSS assets
make watch-css # Watches the CSS assets and rebuilds them on change

# Worker commands
make worker # Starts the worker
make worker-ui # Will open the terminal to the asynq worker UI

# Stripe (payments)
make stripe-webhook # Sets up a webhook for stripe for local testing

make help # Shows all the commands you can run
```


## Add a route

Create a new file in `routes/` and add your route. A route is a standard Echo handler with some added goodies. Once you've added handlers for your route, you can hook it up to the router in `routes/routes.go`, where the route should be registered to be reachable from the web.

## Deployment

Expand Down

0 comments on commit 052888c

Please sign in to comment.