Hammock moves your favorite newsletters outside of your understandably cluttered inbox, letting you focus on and learn from the content you love in a distraction-free reading space.
User
A user is a person; someone who uses the app.
Subscription
A subscription is a recurring newsletter from a specific email address.
Message
A message is an email from a recurring newsletter (extends Subscription
).
Included below are some high-level descriptions of how Hammock is implemented. The purpose of this writing is not so much to act as documentation but rather to encourage better README-driven development.
Our Gmail sync is composed of various methods to ensure that our Supabase-managed PostgreSQL database is always up-to-date with our users' Gmail inboxes:
/api/sync
endpoint which starts
a full sync
using Gmail's messages.list
API endpoint. This endpoint syncs 10 messages
and then redirects (using the nextPageToken
) to /api/sync
recursively to
sync the next 10 messages and so on and so forth. We save the current sync
cursor (the nextPageToken
returned by the last messages.list
call) in our
database so subsequent calls to /api/sync
start right where we left off.users.watch
API endpoint. This push subscription
then calls our /api/push
endpoint which uses Gmail's history.list
API to sync newly received messages as they come in.Hammock aims to use the most cutting-edge, performant, and production-ready solutions available. Included below is our current selection and the reasoning behind it, but we're always open to improvements!
next-auth
- Manages authentication with JWT
session cookies.I have very precise rules over how Git commit messages in this repository must be formatted. This format leads to easier to read commit history.
Please refer to the following documentation for more info:
Commit messages that do not adhere to the following commit style will not be
merged into develop
:
<type>(<scope>): <short summary>
│ │ │
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│ │
│ └─⫸ Commit Scope: The page, API route, or component modified.
│
└─⫸ Commit Type: ci|docs|feat|fix|perf|refactor|test|deps|chore
The <type>
and <summary>
fields are mandatory, the (<scope>)
field is
optional.
Must be one of the following:
This repository follows the standard git-flow workflow with a couple of important exceptions:
develop
should always be stable and ready for release.develop
just has not yet been released (e.g. for marketing purposes, we
release changes in large batches).master
represents the current production state of the app.