Webwide is the inclusive forum community for web designers, developers & makers.

Whether you're an enthusiast, in training, or a seasoned pro – you'll fit right in at Webwide. We understand that our community is one of creation which is why we, unlike many other discussion forums, encourage sharing of your own projects and content. Creating a forum account is fast, easy and completely free so you can start participating right away.

Read our Code of Conduct

Free Forum Membership Benefits

  • Participate in hundreds of interesting discussions
  • Network with industry peers and make new connections
  • Show off your own projects and relevant content
  • Get help and feedback for your coding and designs
  • Buy and sell services and resources in the marketplace
  • Participate in our friendly community challenges
  • Earn trophies and work your way up our leaderboards
  • Enjoy exclusive Webwide member discounts and offers
  • ...and so much more!

Help Wanted Question on file organisation!

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
Hi all!

Im a single self taught developer working at a small company with no other developers, im worried im picking up bad habits or doing things wrong! So my question to you is am I organising my current project correctly?
I have put in a link to an imgur album of my file tree, I cant seem to get the insert image thing to work on here! I have a fair amount of Ajax call spread over separate pages and opted to store them all separately inside of a "js" file and a "helpers" file that contains all of the php files that are called by ajax.

How would you go about doing this? This is my first time using ajax and want to learn the right way instead of having to re learn later!




Thanks in advanced!

Greg
 

Adam

Mr. Webwide
Administrator
Joined
Sep 24, 2019
Messages
873
Reaction score
909
Points
915
Location
United Kingdom
Local Time
Today, 19:09
Website
adgr.dev
Pronouns
he/him
Seems like quite a big project. I assume you are going framework-less? One of the best things about frameworks are a good structure.

Are you trying to follow any kind of particular methodology already? There is not necessarily a right one but interested to hear what you are going for.
 
  • Like
Reactions: Gummibeer

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
Seems like quite a big project. I assume you are going framework-less? One of the best things about frameworks are a good structure.

Are you trying to follow any kind of particular methodology already? There is not necessarily a right one but interested to hear what you are going for.
If im honest it started out as a pretty small project but got a bit bog for its boots! Its also my first time using a templating library of which im using smarty.

Im not really following any standard other than java-script in js files helpers in the helper folder and classes in the class folder.
My issue was time I needed to have a minimum viable done in about 3 days and im not very confident with frameworks so I just sort of did what I knew!
 

tom

