2

I have a client who started a Craft CMS site with another developer. I guess the other developer quit, and now the client wants me to make some changes to the site.

The site was created with Composer (which I haven't used before), and I'm stumped on how to get it installed on my local machine using MAMP. I ran Composer to install the dependencies, but there isn't a "Craft" folder and a "Public" folder like I'm used to seeing.

Here's a screenshot of the file structure. file-structure

Anyone have any advice on how to get this site installed locally so I can make the changes requested?

Thank you in advance!!

1 Answer 1

4

From what I see in your screenshot, it looks like you stumbled upon a Craft 3 installation, in which case neither a Craft nor Public folder exist.

Craft 3 specific

The public folder is now called web, so that's where you should point your MAMP documentroot (or whatever that's called in MAMP). The Craft code is now located in composer's vendor folder, that should magically appear after running composer install. Craft's source would then be in vendor/craftcms/cms.

You can read more about the overall structure of a Craft CMS 3 project in the Setting up a New Craft CMS 3 Project article.

Frontend build tools and JS dependencies (package.json, webpack.mix.js)

Further more, I see that Laravel Mix is used for frontend (js, css) automization, meaning that you have to install JS dependencies by running npm install or yarn install, after which you can use the command defined in package.json to run Mix. I guess this is something like npm run watch (when developing) or npm run prod before you push anything to production.

Modules

And: I see a modules folder, that would most likely mean that a custom module was used for this specific site. Modules are a (poorly documented ;)) Craft 3 way of extending your site without building a plugin and trying to get that to work through composer. They are essentially a wrapper for Yii2's modules.

It's very possible that the Module is just vestigial, however, since that folder is created by default if you do composer create-project -s RC craftcms/craft PATH. You can read more about Modules in the Enhancing a Craft CMS 3 Website with a Custom Module article.

Environment settings

Last but not least: copy .env.example to .env and use that to set credentials for your environment (db settings and stuff).

5
  • Heh I was just typing up something along the same lines, but you beat me to it :P lol
    – Jalen Davenport
    Mar 28, 2018 at 13:28
  • It's very possible that the modules folder is just there in a vestigial way; it's created by default if you do a composer create-project -s RC craftcms/craft. I wrote up some documentation on modules here: Enhancing a Craft CMS 3 Website with a Custom Module Mar 28, 2018 at 13:52
  • At the first sight it looks like this is a screenshot from a git repository so it's usual that it does not contain the vendor folder -> all the needed plugins. We don't know if the former developer already worked with certain plugins or not. Maybe they are all on the development server and not inside the repo. I would just like to know why you know it is not installed? When you take a look into all our projects they are looking quite similar -> you would suggest a new developer to start from scratch Mar 28, 2018 at 14:17
  • Looks a lot like this site was set up by someone who knew what they were doing. Have you read the README? It's clearly been modified by the dev so it may well contain detailed setup instructions, my readmes do. Mar 29, 2018 at 9:57
  • @andrew.welch I had to look up vestigial but yes, that’s very possible ;)
    – Paul
    Mar 29, 2018 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.