 I'm going to introduce Leo really quickly. He started contributing to Mozilla at the age of 11 after accidentally hitting F1 in Firefox and being taken to the support site. Now I know he likes to play the piano, but the little birdie told me that about a week ago in a hotel lobby while he was doing his thing, he was kind of asked to stop. And with this, welcome, Leo. Thank you. Thank you for coming. Can you, the few people at the back, can you hear me? Can you hear me all right? Brilliant. Okay, hello. I'm Leo, as was said. I do play the piano, but apparently not that well. I'm a freelance developer from the United Kingdom, working on discourse development for various clients, including Mozilla, from the UK. And I'm happy to be on my first false step. It's just a slight shame. It might also be my last. So, I've been volunteering for Mozilla for the past eight years. I started contributing with efforts to use discourse within Mozilla around three years ago. And I've been working for Mozilla on discourse on my gap year before going off to university next year. So, what is discourse? If you haven't met it before, this is how I like to describe it. Its form software designed for and in the 21st century. Because when you think of form software, you probably think of something that looks a little bit like this. Now, I'm 19 years old, and this was designed when I was a baby, which isn't great. Form software shouldn't be old enough to give a conference talk. And a web application that is based on a design that's now old enough to drive, to drink, to marry, to join the military, and so many other things, is not software that's making full use of the capabilities that the modern web gives us. So, enter discourse. It has a huge number of features that are standard within form software, and a huge number of features that are not that make use of the modern web. Too many to list, but some of them include an infinite scroll, so pages aren't, you don't have to click through them, and incredibly good mobile support. Now, why are we in the Mozilla dev room? Mozilla runs its own discourse instance, and Mozilla has a somewhat unique use case when it comes to discourse. We're used to using news groups, we're used to using mailing lists, and so this idea of using web software to talk is not necessarily a comfortable thing for everybody at Mozilla, and discourse does support some incredibly good email in capabilities, but they're not all the way there yet, and they're not exposed to user as well as they could be. So that's what I'm working on currently, but there's a huge amount of work to do, and I need some help, I need some help from you. So, who are you? I've had to make some assumptions about who you are in order to make a talk that doesn't span hours and hours and hours, and so here are some of them. You're using Linux rather than Mac OS or Windows. These instructions will work there, but you're gonna have to Google a little bit to find out what they are. You're not scared by terminal, maybe you haven't used a terminal all that much, but the prospect of using them doesn't make you wet yourself. You have a rudimentary knowledge of Git. You maybe know how to clone a repository, but not much more than that, that's all right. And you've tinkered around with code a little bit. You maybe don't know a program or language particularly well, but again, code doesn't scare you, and you don't necessarily know Ruby. It's not a requirement, it's what discourse is programmed on a server side, and this really is the easiest thing for me to talk about because this is who I was when I started contributing to discourse, when I started developing with discourse. So I've talked about who you are, now what is discourse, at least from a development perspective? Well, it really makes sense to think of it as two separate applications. On the front end, we have an ember app that interacts with the backend, which is a Rails app, and they interact through an API. Now this separation between front end and backend can lead to some confusion, especially maybe if you're already an experienced Rails developer. Discourse doesn't work quite as a normal Rails app would because of this separation, and it can also lead to some confusion because you have replication of like model names and so on and so forth, on the front end, on the backend. But I think it can also make contributing to discourse and developing with discourse a lot easier, because it means you don't necessarily have to know everything in order to do something. You could as a JavaScript developer very easily contribute to discourse just on the front end. Now, everything I talk about in this talk is information that is located elsewhere, and the steps I'm about to go through and the rest of this talk are really gonna be a summarization of the sort of ultimate document, I suppose, it would be for contributing to discourse, which would be discourse development contribution guidelines on the meta discourse instance. It's linked on the schedule. I'm gonna summarize some bits, I'm gonna run through some bits faster than I've done here, and I'm also gonna expand on some bits. Really, if you do want to contribute to discourse, you've gotta give this a read. There's no way I can express all the information that it has right now. So, setting up your development environment. You could go to a package manager and install Ruby, and install Rails, and install Postgres, and every number of dependency that discourse relies upon, and spend hours setting it up. But we don't wanna do that. We're beginners, we wanna do this quickly. So, there's a very simple two-step setup process. One, calling the Git repository to run vagrant up. And once you've done that, everything's set up. So, let's go into that in a bit more detail. Installing VirtualBox. This, of course, is gonna vary from distribution to distribution, from operating system to operating system, if you're trying to do this on Windows. But just install it. I mean, it varies so much. It's in the package manager. Install it, and beware, depending on what Linux distribution you're running, you may have to enable kernel module and also make sure you've enabled virtualization in your BIOS. Install vagrant, again, just install it. It's in your package manager, do it. And Git, again, there's a bit of a theme here. Just install it. Now, we get into some commands. We get into our terminal. So, of course, we've gotta clone the Git repository. I tend to clone everything into a projects folder I have in my home folder. So, of course, run Git clone. I've cut off the name of the repository. It's too big. I've linked to the GitHub page in the schedule. Wait a little bit for Git to download everything and then go into the directory that's been created. And then I recommend that you check out the test pass branch. Discourse has different branches for different stages of development. And the master branch is untested code. The test pass branch, as the name suggests, is code that is only there after it's run against Discourse Automated Test and it provides a level of stability. Next, we need to run Vagrant. So, first, we run Vagrant up in the same directory in the terminal. This will pull in the Vagrant, the virtual box virtual machine. It will install some dependencies. And once it's finished, Vagrant SSH to enter the Vagrant machine. So now we need to set up the Vagrant box because we've got our development environment in our Vagrant box. But there's a bit of housekeeping we need to do. And we need to do every time we update Discourse. But I'll get into that in a minute. So first we want to enter the Vagrant directory in the Vagrant box. This is where the Discourse source code lives. The slash discourse directory that exists on a host has been linked to this directory. So if you were to list here, you would see your Discourse source directory. Then we need to install the gems that Discourse relies upon. Gems are what NPM packages are to JavaScript, what anything is to anything when it comes to various program languages. A little bit of code that Discourse relies upon, but you don't have to worry too much about. Then you need to run your database migrations so that the database and the code is all synced up. Finally, we need to create an admin user so that you can actually log into your Discourse site once it's up. And then we start the Wells server. And once you've done all of this, when you visit localhost.com 4000, we should have a development environment. So we're gonna want to stop this at some point. So of course, kill the Wells process, exit your vagrant box and stop it. So I mentioned before, we need to keep things up to date. And we should keep things up to date because otherwise we're gonna be developing against old versions of Discourse. So we need to pull in the changes from Git, and we need to go through the previous process again. Start on the vagrant box, entering it, entering the correct folder, installing our gems, running the database migrations, and starting the server process again. Now there are various things that run in the side of Discourse to do various things, especially for development. So in development, you may find yourself wanting to send email, especially if you're developing with email, like we do within Mozilla. And so there's a program that can be run which will catch any email. So you're not actually sending it to the real world. You don't have to worry about sending, setting up an SMTP server. So run that command and you should be good to go. You may get an error. The docs say you may get an error. If you do, run that command, run the previous one, and then visit localhost port 4080, and you'll find the mail catch interface. And whenever you send an email, it will appear there. Also somewhat essential for sending email and various tasks within Discourse is the sidekick queue manager. Some things within Discourse will send things off to this queue to get processed. It needs to be running in development for any of those jobs to happen, but you don't necessarily need it. So with this one, with the previous command, just open another terminal, enter your vagrant box, go into the right directory and run the command. Now, choosing a text editor. We're almost there. We're almost writing some code, but we need to choose a text editor to get anything done. Well, we have some requirements for this text editor. First of all, we sweat it text. That's the somewhat essential one. I mean, I know all text editors should edit text, but I've somehow once got myself stuck in a VIM edit window, and from what I could see, it didn't edit text. It was just a very complicated puzzle of how to get myself out of it. So use a text editor that you know how to use. Also, it's very important that your text editor has a file name search, because when you're developing with Discourse, it's quite a large code base, and a lot of what files do are not stored within the files, but in the file name itself. So you need a text editor that does that. And then also a text editor that does global search, because Discourse is spread across multiple files, you're going to want to be able to search through them very easily. And finally, it's time to do some development. So Discourse is a huge code base. It's larger than anything I had ever worked on before. It's big, it can be quite scary, and you can spend what seems like a very long time having absolutely no idea what's going on. I still do. And how you get started really depends how you like to learn new things. I've always liked throwing myself in the deep end and trying to figure out things from there. I think there's a great approach, because especially with something as large as Discourse, if you were to try and sit down and read every piece of documentation available to you, by the time you got to the end of it, you'd have forgotten what you wrote, you read and learnt at the beginning. So yes, the approach that I took was learning what I needed to know as I needed to know it. And there are some docs that can help you with that. So it does depend on what you're doing, but some standard documentation that may help you is to begin with the Rails guide. Now, I mentioned before Discourse isn't quite a standard Rails app. This doc, this guide may not help you as much as you think it should, because Discourse doesn't do everything that is usual within Rails. But I found it very useful. For certain things, I particularly found it very useful for the active record documentation when I wanted to interact with the database, when I wanted to interact with models. The end the guide is also essential, but for the same reason, not essential, it's also very useful. For the same reason, it's not essential. Discourse isn't quite a standard Ember app. There are various things they do all by themselves. And of course, when you're editing elements of Discourse, you're not creating a new Ember application. You don't necessarily need to know how everything works. And finally, and most importantly, Discourse meta. So the Discourse instance that Discourse runs. This is where you're gonna find basically everything you need to know. It's gonna become your best friend. Any question you have has probably already been asked and already answered there. And there's also this great source of documentation. The two most useful categories you'll find out are the how to slash developers category and the dev one. And this one is probably the one you're gonna want to ask a question if you get stuck. Now the single best topic I've found, which most accurately describes the steps I went through to learn how to develop with Discourse is one like this. I wish this had existed when I got started. And so this brilliant guide, how to start building stuff for Discourse if you're a newbie like myself, goes through almost all the steps you're gonna require. I've already talked about a few of them. There are some X ones there that you will want to take a look at. Again, this is linked in the schedule. So, we've set up our development environment. We've opened our text editor. We've learned how to ask for help. Now, what can you work on? There's a lot of things that we want done with in Mozilla. And these are all listed in an issue tracker that's linked on the Discourse page on the Mozilla wiki. Again, linked in the schedule. So take a look there if you want to. And also on Discourse Meta, the PR welcome tag lists everything that the Discourse team themselves have said that every feature request they've said would be welcome in Discourse, but they're not necessarily willing to spend development time on. So look for those topics and just get started. Again, I'll link to that is in the schedule. So, you may have some questions when you come to doing development. First of all, search on Discourse Meta. It's almost certainly been asked before. It's almost certainly been answered before. If you can't find anything that describes what you're wanting, post on Discourse Meta. And you should hear feedback from the developers. And if both of those approaches fail, feel free to reach out to me. I'm at Leo MCA on the Meta Discourse and I'm at Leo on Mozilla's Discourse Instance. And with that, my talk is over, but as the title says, if any of you have any questions, I'm available now. Yes, but it's not the officially supported way. So there is a Docker development image that I have been playing around with a little bit lately. It's certainly a lot faster to do it in Docker. It's certainly less taxing on your computer's resources. I think it almost doubles the battery life of my laptop if I do it in Docker rather than in Vagrant. But as I've said, it's not the officially supported way and there are still a few things that are possibly missing and possibly not working. I haven't had the opportunity to fully explore it myself. But if you are interested in doing it in Docker rather than Vagrant, if you want to set that challenge for yourself, again, just look on the Meta Discourse Instance. There are instructions there, just search for Docker development. Any others? I don't see any hands going on. I haven't blogged about it. But there are instructions on Meta Discourse, yeah. I think that's it. Thank you so much.