Before you start following the guidelines, make sure to go through the prerequisites guide to install the required tools and packages on your machine.
-
Navigate to the right diretory where your project will be locally saved
- For WAMP:
cd C:\wamp64\www\
- For XAMPP:
cd C:\xampp\htdocs\
- For MAMP(macOS):
cd /Application/MAMP/htdocs/
- For WAMP:
-
Clone this repository and move to
portal
directorygit clone https://github.com/coloredcow/portal cd portal
-
Install dependencies
composer install npm install
-
npm build
npm run dev
A possible error may arise with
cross-env
. So try running the following commands.- To clear a cache in npm, we need to run the npm cache command in our terminal and install cross-env.
npm cache clear --force npm install cross-env npm install npm run dev
-
Make a copy of the
.env.example
file in the same directory and save it as.env
:cp .env.example .env
-
Run the following command to add the Laravel application key:
php artisan key:generate
Note: Make sure that the 'php.ini' file in XAMPP/WAMP has this code uncommented/written
extension=gd
-
Add the following settings in
.env
file:- Laravel app configurations
APP_NAME="ColoredCow Portal" APP_ENV=local APP_DEBUG=true APP_URL=http://portal.test
- Database configurations
- Create a database in your local server. Check out this link and skip to 0:21.
- Configure your Laravel app with the right DB settings. Check out this link. Relevant parts are 2:00-2:42 and 4:20-5:40.
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=portal DB_USERNAME=root DB_PASSWORD=
Note: Use the default values for MySQL database in
.env
fileDB_USERNAME=root DB_PASSWORD=
- (Optional) Google configurations.
GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_CLIENT_CALLBACK= GOOGLE_CLIENT_HD= GOOGLE_API_KEY= GOOGLE_APPLICATION_CREDENTIALS= GOOGLE_SERVICE_ACCOUNT_IMPERSONATE=
- (Optional) ColoredCow website Configurations
In case you want to use website integration functionality, then you need to enable
WORDPRESS_ENABLED
astrue
and add wordpress database configurations.
DB_WORDPRESS_DATABASE= DB_WORDPRESS_USERNAME= DB_WORDPRESS_PASSWORD= DB_WORDPRESS_PREFIX= WORDPRESS_ENABLED=true
-
Run migrations
php artisan migrate
-
Run seeders
- Portal
(Optional) In case you want to run a specific seeder class, use the
php artisan db:seed
--class
option:php artisan db:seed --class=CLASSNAME
- Module:
(Optional) In case you want to run seeders inside a specific module, run:
php artisan module:seed
php artisan module:seed MODULE_NAME
- Portal
-
Setup Virtual Host
-
For WAMP:
- Go to
C:\WINDOWS\system32\drivers\etc\
and open thehosts
(not the one with ICS extension) file in notepad (run as administrator). Add the following line at the end:127.0.0.1 portal.test
- Go to
C:\wamp64\bin\apache\apache2.4.46\conf\extra\httpd-vhosts.conf
and add the following code snippet at the end of the file. Copy the absolute file path for thepublic
directory of the project and paste it below whereyour_project_path
is written. For example, your project path may look likeC:\wamp64\www\portal\public
.<VirtualHost *:80> ServerName portal.test DocumentRoot "/path/to/your/project" <Directory "/path/to/your/project"> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
- Restart WAMP. Next, open this url in your browser: http://portal.test
- Go to
-
For XAMPP:
-
Go to
C:\WINDOWS\system32\drivers\etc\
and open thehosts
(not the one with ICS extension) file in notepad (run as administrator). Add the following line at the end:127.0.0.1 portal.test
-
Go to
C:\xampp\apache\conf\extra\httpd-vhosts.conf
and add the following code snippet at the end of the file. Copy the absolute file path for thepublic
directory of the project and paste it below whereyour_project_path
is written. For example, your project path may look likeC:\xampp\htdocs\portal\public
.<VirtualHost *:80> ServerName portal.test DocumentRoot "/path/to/your/project" <Directory "/path/to/your/project"> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
-
Restart XAMPP. Next, open this url in your browser: http://portal.test
-
-
For MAMP(macOS):
-
Go to
etc/hosts
file or edit this in the terminal use the following command.sudo nano /etc/hosts
-
Add this line
127.0.0.1 portal.test
-
Go to
httpd.conf
file or edit this file in the terminal itself use this commandsudo nano /etc/apache2/httpd.conf
And search for
vhosts
and uncomment line like this# Virtual hosts # Include /private/etc/apache2/extra/httpd-vhosts.conf
Change above to:
# Virtual hosts Include /private/etc/apache2/extra/httpd-vhosts.conf
-
Open the
vhost
file in the terminalsudo nano /etc/apache2/extra/httpd-vhosts.conf
Add the following line at the end of the file: Copy the absolute file path for the
public
directory of the project and paste it below whereyour_project_path
is written. For example, your project path may look like/Application/MAMP/htdocs/portal/public
.<VirtualHost *:80> ServerName portal.test DocumentRoot "/path/to/your/project" <Directory "/path/to/your/project"> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
-
In case you are using Apache version 2.4 or above, the above code will give you a 403 Forbidden error. Make the following changes:
<Directory> # some code above Order allow,deny Allow from all </Directory>
Change to:
<Directory> # some code above Require all granted </Directory>
-
Restart MAMP. Next, open this url in your browser: http://portal.test
-
-
-
-
Login to the portal using the newly created user in the database. Go to
http://localhost/phpmyadmin/index.php
and search for theusers
table and you can find the user email in it. The default password to log in is12345678
.