Live data from Hacker News

Ask HN: Companies of one, what is your tech stack?

news.ycombinator.com

181–190 of 206 posts

Re: Ask HN: Companies of one, what is your tech stack?

#181
post #77

Earlier quoted context omitted.

I'm embarrassed to say that writing about that has been on my Soon™ list for quite a while ;)

Brain dump some bullet points as an outline that you can later expand on. You have no idea how helpful it will be to other people including your future teammates. ;-)

I started 3 days ago It's been hard.

At first I had validation on an email input field after a day all text is put through.. I'll have to look into it next week.

The validation lines are still in de code but don't seem to work. It's probably something stupid.

For now the website is live. I used a single db table for everything. Later I'll do it the proper way. I couldn't find an easy example how to add more complex systems.

I used gen.auth and this comes with multiple tables. I guess there is a way to gen it in ecto. But is there also a gen for a basic liveview crud, which can be changed. This way new users start with something, otherwise you start from a void.

I'm not going petal yet. I'll first try without A. I'll probably have to use it in a month when I have to integrate a js library(Html5-QRCode).

Re: Ask HN: Companies of one, what is your tech stack?

#183

Not a company but I’ve been experimenting with different tech stack options over the last 6 months to find a simple tech stack with an independent frontend and an independent backend with a hosted database. The goal is not just to build but also be able to maintain without much complexity and not spend a lot of money on hosting. Backend: Building a REST/GraphQL API that could be deployed to Cloudflare workers is a no…

Railway sounds exactly like what you're looking for in hosting Postgres.

Re: Ask HN: Companies of one, what is your tech stack?

#184
post #35

Rails (6.1), Postgres, Redis, Sidekiq Hosted on Heroku, using Sentry for error tracking, New Relic for performance monitoring, Sendgrid for email. Recently ditched Google Analytics in favor of Plausible for general analytics and Ahoy (Rails middleware) for deeper in-house analytics. Using Intercom for support/chat widget, but planning to switch to Chatwoot. Considering moving off Heroku, but the most obvious contende…

Will be happy to have you on-board Let us know if you need any help with Chatwoot setup.

Re: Ask HN: Companies of one, what is your tech stack?

#185

Hosting: Bare metal on Hetzner. Backend: Python / SqlAlchemy DB: Postgres Cache: Redis Frontend: React / Redux / Emotion / Socket.io Reverse Proxy: Traefik Marketing Site: Next.js CDN/File hosting: Cloudflare, R2 Backups: Tarsnap Deployment: Docker / Docker Compose Server configuration: Ansible Mobile: React Native Payments: Stripe Email (Transactional/Marketing): Postmark If I were to start today, I would probably s…

Nice. But now that you made me curious: what would you start with now and why?

World is moving to a different direction.

- Typescript is a compelling alternative combined with Cloudflare Workers for backend. Cheap and unlimited scalability while not dealing with servers just sounds too good. Database side is not there yet, but I believe it'll come soon.

I know that there are other solutions using Docker for scalability, but it becomes expensive. v8 is what made this possible, and it'll only continue to get better as it's one of the most used software in the world. Python will never get that kind of effort.

- C# and .net 6 is another strong contender today with cross platform support and Microsoft's new open source approach. I'm currently rewriting one of the apps in c# for an enterprise contract and using reflection and code generation, I can do most of the things that I use metaprogramming in Python. And compared to Python, it's a lot faster and I can use things like multi threading without much effort.

After happily writing in dynamically typed languages for 10+ years, I'm slowly moving towards static typing.

Re: Ask HN: Companies of one, what is your tech stack?

#186

I run several SaaS apps on a single big OVH server. It handles 6 million non-cached requests per day. The backend stack is pretty basic: Django/Python, MySQL, redis (pub/sub) for websockets. But the secret sauce is OpenResty. I use Lua scripts to do more sophisticated page caching (because the builtin nginx caching is so primitive), DDoS protection, handling websockets, offloading long running requests, and routing b…

> I use Lua scripts to do more sophisticated page caching (because the builtin nginx caching is so primitive) curios to know more on this - what you could do better using Lua logic?

When a non cached request comes in to the Python layer, I set a response header with that object's modified date. Lua intercepts that response header, and stores the modification date in a shared dictionary under that object's cache_key.

When the next HTTP request comes in to view that object, I lookup the object's date in the shared dict. If the modified date is > now(), I set the bypass flag to 1, so nginx updates its cache.

Re: Ask HN: Companies of one, what is your tech stack?

