8291e38080e52fb5d51a9f5709b0b1cdb22fba61
Dispatching an event to the listener previously happened from an un-awaited goroutine, with only a log line on failure - once processed_at was set, a dropped or failed notification was permanently and silently lost, with no way to tell it had happened. Replaces the processed/processed_successfully booleans with a notified_at/processed_at pair (migration 000031): the dispatcher sets notified_at and hands the event to MockEventListener.Notify, which now also receives an ack callback the listener calls whenever it's truly done, synchronously or arbitrarily later. Anything still "notified" but unacked past notifyRetryAfter (a tunable field, not a stored per-row timestamp) gets notified again on the dispatcher's normal poll/reactive loop - no new retry mechanism needed. ack is idempotent, since a late ack from an earlier attempt and one from a retry can both eventually fire for the same event. Dispatch is deferred until after the transaction that recorded notified_at has actually committed, so ack's independent write can't race a still-open transaction it implicitly depends on being visible. The real SSE listener (server/sse/db_event_publisher.go) acks inline, since its work is synchronous. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XEDaCB7C2NEBgyvqEtZuxY
V2 - Attempt 2
Roadmap
- Etsy (WIP)
- GET ETSY AUTH (WIP)
- move auth state stuff to database (out of cache)
- only generate a sign up link IF they click the link on the accounts page
- get api key approved
- automatically clean up access tokens and state when expired
- access tokens
- state
- [?] Get new access token using refresh token flow
- make a FK between the etsy_store_events table and etsy_users table (store_id columns don't match types)
- GET ETSY AUTH (WIP)
- Auth0
- get off dev api key?
- Get new access token using refresh token flow
- test
- when token is expired, redirect them to the login page, then redirect them back to where they were heading to.
- Social connections login
- automatically clean up access tokens and state when expired
- access tokens
- state
- Complete this design document?
- Complete defining this roadmap checklist
- Website displaying an audit of store events
- Start with just a list of events for a given store (use a static test store)
- ...
- Dark mode
- don't let a listing be in multiple sync groups
- Next stores on the list (at least hypothetically)
- Shopify
- WooCommerce
- BigCommerce
- Wix
- Squarespace
- Square Online
- Zoho
- Ecwid
- Big Cartel
Bigger marketplaces:
- Amazon
- Walmart Marketplace
- Ebay
Nice to haves
- Drop in a good logger
- log all errors caught by the http server
Constraints
- Etsy
- API Licensed Uses and Restrictions:
- Link directly back to the product information and/or image Content on Etsy, where the Application utilizes product information and/or images.
- Provide a prominently displayed email address on Your Application for third parties to contact You with any questions or issues. You shall respond to such inquiries in a timely manner.
- Use commercially reasonable efforts to provide a terms of service and privacy policy in a visible location on your Application.
- Display item Content or product information and/or images which is more than six (6) hours older than such information is on the Website, and other Etsy Content cannot be more than twenty-four (24) hours older than such Content on the Website.
- Use the API in a manner that exceeds reasonable request volume or constitutes excessive or abusive usage. Users are allocated by default, 10,000 calls per day.
- You shall not use or alter any text, logos, Etsy's Trademarks, Etsy's signature colors, Etsy's layout, or a confusingly similar layout to Etsy's layout in such a way which may suggest endorsement or affiliation by Etsy.
- Any use of the Etsy logo or Etsy's Trademarks must be used in its entirety and must not be altered or used in a misleading way.
- You shall not use a mark which is confusingly similar to Etsy's Trademarks.
- Any use of the Etsy logo or Etsy's Trademarks in Your Application shall be less prominent than the logo or mark that primarily describes the Application and Your use of the Etsy logo shall not imply any endorsement or affiliation by Etsy.
- You may publicize, issue press or blog releases of Your Application only if You state that it was created using the Etsy API and that You in no way imply that Your Application is endorsed or certified by Etsy.
- You must place or display the following notice prominently on Your Application: "The term 'Etsy' is a trademark of Etsy, Inc. This application uses the Etsy API but is not endorsed or certified by Etsy, Inc."
- Immediately report any security deficiencies You discover to Etsy by emailing developer@etsy.com.
- API Licensed Uses and Restrictions:
Looking to follow the CQRS pattern.
The database will follow the event sourcing database pattern. All events (or commands) will be stored in a respective event series, and all database reads will be from views that are projections, reductions, aggregations of those event series.
Application/directory structure
- /internal
- /site: website
- /webhooks: webhooks for platform events
- /domains: packages for each domain
- /store_events: storing and events
- /platforms: ecommerce platform domains
- /tiktok: interface with tiktok
- ... etc
- ... etc
Website hierarchy
- /site
Architectural and Software Diagrams
Database schemas
Events
Event Sourcing Architecture
Event Structure
Store Event Database Tables
Platform: Etsy
Signing up
TODO: need an account page that can create accounts ahead of time - force users to create an account first!
TODO: create a page that will take billing information and include it in this process
Getting a new refresh token
TODO
Models
All Diagrams
All diagrams are stored in the diagrams directory
Languages
Go
54.5%
PLpgSQL
16.6%
Go Template
12.2%
JavaScript
9.4%
CSS
6.8%
Other
0.5%