Hospital Information System Documentation

Deployment

This section outlines the steps required to deploy the Hospital Information System.

General Deployment Steps

These are the general steps for deploying the application to a server. Specific commands and configurations may vary depending on your server environment.

Prerequisites:

Deployment Process:

  1. Clone the repository:
    git clone https://github.com/BilalSwl6/react-hospital.git
  2. Install PHP dependencies:
    composer install --no-dev
  3. Install JavaScript dependencies:
    npm install
    or
    yarn install
  4. Build front-end assets:
    npm run build
    or
    yarn build
  5. Set up environment file: Copy the .env.example file to .env and configure your database credentials and other environment variables.
    cp .env.example .env
  6. Generate application key:
    php artisan key:generate
  7. Run database migrations:
    php artisan migrate --force
  8. Run database seeders (optional):
    php artisan db:seed --force
  9. Configure your web server: Point your web server's document root to the public directory of your application. Ensure that the necessary rewrite rules are configured for clean URLs.
  10. Set correct file permissions: Ensure that the storage and bootstrap/cache directories are writable by your web server.
  11. Configure cron jobs (if needed): Set up cron jobs for scheduled tasks (e.g., database backups).

Heroku Deployment

Heroku provides a platform-as-a-service that simplifies deployment. Follow these steps to deploy to Heroku:

Prerequisites:

Deployment Process:

  1. Log in to Heroku:
    heroku login
  2. Create a new Heroku app:
    heroku create <app-name>
  3. Add a buildpack: Heroku needs to know how to build your PHP application. You can use the official Heroku PHP buildpack.
    heroku buildpacks:add heroku/php
    heroku buildpacks:add heroku/nodejs
    heroku buildpacks:add https://github.com/heroku/heroku-buildpack-apt
  4. Provision a database (e.g., Heroku Postgres):
    heroku addons:create heroku-postgresql:<plan>
  5. Set environment variables: Configure your database credentials and other environment variables using the Heroku CLI or the Heroku dashboard.
    heroku config:set APP_KEY=<your_app_key> DB_CONNECTION=<your_db_connection> DB_HOST=<your_db_host> ...
  6. Push your code to Heroku:
    git push heroku main
  7. Run database migrations on Heroku:
    heroku run php artisan migrate --force
  8. Run database seeders on Heroku (optional):
    heroku run php artisan db:seed --force
  9. Scale your web dynos:
    heroku ps:scale web=1
  10. Configure scheduler (if needed): Use the Heroku Scheduler add-on to run scheduled tasks.

Refer to the Heroku Dev Center for more detailed information on deploying Laravel applications.