Starting a New Development Project
Starting a fresh new project is always a nice feeling, you sit there with your cup of coffee and spend a couple of hours setting up your environment and thinking to yourself “why did I ever become a developer”. But it’s a necessary evil in order to have a well-built and tested application.
What's a development envrionment?
A development environment is a collection of procedures and tools for developing, testing, and debugging an application or program. It normally has three server tiers:
- Development tier: this is where the application gets tested by developers and is made sure to work properly. If the developer feels everything works properly, it is sent to the staging server.
- Staging tier: this tier is built exactly like the production environment. The application is tested for reliability and to make sure it will not fail once put on the production server.
- Production tier: this is the final tier, once the approval is given, the application goes online for the users to get.
The development environment provides developers with an interface and convenient view of the development process which includes writing code, testing the same and packaging the build so that it can be deployed. It contains everything required by a team to build and deploy software-intensive systems.
So what's the use of development environments?
Generally speaking, one of the main reasons why you should use a development environment is to make sure not to break anything on your live environments that your users see. Working with multiple environments and following a deployment process is great for reducing potential errors. It also means that a developer can make breaking changes on the development environments and make sure that everything is working properly before deploying changes to the live environment. Another important aspect of development environment is that it’s considered to be the first line of defense against bugs. It’s the place where developers deploy their code and test any newly implemented features, and any bugs found are dealt with before re-deploying for further testing. This process is iterated until the code is ready for the next stage of testing.
Development is a messy process..
Let's imagine creating a new web application.
We start by creating some folders on our machine and then create our first files. We then write some lines of code and could just run our website directly and view it on our browser, but that’s not really the optimal solution. We want people to access it from the web, so we will need an http server. So, we install apache and php, after researching what versions are actually compatible with what we need, and then begin setting them up to suit the project. Also installing each language's dependencies. Eventually, we will also need to connect php and apache and allocate a port for the server. We then link the frontend to our backend and make sure that it works before pushing it for production and allowing users to see it.
In many different cases, we are required to set access tokens or whatever reason, and it is definitely preferred to keep those away from the code that the public might see, so we need to set up environment variables.
Step after step, we are basically creating a recipe for mistakes. If we override older versions that older projects relied on, everything might break and ruin our entire week as we’ll spend so much time trying to fix those mistakes. Knowledge and experience will surely help not make mistakes, but everything will be a little time consuming regardless.
Enter containers, enter docker..
Your solution to breakage is containerizing your projects and isolating them from each other through docker. Docker is one of the most important technologies that you might or might not have heard of. It is an open-source project that allows you to containerize your projects and run them separately regardless of versions and environments. It does that by virtualizing your operating system - in contrast to virtual machines that virtualize your hardware. This process allows you to safely run many containers simultaneously. Those containers eventually become your unit for distributing and testing your application.
Docker is very powerful but also kinda difficult to manipulate, especially if you’re an up-and-coming developer or a student. And even if you’re a seasoned developer, it’s just annoying and time consuming. You first need to install and run docker - you could change how much resources docker utilizes. You then need to get your app; either clone a repo or have a local version. At this point, you need to create a DockerFile which is basically a script that create the container image. Then you build your docker application and can run your docker container.
Using docker:
I'll mention a quick overview on how to use docker and make a more in-depth blog post about docker specifically.
You first need to install and run Docker – and allocate how much resources you allow it to utilize. After that, you need to get your app onto the environment by either cloning a repo from git for example, or just having a local version on your machine. At this point, you need to create a DockerFile which is a script that creates the container image. A container image is essentially a file including executable code that is able to run an isolated process on your machine. It includes system libraries, system tools, and other settings needed to run a software on a containerization platform. Then you build your docker application and can run your docker container.
Once you have gone through the previous process, docker is going to allow you to setup multiple containers that can run the same technologies without corrupting other projects. So, you can run any desired versions of php, apache, angular, or any other language you want in your web project and be sure that everything will always work.
If you’ve never really used docker properly before, it can be a messy process and you’ll find yourself spending your entire day looking up tutorials to help you out.
Enter myceleum!
Yes, all of that sounds as painful as it is and requires a lot of time and knowledge. It is very worth it, but should it really be that complicated? No, and that’s why you have myceleum. myceleum is a desktop application that runs on docker and can help you easily dockerize your projects and setup your environments – which is a saving grace as those processes are very tedious and difficult, especially for new developers.
Getting started with myceleum is fairly easy and straightforward and will allow you to setup your environments within less than 10 minutes. Start by downloading docker and making sure it’s running properly. Then head to myceleum’s website and easily download the desktop application.
When you start myceleum, you’re greeted with its user-friendly interface. Once you go through all the given spores (existing development environments) you can download the one suitable for you and customize it as much as you’d like.
For our web project, we could download and setup the “php and apache2” spore. myceleum will automatically download what you need and prefill environment variables based on best practices (these variables are easily changed by users depending on their requirements). You are then required to specify the path of the project on your machine, and after that you are free to use myceleum’s built-in IDE or any IDE you like thanks to the IDE integration feature. The application also allows you to choose shells based on your own preferences. This means that the developer will go through the smoothest developing experience, as intended by myceleum. All of the above, in the simple click of a button.
To recap, setting up development environments is essential to properly set up and develop projects. It is a messy process that quickly gets tiring and consumes a lot of time. But with myceleum, developers can simplify their lives and let it do what it does best: setup the environments within minutes and with no effort.
TL,DR: use myceleum, create development environments quickly, save yourself some trouble, and just focus on what you do best.
Written by Serge & Nazeer