nik_jain Posted August 21, 2019 Share Posted August 21, 2019 Making a website with the following features. Wondering how everyone would go about coding this.. Tables: User: email, location id, other.. User location: coods, area,colony,city Posts : post, location id, type id, user id Posttype: type Functions: User sign up/in, with social signup Show posts: Filter by location, date , type etc. User Profile User set location Post details Similar posts Add post Moderate posts / Users So a fairly standard user registration + user posts + have profiles + browse posts website. With the addition of setting user location and filtering posts by location. Would you use a CMS or a framework or go commando by hacking together various components? How much time do you anticipate to take to code the backend ? Please assume TDD is followed. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/ Share on other sites More sharing options...
Barand Posted August 21, 2019 Share Posted August 21, 2019 1 hour ago, nik_jain said: User: email, location id, other.. User location: coods, area,colony,city "user_id" would be a useful addition to each of those tables Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569103 Share on other sites More sharing options...
nik_jain Posted August 21, 2019 Author Share Posted August 21, 2019 Columns are just for giving an idea. Far from complete/accurate Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569104 Share on other sites More sharing options...
maxxd Posted August 22, 2019 Share Posted August 22, 2019 Honestly, given the light specs you've described I think a framework would probably do most of the work for you. If you're wanting to learn, do it from scratch - what you've described is not tough to do (it is, however, tough to do right - which makes it a good learning experience). If it's a work thing where you're on a deadline but you've got free reign, look at some frameworks. Heck, what you've described can be done in WordPress with little to no coding. Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569138 Share on other sites More sharing options...
nik_jain Posted August 23, 2019 Author Share Posted August 23, 2019 Thanks maxxd. Not at all interested in doing it from scratch. Have done that before and it takes a lot of time. Yes, It is for work, kind of. No deadlines as such, but time is money. 19 hours ago, maxxd said: can be done in WordPress with little to no coding. hmm, looking into drupal, and I guess you are right. It seems this way there would be very little coding. Makes me feel like an idiot for wasting so much time doing things from scratch. Not keen in wordpress btw. Seen too many bloated, loading-separate-jquery with each plugin websites. Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569152 Share on other sites More sharing options...
nik_jain Posted August 25, 2019 Author Share Posted August 25, 2019 I am struggling with drupal. The way I have always struggled with any CMS. There seem to to be many modifications requiring specific undocumented ways, that I find very frustrating. Would vastly prefer a framework, but the lure of the front end being handled by a CMS themes is very attractive, as its my biggest weakness. Suggestions ? Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569188 Share on other sites More sharing options...
maxxd Posted August 25, 2019 Share Posted August 25, 2019 Drupal works on the idea of hooks - predefined actions that fire at certain times in the execution of the application and will run any functions or object methods that have been assigned to that hook. Think mini state-machine, kinda. See here for more information, and here for a list of native hooks. I haven't dug too much into Drupal, honestly (I looked into it as a WordPress replacement at my previous job, but decided the admin area would be too difficult for our clients to work with), but once I got the list of available hooks things got much, much easier to deal with. Like any framework or CMS, there's a lot of "magic" that happens. It's kind of a pain and a bit difficult at first because - well yeah, you're absolutely right - a lot of it isn't terribly well documented if it's documented at all. However if you don't want to build the thing from scratch you're gonna have to deal with that. As far as I know, using a framework like Laravel or Symfony isn't going to be all that different with regard to this kind of thing - they're all dialects of PHP, and each has their own idiosyncrasies. Now that having been said, if what you've described is the full extent of what you're looking to do I'd be rather surprised if there weren't plugins available in the Drupal ecosystem that can do what you want without having to code at all. Maybe some custom JS or CSS just to personalize things but the heavy lifting should be taken care of out of the box. Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569193 Share on other sites More sharing options...
nik_jain Posted August 25, 2019 Author Share Posted August 25, 2019 hooks are fine. Its the API stuff that gets me. Ex: Code to set an extra value to a user programmatically, was too hard to figure out. From some forums posts: $uid = $this->currentUser()->id(); $userData->set('my_module', $uid, 'a_key', 'Here is a value'); Still not sure if this is the right approach. Drupal forums are also rather 'unsearchable' . No way to separate Drupal 7 posts from search results. But I have decided to not take the scratch approach, suck it up for once and dive deep into a framework. A plugin works, but certain custom coding would require deeper understanding of the platform. I am tempted to give symfony a shot instead, but I have been guilty of jumping too quickly from with a platform before... arghh Quote Link to comment https://forums.phpfreaks.com/topic/309113-how-would-you-create-this-website/#findComment-1569199 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.