We put things in order: how to organize work during the creation of the site. (Part 1)

Original author: Bryan Hoyt
  • Transfer
A little off topic

Having secured the consent of ilusha_sergeevich, we plan to post translations of some articles on Habré, the links to which he cites in the publications “ Some interesting and useful things for a web developer ” in the section “Western thoughts or what should be translated into Habré”. At the very start of this initiative, we want to ask the community about the degree of its feasibility (a survey at the end of the article).

Actually, the text itself

Unfortunately, we used the word “organize” in the title. “Put out the light” is probably what many have thought. Being organized is a little boring, but crucial. It may be worth considering this concept in context.

Let's imagine that we are making a website for the fashion art cafe Beat. It is an atmospheric place with 20s paintings on the walls, live jazz and a wealthy patron, but they still don't have their own website. They hire you to rectify the situation. As a talented designer, you are sure that you can create a fantastic site, but they have many ideas about the functionality and you are not quite sure how to organize all the files necessary for your site.

They want to be able to independently edit content, upload photos, post weekly blog posts and upload new content. They also ask to connect twitter so that their messages are automatically broadcast on the network. They need an application for iPhone and Android, because their customers use smartphones, and they want to give them the opportunity to view the blog and menu directly from their phone. In addition, they need customer reviews with the ability to add images, links, etc.

“Facebook for restaurants” they tell you. Perhaps at this stage, you will send them to hell, but you understand the idea. Perhaps in the past you tried to create a more complex site and started to work with commendable enthusiasm, but in the end there was a terrible mess, which is simply unrealistic to cope with. Your client has ceased to show interest, adding new features has become extremely problematic, you started working at night to find errors, but you could not even find the file you need. After such a project, it is easy to understand the relevance of a well-organized file creation process.

General principles

Everything should be simple and clear. Do not overdo it. Some sites and databases look as if their creators enjoy trying to create the perfect order. From a practical point of view, as a rule, it is impossible to work with such structures.

If you start to create dozens (or hundreds) of tiny files, each of which contains nothing more than a small class or function, you have overdone it. If your files and folders have too abstract or obscure names, there is confusion. If the verification code for the login of the site administrator is stored in a file called auth.php with the location WebsiteData / Items / GenericUser / AdminUser / Code / then you made both errors. Why not just the check_login () function in the Code / users.php file?

Do not mix different aspects of your site. Separate functional elements and different languages. I recently dealt with a project in which the developer used CSS, ASP VB Script, JavaScript, HTML, SQL and all this in a terrible mess in one poorly structured file. I do not invent.

One size does not fit all.

The depth of the folder hierarchy and the number of individual files should make sense for the size of the project. Keep this in mind.
Here is a short list of some typical site sizes and possible structure:

1 page

Create a folder for images, CSS, JavaScript files, for content and for code. You should definitely not create templates for content unless you have specific requirements for this.

5 pages

Folder for images, one file for CSS, JS, code. Consider creating multiple content files in a separate folder. Again, do not bother with templates, there are enough blanks for the most frequently used elements of the site.

20 pages A

folder for images, another folder for downloads and other files related to the project (“Assets”), a folder for content (maybe you should think about using CMS). Your JavaScript, CSS, and other code are likely to have grown to get a separate folder. Call them obviously: css /, javascript /, code /.

Make sure that all files are in the appropriate folders. You should not have an extraneous .js file, say, in the “Content” folder, simply because it is convenient. If your templates or code do not allow you to organize your files as you need, then refactor the code to make it work.

Avoid putting CSS, templates, HTML, work images or JavaScript in “assets” / (“miscellaneous”, “resources” or whatever else you call it). These files are part of the code that your client should not think about, and “assets” is the folder for the files related to the project. Make it your rule and follow it unconditionally.

20 pages + web application

Almost the same as stated above. At this point, all of your code should be in a separate folder. Make sure this is not a folder that Apache might accidentally open access when any script-kiddie will try to attack your computer.

100 pages

You should use a good CMS for your content. It does not matter whether it is a database-based system or a file CMS. When choosing the second option, you should make sure that the content files are well organized and that you can specify metadata for individual headers, descriptions, etc. Otherwise, you will have to spend a lot of time and effort on SEO.

Most likely, your site already contains a number of different sections. You should consider placing CSS, JS, images and templates in separate folders, the structure of which coincides with the structure of the site. Using Sass or LESS is also a good idea at this point.

2,500+ pages

You should definitely think about hiring people such as a content editor, designer, programmer and SEO expert. You should also manage content using database-based CMS, if you haven’t already. You will become a manager, and will deal with the work done by other people. Make sure you are able to check and edit the material before it goes into production.

100,000,000+ pages

You are Microsoft and you need to know what you are doing.

Most small sites grow very quickly to 20+ pages. Just add the FAQ, a few articles and a couple of products. Therefore, it makes sense even to structure small projects as if it is a site with 20 pages, if you are not sure that this is a one-time site. Plan for smooth growth with a gradual increase in pages.

Only registered users can participate in the survey. Please come in.

Should I post translations of the articles “Western Thoughts or What Should Be Translated into Habré” ?:

  • 78% yes 142
  • 9.3% No 17
  • 12.6% I don't care 23

Also popular now: