# App Local Environment Setup
# Mac OS
Instructions are using the following tools:
For Microsoft VS Code, it is suggested to use the following extensions:
# Step 1 - Clone development environment repository from Github
- Clone the repository using the following command:
% git clone https://github.com/WhatsUp247/wu247docker.git
- Copy the folder "ios" to the location where you would like have the working site build.
- P.S. If you are not working in the API, you can just delete that folder from build. Also in the docker-compose.yml file, delete lines 28-39 because you will not need to build the api container.
- Remove the following items from the root directory.
.git
folder (hidden).gitignore
file (hidden)
- Unzip the file called vendor in the app folder.
# Step 2 - Clone application repository from Github
- In terminal, navigate to the app folder
- Clone the repository using the following command:
% git init
% git remote add origin https://github.com/WhatsUp247/wu247app.git
% git pull origin master
- Download the autoload folder from this Dropbox Folder (opens new window)
- Add all files from config folder to the repository in the folder /app/config/autoload folder using this
# Step 3 - Application Build
- Build and Run the container using the following command:
% docker-compose up -d
- Check that the container is running by using the following command:
% docker ps
Restart the application container.
# Step 4 - Configure Database
- Access the database's shell using Docker extention
- Access MySQL with the following command
% mysql
- Create a user (replace brackets and content with your information)
> CREATE USER '[username]'@'%' IDENTIFIED BY '[password]';
- Give administrative privileges using the commands below, inserting your own [username]:
> GRANT ALL PRIVILEGES ON * . * TO '[username]'@'%';
- Create a database using the following command:
> CREATE DATABASE [database_name];
- Select database:
> USE [database_name];
- Import database from the zip file provided using this command:
> SOURCE /tmp/wu247-lab-backup.sql;
- Type the following command to check that the database has been imported and make sure you see a user table listed:
> SHOW TABLES
# Step 5 - Configure Application
In the application folder /app/config/autoload, there are two files that need to be edited, wu247model.global.php and wu247model.local.php.
# Edit Global File
In the wu247model.global.php, we need to adjust the database name and the host name for every database option label dsn
. You will need to replace [database_name] with the database name from the MySQL Container and replace [mysql_container_name] with the name of the MySQL Container.
Find the MySQL Container name by using the following command:
% docker ps
Line example:
'dsn' => 'mysql:dbname=[database_name];host=[mysql_container_name]',
# Edit Local File
In the wu247model.local.php, we need to update every line of usernames and passwords to match your database user.
'username' => '[username]',
'password' => '[password]',
Restart the application container.
# Step 6 - Confirm Application is Running Correctly
In your browser, view localhost
and you should see the What's Up 24/7 web page.