I'm new to web development and just took on a low-risk job to build a website. I've been upfront with my client about my experience level since I've never built a site before, but I'm determined to make it work. I've learned various web languages over the years, and so far, my HTML, CSS, JavaScript, PHP, and MySQL are all functioning as expected. My main concern is how to structure the architecture of the site to make it easier for maintenance in the future, particularly if I'm not the one maintaining it. Currently, I'm handling one HTML, CSS, and JS file per page. I'd love some guidance on how to effectively organize my scripts. If any experienced developers were to look at my setup, what would you suggest for dividing the scripts?
3 Answers
You might want to look into using preprocessors like SCSS or utilities like Tailwind CSS to handle your styling better. It can really streamline your workflow and give you more options.
You’ll want to set up an initial entry point for your JavaScript, usually something like main.js, which can feed into other modules. That will help keep everything organized.
If you’re working with plain HTML and CSS for the front end, it might become a hassle over time. A lot of developers lean towards frameworks like React or Vue to simplify organization. For instance, you can check out The Odin Project’s React course, which shows how to use Vite to set up a React project. That way, you can create components in separate JSX files and keep your structure neat. Just consider how far you are into your current project — refactoring might be a significant investment at this point.

Haha, I know the feeling! Every time I learn something new, it feels like I've just opened a whole new can of worms for my weekends!