This repository contains a complete development environment setup for running two todo applications:
- PHP Todo App (CodeIgniter)
- NodeJS Todo App (Express)
- Vagrant
- VirtualBox
- Ansible
- Install the required tools:
# Ubuntu/Pop!_OS
sudo apt update
sudo apt install vagrant virtualbox ansible
# MacOS
brew install vagrant virtualbox ansible
- Clone this repository:
git clone https://github.com/sayyidyofa/grafana-poc
cd grafana-poc
- Add local DNS entries (the ip address is according to
inventory/hosts.yml
):
# Add to /etc/hosts
192.168.56.10 phptodo.local
192.168.56.10 reacttodo.local
- Start the development environment:
vagrant up
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
- PHP Todo App: http://phptodo.local
- React Todo App: http://nodetodo.local
.
├── Vagrantfile
├── apps/
│ ├── php-todo/
│ └── node-todo/
├── inventory/
│ └── hosts.yml
├── playbooks/
│ └── site.yml
- The applications' source code is mounted into the VM, so you can edit the code on your host machine using your preferred IDE.
- Changes to the apps will be reflected immediately.
MariaDB is configured with the following credentials:
(PHP app)
- Database: db_todolist
- Username: todouser_php
- Password: todo_password_php
(Node app)
- Database: tododb
- Username: todouser
- Password: todopass
You can connect to the database using:
vagrant ssh
mysql -u todouser -ptodopass tododb
- If you can't access the sites, make sure you've added the entries to your /etc/hosts file
- If Vagrant can't start the VM, ensure VirtualBox is properly installed and virtualization is enabled in your BIOS
- For database connection issues, verify the credentials in the application configurations match those in the Ansible playbook
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request