Creator of StickerRun®
Gold Member
Community Team
Joined
Oct 13, 2019
Messages
227
Reaction score
229
Points
285
Location
Bregenz - Austria
Local Time
Today, 20:09
Website
www.stickerrun.com
First things first, if you are working with composer, please think about using a public directory that you are setting as your docroot for your webserver.
Now, all your files are exposed to the web (if you don't have any blacklists in place) which is a huge security risk. Have a look at the Laravel boilerplate structure, it has a public directory where an index.php file is more or less starting the frameworks processes -> laravel/laravel

If you can't use a public directory, use a .htaccess file to forbid access to specific files and directories of your project eg. the vendor folder, .htaccess, .htpasswd and so on.
Also don't make class files directly accessible or custom tools/helpers and likewise as this may lead to security risks too.
 
Last edited:

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
First things first, if you are working with composer, please think about using a public directory that you are setting as your docroot for your webserver.
Now, all your files are exposed to the web (if you don't have any blacklists in place) which is a huge security risk. Have a look at the Laravel boilerplate structure, it has a public directory where an index.php file is more or less starting the frameworks processes -> laravel/laravel

If you can't use a public directory, use a .htaccess file to forbid access to specific files and directories of your project eg. the vendor folder, .htaccess, .htpasswd and so on.
Also don't make class files directly accessible or custom tools/helpers and likewise as this may lead to security risks too.
Thanks for the reply Tom I appreciate it I should probably mention the above images are from my development machine, the server that the site is used from is also an internal only server but does have a ht-access file to only allow the index and other base page files. I agree completely though I really should learn a framework I just haven't found a tutorial thats really stuck as of yet, I learn much easier through making a project with a hands on approach rather than doing a tutorial that just shows the basics!

I guess auto-loading my own classes through composer would also be a good thing to do! This project unfortunatly has forced me to learn lots of new things in one go and its quickly becoming overwhelming!
 
Last edited:

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
I'd say if you've got a tight deadline on it, don't worry about learning the right way, just get it done. You can use any advice you get here on the rewrite.
Thanks Mike, fortunately I managed to get what I needed to done for the tight deadline and now im exploring turning it into a usable tool thats a bit more robust. Thats why im now seeking out advice :D
 

blaq

Member
Joined
Oct 18, 2019
Messages
27
Reaction score
11
Points
10
Location
Philadelphia, PA
Local Time
Today, 14:09
Seems like quite a big project. I assume you are going framework-less? One of the best things about frameworks are a good structure.
disagree and agree on less time spent on building the project but it can be really challenging to maintain when these frameworks get updated ...
building your own from scratch is the best way as you only create and add what you need ... and its easier to maintain.
 

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
To be fair I think most people would be fine with a framework im just terrible at learning haha
 

blaq

Member
Joined
Oct 18, 2019
Messages
27
Reaction score
11
Points
10
Location
Philadelphia, PA
Local Time
Today, 14:09
To be fair I think most people would be fine with a framework im just terrible at learning haha
yeah! but its the most horrible thing when you work at a company and your job is to update or work on a framework that is 10 years old...
 

Gummibeer

Well-known member
Joined
Oct 5, 2019
Messages
793
Reaction score
669
Points
785
Age
27
Location
Hamburg, Germany
Local Time
Today, 20:09
Website
gummibeer.de

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
I think your right Gummi I really need to move the whole thing into a framework and just force myself to learn a framework at the same time, the problem I had with trying to learn was that I would follow a course and understand it and then think "Right now its time to add a templating engine" and then find out that I should have added it from the start haha
 
  • Like
Reactions: Gummibeer

Gummibeer

Well-known member
Joined
Oct 5, 2019
Messages
793
Reaction score
669
Points
785
Age
27
Location
Hamburg, Germany
Local Time
Today, 20:09
Website
gummibeer.de
I think your right Gummi I really need to move the whole thing into a framework and just force myself to learn a framework at the same time, the problem I had with trying to learn was that I would follow a course and understand it and then think "Right now its time to add a templating engine" and then find out that I should have added it from the start haha
It's okay to do a MVP with what you know best. But there should be a point, in best case defined and communicated upfront, when to trash everything and switch to a reliable structure.
Most bosses don't like it and want to build forever on the prototype. Because they don't see a reason to spend weeks or even months only to rework what's already present.
But it's worth it if the project should be maintainable for more years.
And with Laravel 7 in reach you will have a beautiful time to switch to it. 😉
 

TGDesigns

Member
Joined
Nov 20, 2019
Messages
47
Reaction score
34
Points
20
It's okay to do a MVP with what you know best. But there should be a point, in best case defined and communicated upfront, when to trash everything and switch to a reliable structure.
Most bosses don't like it and want to build forever on the prototype. Because they don't see a reason to spend weeks or even months only to rework what's already present.
But it's worth it if the project should be maintainable for more years.
And with Laravel 7 in reach you will have a beautiful time to switch to it. 😉
On a side note Gummi do you know/have any experience with using smarty + laravel instead of blade?
 

Gummibeer

Well-known member
Joined
Oct 5, 2019
Messages
793
Reaction score
669
Points
785
Age
27
Location
Hamburg, Germany
Local Time
Today, 20:09
Website
gummibeer.de
On a side note Gummi do you know/have any experience with using smarty + laravel instead of blade?
No experience, but I know and have done that switching to twig is easy. There's a smarty package: ytake/Laravel.Smarty but no idea if it's good. But I recommend to stick with blade. With Laravel 7 it gets super powers and otherwise you have to translate all tutorials.
 
  • Like
Reactions: Adam
Top