Skip Navigation

Seeking to make a dynamic website right from the scratch. This is going to be my very first project. How to begin ?

cross-posted from: https://lemmy.ml/post/30253906

cross-posted from: https://lemmy.ml/post/30253851

cross-posted from: https://lemmy.ml/post/30253477

To admit frankly, l am a non technical person who would be tinkering with the task of creating a full fledged website for a travel company. For me, it's going to be a fun activity. There are a lot of nerds out here who can help me with their expertise. Many thanks to you all😊😊😊

8 comments
  • MDN offers webdev tutorials. While I've never tried their tutorials out, the MDN docs are really good and they're my go to when I need to figure out how a specific brower-side API works.

  • Please, whatever you eventually choose to do, make sure to continually reference this amazing website whenever you are implementing any interactable part.

    https://cheatsheetseries.owasp.org/

    It has cheat sheets for securely implementing everything from login forms, preventing common vulnerabilities (at least look at sheets for Top 10), forgoten password flows, storing passwprds and more.

    From the top of my head, If you are building it from a scratch without a framework, you will definitely want to at least look into cheat sheets about input validation, injection prevention, password storage, session management, file upload and authorization with authentication.

    They are not that long, and should prevent the most critical and common vulnerabilities you will probably have, where the prevention isn't too difficult, once you know about it.

  • I'm not sure why you're getting downvotes exactly.

    A basic tutorial on web development like Sleepless One suggested is definitely a good place to start, just to get a basic overview of what you're getting into. I personally learn best by doing rather than by learning. What I mean by that is if I sit down to try to learn... say... the C programming language, I'm probably not going to learn much from it, let alone retain it. But if I decide I want to write a game in C and start writing the game even from what little I know about C, I'll learn as I go. Not to say for me there's no benefit in a "learn C" tutorial, but if you're anything like me, I'd recommend switching to doing the specific website you have in mind as early as possible rather than trying to "learn web development" before switching to the project that is ultimately your end goal.

    Beyond that, you'll want to avoid falling into a trap of doing what feels to you like it'll work rather than what's "best practices" for "the industry." So the other thing I think will benefit you searching-wise is to look for information about not just how to make it (technically) work but also how to do the thing you want to do "right."

    At least that's my recommendation.

    Beyond that, are there any existing websites that closely approximate what you have in mind for an end goal for your project? If so, could you share one? I think it might help us with more specific recommendations.

  • Nobody creates a website completely from scratch. If the point is to learn, then by all means, go ahead and implement everything from scratch. That'll be very educational. However, assuming the point is to deliver a working solution to the travel company this year or next year, you're going to want to use existing libraries and frameworks to do some of the heavy lifting, organize your code and make your life easier.

    There are more or less two ways to implement a website that is not just a bunch of static HTML pages, though in practice a lot of websites will fall somewhere in between these two extremes:

    • Classic: The server generates a page based on the information in the URL or a POST request (usually when submitting a form). The server returns a bunch of HTML, CSS and maybe a little JavaScript. The contents of the page doesn't really change after it's been sent to the client (the user's browser). This is useful for webpages that aren't very interactive, like a CMS or a blog.
    • Single page applications: The server sends almost no HTML. Instead, the client retrieves data from the server, usually in the form of JSON. Once the data has been retrieved, the page is generated in the client using JavaScript. Parts of the page can be modified based on user input and further queries for data. This is useful for webpages that are very interactive, like Google Maps, for example.

    Single page applications, while popular and hip nowadays, are overkill for a lot of websites. They are also an advanced topic, that requires you to have most of the knowledge involved in the classic approach. Therefore, I will mostly discuss the classic approach in this post.

    Any website is going to have code and markup that is sent to the client and code that runs on the server. For the client side you'll need to learn:

    • HTML - A markup language that defines the structure and contents of your page.
    • CSS - Style sheets define the look and layout of your webpage. Things like colors, positions, borders, simple animations, whether text is bold, italic, etc.
    • JavaScript - A programming language that runs in the browser. This might be used for animations and effects, changing parts of the webpage through DOM manipulation and validating (checking) user input in a form.

    For the server side you'll need to learn:

    • A programming language - The possibilities are endless here. You could use almost any language. Some popular options are PHP, JavaScript, ASPNET, Python and Ruby. Apart from personal taste, which one you choose should probably depend on what libraries, frameworks and existing solutions are available for the problem(s) you're trying to solve.
    • A relational database and SQL - You'll want to store your data in a database. Use a standard relational database like MySQL/MariaDB or PostgreSQL. If someone suggests using a NoSQL database like CouchDB or Mongo, ignore them. You'll be talking to your database using some variation of SQL and/or an ORM. Also, you should learn about database normalization.

    To organize your code on the server, learn and use some sort of MVC framework like Laravel, Symphony, Django or Ruby on Rails. This will help keep your code clear by separating the template (view) from the code that talks to the database (model) and the code that processes that data (controller).

    I imagine a travel agency might need:

    • User authentication and rights management - This allows for the creation of users, allows users to log in to your site and manages which users can do and edit what. Since you don't know what you're doing, use an existing library/framework/solution for this. Otherwise you will get hacked.
    • A content management system - This will allow users to create and update pages using markup or a rich text editor, as well as uploading images and such. I highly recommend using an existing solution for this like WordPress, Drupal or one of the many others.
    • Some kind of blog or timeline with news and updates - Again, I'd suggest using an existing solution like WordPress or just embedding the company's Twitter X (or Bluesky or Mastodon) feed.
    • Some kind of booking system - If the travel company only organizes a limited number of group trips or whatever at set dates, you might consider implementing this yourself. Just let the user select a trip/destination and a date, enter relevant personal information and let them pay through some kind of payment service like Stripe. However, if the user needs to be able to create their own itineraries and book flights, hotels and rent cars and whatnot, things are going to get a lot more complicated. This would require a much more interactive page and would need to interface with all kinds of other parties, like hotels and airlines. So in that case you'd be better off using an existing solution.

    Regarding general programming knowledge, of course you'll want to learn the basics like variables, conditionals, loops, functions, objects etc... Beyond that, I suggest you also look into design patterns. These are commonly understood ways of solving different programming problems. I recommend learning patterns from both object oriented programming and functional programming. IMO you should use immutable data and functional programming whenever it's not too much of a hassle and performs well enough. If you do need mutability or statefulness, use objects and OOP patterns.

    Furthermore, at some point you'll want to learn the basics regarding data structures and computational complexity and big O notation. As far as data structures go, in practice you'll mostly use lists/arrays and hash-maps/dictionaries. It's good to know how fast different data structures perform different operations like inserting/removing elements or looking up values. You'll want to know the computational complexity of these operations. You'll also want to be able to know the computational complexity of the algorithms you create. For example, if a function needs to look at all the elements in a list once, it needs to do n steps and the computational complexity is O(n), where n is the length of the list. If a function needs to compare every element in a list to every other element in a list, it needs n * n steps and the computational complexity would be O(n^2). The latter would get slow very quickly on long lists.

    If you find yourself writing a lot of JavaScript, consider using TypeScript. While adding types to your code will seem like a hassle at first, in the long run it'll catch a lot of problems at compile time and make it easier to debug your code.

    Some people might suggest using the jQuery or Underscore libraries when writing JavaScript. While both were very useful at some point in the past, nowadays most of their functionality is included in modern JavaScript. This makes them mostly redundant unless you're targeting really old browsers.

    • Thank you very much for your detailed and thought out reply 😊😊 This is going to give me the start that l need πŸ€“πŸ€“πŸ€“

    • Is there any particular link/url for the classic option that you've mentioned ?

  • First create the HTML DOM, then beautify with CSS, then script stuff with JS for functionality you can't do with HTML and Backend.

    And read up on HTML tags, please. There's too much div-only crap already. And better go basic than fancy; fancy is more technical debt that blows up (or leaks your users passwords) along the road

    Don't listen to the naysayers, they never did a website from scratch. And the usual frameworks have gone complex to a point that learning them and adjusting them to your needs eats more time than creating a basic website from scratch, while your websites performance and accessibility tanks. Imagine, a button not working just because you blocked third-party scripts!

8 comments