#187

Earlier quoted context omitted.

> I use Lua scripts to do more sophisticated page caching (because the builtin nginx caching is so primitive) curios to know more on this - what you could do better using Lua logic?

When a non cached request comes in to the Python layer, I set a response header with that object's modified date. Lua intercepts that response header, and stores the modification date in a shared dictionary under that object's cache_key. When the next HTTP request comes in to view that object, I lookup the object's date in the shared dict. If the modified date is > now(), I set the bypass flag to 1, so nginx updates…

Correct me if I'm wrong, but isn't X-Accel-Expires the same basically?

From docs:

Parameters of caching can also be set directly in the response header. This has higher priority than setting of caching time using the directive.

    The “X-Accel-Expires” header field sets caching time of a response in seconds. The zero value disables caching for a response. If the value starts with the @ prefix, it sets an absolute time in seconds since Epoch, up to which the response may be cached.
    If the header does not include the “X-Accel-Expires” field, parameters of caching may be set in the header fields “Expires” or “Cache-Control”.

Re: Ask HN: Companies of one, what is your tech stack?

#188

Earlier quoted context omitted.

Nice. But now that you made me curious: what would you start with now and why?

World is moving to a different direction. - Typescript is a compelling alternative combined with Cloudflare Workers for backend. Cheap and unlimited scalability while not dealing with servers just sounds too good. Database side is not there yet, but I believe it'll come soon. I know that there are other solutions using Docker for scalability, but it becomes expensive. v8 is what made this possible, and it'll only con…

Thank you for the detailed answer, much appreciated.

Some follow up questions/comments:

JS and therefore TS is the a key programming language of the internet. Where would you learn Typescript today if you would start from scratch? Is learning JS necessary for that?

Interesting to hear about your choice to opt for a dive into the .NET ecosystem. Would you consider F# a wise choice here, or is it better to forgo it and stay on C# for good?

Re: Ask HN: Companies of one, what is your tech stack?

#189

Earlier quoted context omitted.

World is moving to a different direction. - Typescript is a compelling alternative combined with Cloudflare Workers for backend. Cheap and unlimited scalability while not dealing with servers just sounds too good. Database side is not there yet, but I believe it'll come soon. I know that there are other solutions using Docker for scalability, but it becomes expensive. v8 is what made this possible, and it'll only con…

Thank you for the detailed answer, much appreciated. Some follow up questions/comments: JS and therefore TS is the a key programming language of the internet. Where would you learn Typescript today if you would start from scratch? Is learning JS necessary for that? Interesting to hear about your choice to opt for a dive into the .NET ecosystem. Would you consider F# a wise choice here, or is it better to forgo it and…

Re: Js/TS

I prefer "Learn x the hard way" style of learning for beginners, but no idea about resources for TS. When I'm learning a new language, I first read about the language to map the concepts I know to the paradigms of the language, look up style conventions, then just start building.

Re: C#/F#

The contract I'm on requires using C# so I don't have a choice in here. But I'm planning to explore F# more after this. The main reason of me going into .NET is almost all government software purchases where I live requires .NET and C#, and I want to tap into that market for new opportunities.

Re: Ask HN: Companies of one, what is your tech stack?

#190

Earlier quoted context omitted.

When a non cached request comes in to the Python layer, I set a response header with that object's modified date. Lua intercepts that response header, and stores the modification date in a shared dictionary under that object's cache_key. When the next HTTP request comes in to view that object, I lookup the object's date in the shared dict. If the modified date is > now(), I set the bypass flag to 1, so nginx updates…

Correct me if I'm wrong, but isn't X-Accel-Expires the same basically? From docs: Parameters of caching can also be set directly in the response header. This has higher priority than setting of caching time using the directive. The “X-Accel-Expires” header field sets caching time of a response in seconds. The zero value disables caching for a response. If the value starts with the @ prefix, it sets an absolute time i…

When a resource is cached, how do you know ahead of time how long to cache it for? If you set X-Accel-Expires to 5 minutes, but the resource is edited 3 minutes later, how do you evict the item from the nginx cache?

You can figure out where the item is in the nginx cache directory and delete it. But that is complicated by the fact that your app and nginx run as different users. Or you can send a specially crafted HTTP request to nginx assuming you have some kind of backdoor proxy_cache_bypass setup. But that's ugly too. You either have a race condition, or you have to hang your app's response until the invalidation request completes.

If there's another way to evict an item from the cache, I'm all ears.

Post reply on HN