Skip to content

living-opensource-africa/los-community

Repository files navigation

Living Open Source Africa Community


As a way of fostering Open Source adoption in Africa, the Living Open Source Community is working towards building a unified platform for sharing resources and providing remote online training and events.


TABLE OF CONTENTS

REQUIREMENTS

  • PHP 7.x.x

PHP Modules required

Modules (cli, curl, mbstring, pdo, mysql, gd, zip, xml, json,bcmath, ctype, dom, xml, openssl, tokenizer, zip)

  • MySQL/MariaDB

  • Composer

  • NodeJS

  • Git

To install NodeJs,Git and MariaDB, run the following

$ sudo apt install mariadb-server nodejs git -y

SETUP

Start by cloning this repository on your local machine

$ cd ~/my_projects_folder
$ git clone https://github.com/living-opensource-zambia/los-community.git

Change into the repository.

$ cd los-community

At this stage, you should have composer installed, if you do not have composer. Do the following:

$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
$ php -r "unlink('composer-setup.php');"

Inside of the los-community directory, install laravel dependencies by typing:

$ composer install

After installation of all dependenies, then copy .env.example file into .env, e.g:

$ cp .env.example .env

Then generate a laravel key by typing:

$ php artisan key:generate

Then create an empty database and give it a name. For this example we have used los_community as our database name:

$ mysql -u username -p
....
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE los_community;

After creating the database, setup laravel to access your database from the .env file by setting up the following parameters.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=los_community
DB_USERNAME=root
DB_PASSWORD=password

You also need to setup emails and password to be used for the dummy users to be generated by the seeder.

ADMIN_EMAIL="[email protected]"
MEMBER_EMAIL="[email protected]"
STUDENT_EMAIL="[email protected]"
DEFAULT_PASSWORD="loss-community@home"

The above parameters are used in generating seeds in UserDataSeeder.php.

To populate your database, run the migrations with the seed option:

$ php artisan migrate:fresh --seed

Install the node dependencies, with the following command:

$ npm install

After that is done, you are ready to roll.

Run the two development servers, i.e laravel & npm by typing:

Not Run these in separate terminals

Terminal 1:

$ npm run watch

Terminal 2:

$ php artisan serve

You are all set now 😂

LICENSE

This project is ditributed under the MIT Open Source Licence, as documented here.