SkillAgentSearch skills...

Zenias

Vagrant box development for FCC students who are learning Python, Ruby, PHP, Clojure, Jave, Node etc.

Install / Use

/learn @DevBlend/Zenias
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Zenias

Join the chat at https://gitter.im/FreeCodeCamp/vagrant

Table of Contents

What is Zenias

Zenias is a CLI tool that creates a platform-independent Vagrant development environment.

Presently, we support creating Ubuntu 14.04 LTS environment with these stacks:

  • Clojure-Compojure-Leiningan
  • Node-Express
  • Java 1.8-Tomcat-Maven-Gradle
  • PHP-CakePHP
  • Python-Django
  • Ruby-Rails-Sinatra

In all of the above, PostgreSQL 9.3 is present and configured for use as Database, except for the Node and Express stack; where MongoDB has been provided.

Current Version

Present version of this project stands at 1.0.0. We use Semvar based versioning.

How to Use

Basic Requirement

You need to install latest (version 5.0.20) Virtualbox, its compatible Virtualbox Extension pack for USB 2.0 support; and latest (1.8.1) Vagrant itself.

If you are on Windows, you need Git Bash. On other platforms, like Linux or MacOSX; you would require having git installed in your machine. On Windows, you might need to restart your machine after Vagrant installation.

Once you have installed these, you can choose to boot up one of the following environments. In future, we plan on installing the basic requirements as part of zenias as well.

Clojure

Java

In the Java box we have provided the following packages :

  • Java 8 - v1.8
  • Maven 3
  • Gradle 2
  • Tomcat 8

Additionally, Postgres database has been setup.

Tomcat server is set to auto-start on port 8080. Now in this box, the port 8080 is mapped with Host, i.e your machine's port 9100. Thus, run anything on the tomcat server and it would be accessible on your machine in the address http://localhost:9100

Node

In the Node box we have provided the following packages :

In our vagrant configuration, the port 3000 is mapped with guest port 9200. Thus, if you start an express app on port 3000, you can access it via the address http://localhost:9200

We have also included a sample Todo app with Socket Stream, built by the awesome guys at TodoMVC. To run it, do the following :

cd /vagrant # navigate to shared vagrant folder
cd socketstream
npm install
bower install
npm start

Now open http://localhost:9200 in your browser and voila! The todo app is working!

PHP

The PHP box comes with the following packages:

  • Apache 2.4 webserver
  • PHP 5.5 with these extensions:
    • php5-intl
      • php5-pgsql
    • php5-mcrypt
    • php5-sqlite
    • php5-apcu
    • php5-cli
    • php5-gd
  • PostgreSQL server 9.3 (MySQL or MariaDB support may come later)
  • PostgreSQL client 9.3
  • phpunit 3.7

Typical workflow for using this PHP box:

  1. Launch the virtual machine
  2. Work on the host with your favorite tools (Apache documentRoot is <zenias>/php/www on the host, /vagrant/www on the guest)
  3. Test
  4. Push your commits on github and/or heroku: - From the host, with your usual tools (I use SmartGit to manage my git repos, and the heroku toolbelt) - From the guest : you will have to configure your git repository, but the heroku toolbelt is installed.
  5. Repeat from 2
  6. Celebrate.

Defaults

  • The default IP address of the guest is http://192.168.56.101.
  • You can access the PostgreSQL server with user vagrant, password vagrant. An empty database named my_app has already been created.

For more information. refer to the PHP readme.

Python

Ruby

In the Ruby box we have provided the following packages :

It installs the following gems:

Start rails servers with rails s -b 0.0.0.0 to make the server available at http://localhost:3000

Motivation

Zenias is made for students of FreeCodeCamp, who are starting their journey in learning back-end development.

The motivation for this Open Source project is to let users focus more on coding web apps, and less on configuration and set-up.

We expect our vagrant environments running smoothly on most platforms; including Windows, Mac, and Linux. We also aim to reduce the size of the box as much as possible.

Features and Packages

There are three levels that Zenias will change: your local machine, Vagrant VM, and virtualenv within the Vagrant VM. Various features are installed on different levels.

Individual Boxes

  • Each individual box has its own shell-based provisioner. For instance, java provisioner is zenias/java/provision.sh.
  • Each box has a DB, a web framework, a package manager and some nifty tools like curl, git, dos2unix etc.

Common Features

  • All boxes come with pre-installed heroku toolbelt and heroku CLI for easy deployment of apps on heroku.
  • All boxes have port forwarding. So, you don't need to know the IP address of a vagrant box - you can simply access the running app inside vagrant via http://localhost:<port_number> in your browser.
  • All boxes share a workspace with host machine. It allows an end-user to work on their own local IDE.

Contributing Guidelines

  • Do talk to us before you raise a pull request.
  • If you are looking for something to work on, please check our issues.
  • Vagrant testing takes time, and we intend to support major platforms. If you raise a PR, it might take a day or two for us to test on most platforms. So have patience.
  • You can contribute by adding documentation on FreecodeCamp Wiki about this project.
  • You can contribute by testing various boxes on new platforms, or existing PRs on common platforms.

Frequently Asked Questions

Why Not Docker?

Docker is not natively supported on Windows and Mac. While on Linux, it makes sense to use Docker, on Windows and Mac; one needs lot of extra packages to make Docker work.

Docker is in no way superior to Vagrant if we are targeting development environment for end user, on their personal laptop or family desktop. We chose to start with Vagrant and the project grew from there. If we get a compelling reason to move to Docker, we would.

Why are c9 or Nitrous not used?

Cloud 9 and Nitrous are great services, for coding in-browser. They give you a full-fledged terminal with superuser access, among other things. But we are trying to help people get jobs by building a solid back-end or full-stack profile.

A user needs to be comfortable working on their own machine, outside a browser. A vagrant environment is a great place to start. Once we have a user comfortably working using a vagrant, we can take them through the journey of taking apart their environments, and setting up their own environment.

We plan on creating some detailed tutorials on these, and an environment in a local machine is a step towards that.

In a lot of countries, getting good reliable internet is an issue. Power cuts are rampant. If you are from one of those places, you are probably more comfortable working on your local environment offline.

We acknowledge the benefits of cloud-hosted, browser-interfaced envs like c9 or nitrous. And our tool is complementary to these. In the end, it's the end-user who gets to decide which one they want to use.

Why shell-script provisioning?

State-of-the-art provisioners like Chef, Puppet, Ansible, and Salt are there. They work amazingly well, with 100% reliability; and most big and small companies use them internally in their DevOps.

But, while they are great for provisioning 16 GB CentOS workstations in a team, part of a large MNC, your local Windows 10 with 4 GB RAM would most likely not be able to handle them. You machine would slow down, or would need to download hundreds of files alon

View on GitHub
GitHub Stars33
CategoryDevelopment
Updated2y ago
Forks13

Languages

Shell

Security Score

75/100

Audited on Mar 19, 2024

No findings