Setting Up Environment

So you're interested in developing openClinic? Well you've come to the right place. Follow the guide below to setup your environment for developing openClinic.

🚧

Warning!

Using a non-tagged release or the master branch may result in an unstable or broken environment.

Make sure to meet the prerequisites before proceeding.

Download the source code with Git

📘

Check out the latest version!

The tags below are examples of what will be shown. You should always run git checkout on the latest tag.

cd /var/www/
git clone https://github.com/StrixTech/openclinic.git
cd openclinic
git tag -l

v0.1.0
v0.2.0
v0.3.0
...

git checkout v0.1.0

Configuring a database

By default openClinic comes with a .env.example file. You'll need to rename this file to just .env regardless of what environment you're working on.

It's now just a case of editing this new .env file and setting the values of your setup.

📘

Environment Configuration Notice

Any values with spaces in them should be contained within double quotes.

APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

Install Composer

You can use the following terminal command or you can install Composer using instructions from here

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

After installing Composer, run the following command to install openClinic dependencies. This is going to take a few minutes.

composer install
npm install

Set the application key

Before going any further, we need to set the APP_KEY config. This is used for all encryption used in openClinic.

php artisan key:generate

Installation Commands

Currently, openClinic does not have an automatic installer or a simple command to run all the migrations, seeds, and asset management. We recommend getting some help if you haven't worked with Laravel before. You can contact us through Slack.

php artisan migrate
php artisan db:seed

❗️

Never change the APP_KEY after installation on production environment. This will result in all of your encrypted/hashed data being lost.

🚧

Getting a 500 - Internal Server Error?

If you get a 500 error when visiting your status page, you may need to run chmod -R 777 storage for it to work or rm -rf bootstrap/cache/*. You can also try to give permissions to cache chmod -R 777 bootstrap/