Router.so
Router.so
Router.so was a quick idea that turned into a full-fledged product. After building many sites with contact and help forms, Bridger Tower and I got tired of having to spin up a database to collect leads for each individual project. This always led to losing leads and forgetting about where data was being held. We eventually decided to build a simple lead router to collect leads across various sites.
Instead of it just simply collecting leads, we figured it would be helpful to also validate those leads and give positive feedback on why it was or wasn't accepted. In an afternoon, I built an initial MVP that was the basis for what Router.so became.
Router.so has proved some early product market fit. Many developers are using it and giving feedback. We have also been hit up by a few Venture Capital funds interested in the product. We broke the top 10 on a Product Hunt launch day (completely organically). And finally, Guillermo Rauch did actually DM me about Router.so with some positive feedback and kind words.
Tech Stack
This project is actually pretty simple. It's a Next.js application that uses Postgres, DrizzleORM, and TypeScript. Zod is the most important dependency of the project as it enables the parsing and validating of leads on the server.
It is completely open source and all the source code can be accessed on GitHub.
Technical Details
The entirety of the validation logic is primarily handled by two functions:
Given an array defined by the user in the UI that satisfies the type Array<GeneralSchema>
, the generateDynamicSchema
function iterates through the array and maps each item to its corresponding validation rule, ultimately constructing a ZodRawShape
object.
When data is received via an API POST, the validateAndParseData
function uses the created schema to safe parse the incoming payload. If the data is valid, it is saved to the database for the user to access. If not, a thorough log is returned with exact reasons why the lead was not parsed and saved.
Design
I would be remiss if I didn't emphasize the beauty of the UI and give a special shoutout again to Bridger Tower.