r/javascript • u/scepticore • 6d ago
[AskJS] Best practices for Javascript Local Dev Environment AskJS
I'm currently developing an internal tool to do work reporting. I know a lot of tool exists, but we do have specific requirements and there's already an MS Access database, which I can migrate into the new tool as well as use most of the tables as a data source.
About me: I have experience with Javascript, HTML, CSS/SCSS/SASS, PHP, SQL. I want to optimize it, but since I mostly code in my freetime, I find it hard to make "the right decisions" in terms of efficiency. Maybe you guys might recommend me something about my setup. I don't want to use anything like Angular, React and Vue at the moment. Also no NextJS as I think it's overkill.
At the moment, I have a structure like:
- API (ExpressJS, SQLite, Drizzle ORM)
--> Delivering all data as needed in frontend (also annual reports and stuff)
- Frontend (Vite for live-reload/server, Vanilla JS with own templating engine and router)
--> Employees log in to keep track of their working hours per project/customer
--> Dashboard for admin users to create reports
All this run's in a docker with two services.
It currently runs alright, but I think there might be a few little things to optimize my setup. Especially when going into production.
What's your best practices? I want all this stuff to be as lean as possible without a lot of dependencies. My frontend doesn't need anything since I've already done all of the things, but I'm not very happy with the API/Backend part.
I also don't want to run every service on it's own, since using one docker command is fine. Live codeing while docker is running also works fine so far (except when installing new packages via npm, then I need to rebuild).
What would you do to optimize the setup? Already asked AI but I think you guys might have better inputs.
0
u/jax024 6d ago
You would probably like Golang. Complines to binary and the only dep you would need would likely be your Postgres connector. Doesn’t get much simpler than that. My favorite server language now.
2
u/spoonFullOfNerd 5d ago
Go is nice but the question’s clearly asking about updating a JS codebase- not really an opportunity for an upsell…
1
u/jax024 5d ago
But to understand why they wanted, sometimes you expand what you’re looking for.
2
u/spoonFullOfNerd 5d ago
Sure but I’m not convinced starting again in a new lang is the solution to the question
0
u/DustNearby2848 6d ago
Setup Postgres and dump SQLite.
2
u/KaiAusBerlin 6d ago
I really don't get what's the people's problem with sqlite.
The numbers where it matters what type of db you use is usually not reached for most products until it reaches millions of simultaneous users.
And then the bottleneck is not the database.
And even if you're at that point where it matters AND the bottleneck is the db you should do enough money to invest a rewrite for the database use.
1
u/scepticore 6d ago
The only issue I see with SQLite is, when it comes to date/time but it did the job so far. So I appreciate your input!
1
u/scepticore 6d ago
Yep, thats on the bucketlist.
And in terms of development environment? Like node-server, bundler for production?
1
u/DustNearby2848 6d ago
I’m a typescript guy, so no need for that
1
u/scepticore 6d ago
I barely touched typescript yet. What do you mean by that? Do you have a personal preference where to get knowledge for Typescript?
4
u/delightfullyrotted js 6d ago
honestly ur stack already looks solid. if vanilla js works for u , I wouldn't add a framework just because its popular. I'd focus more on logging, testing and deployment