Skip to content

Development Onboarding (Linux)

Burra Abhishek edited this page Aug 6, 2021 · 8 revisions

The following instructions outline how to set up your development environment on Linux to run this app or contribute to this repository. The instructions are aimed to be agnostic of the platform this stack is installed on, so a working knowledge of the specifics of your GNU/Linux distribution or other such Unix based operating system is assumed.

Pre-requisites

Software

  • A text editor for writing code.
  • A web browser to run the application. A modern web browser like Google Chrome or Mozilla Firefox is recommended.
  • A web server to host the web application. This application won't work on the file:/// protocol because it uses a database. You can run this application locally using localhost.
  • PHP >= PHP7
  • An SQL database, because the database is an SQL database.
  • git, if you want to write code for this application

Installing software:

  1. Text Editor
    • There are many popular text editors, including vim, nano, gedit, sublime text etc. You can install any text editor of your choice.
    • Alternatively you might want to install an IDE to write code easily. You can install any IDE of your choice.
  2. Web Browser
    • If you already have a modern version of Google Chrome, Mozilla Firefox, or any other modern web browser, you can skip this step.
    • Otherwise, it is recommended to install any of these browser(s). You might need them for day-to-day browsing activities, so think about it!
  3. A web server
    • For those who are new to SQL-based website development, XAMPP and LAMP stack are two very popular choices. You can install any one of them and get started.
  4. Git
    • If you want to run this application without any version control, you can skip this step.
    • If you are writing code for this application, it is recommended to have git installed.

Installation

In this example, we will assume that XAMPP was used. Instructions will vary depending on the webserver used. XAMPP is NOT recommended for production use. Please refer to the official documentation of your webserver.

  1. Download XAMPP. (Official Website)
  2. Go to the location of the installer. Assuming that it is Downloads, type the following command in your terminal: cd Downloads to go to the Downloads directory.
  3. Change permissions to the installer using chmod 755 <Installer>. Replace <Installer> with the name of the .run file while typing the command in your terminal. The file will be of type xampp-linux-*-installer.run.
  4. Run sudo ./<Installer>. Replace installer with the name of the file as described above, and type your password when prompted.
  5. Keep all settings unchanged while installing XAMPP. You may, however, uncheck Learn more about Bitnami for XAMPP if you want.
  6. Go to /opt/lampp/ and run chmod 777 -R htdocs. Then go to htdocs folder.
  7. Either download this repository or clone this repository using $ git clone https://github.com/BurraAbhishek/VirtualElections.git
  8. To start XAMPP, the command is sudo /opt/lampp/lampp start.
  9. Now go to localhost/<Repository>/src/main.html. Replace <Repository> with the name of the repository stored in htdocs.
  10. Go to localhost/<Repository>/src/admin/getstarted.html and follow the instructions in that page.

To stop the XAMPP webserver, the command is sudo /opt/lampp/lampp stop.

NOTE:

Ensure that you execute chmod 777 -R htdocs before opening localhost in your web browser. Otherwise, any site that you want to test will return a 403 error.

Clone this wiki locally