Coder Social home page Coder Social logo

togettech-llc / education-erp-laravel-8 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mogrady-professional/education-erp-laravel-8

0.0 0.0 0.0 47.52 MB

Education is an ERP System offering a complete school management system with staff, student expenses and report management functionality. The Application is built in Laravel 8 and is a complete end-to-end CMS (Content Management System) and is highly customizable. The initial project is a starter project with lots of room for improvement in terms of features and functionality that can be built upon. Multi authentication system built using Laravel Jetstream with User and Admin logins.

Home Page: https://education-erp.herokuapp.com/

License: MIT License

Shell 0.12% Python 0.99% PHP 6.44% CoffeeScript 2.80% Hack 0.02% Makefile 0.04% HTML 77.26% Handlebars 0.24% Blade 8.74% Less 3.36% Procfile 0.01%

education-erp-laravel-8's Introduction

Education ERP System - Laravel 8 CMS Project


Introduction

Education is an ERP System offering a complete school management system with staff, student expenses and report management functionality. The Application is built in Laravel 8 and is a complete end-to-end CMS (Content Management System) and is highly customizable. The initial project is a starter project with lots of room for improvement in terms of features and functionality that can be built upon. Multi authentication system built using Laravel Jetstream with User and Admin logins.

Link to Project

Hosted on Heroku on a ClearDB MySQL Database, using JetBrains DataGrip to connect to the database.

Developer Notes

Prior to deploying the application the following considerations need apply.

  • Configuration Caching
    • To give your application a speed boost, you should cache all of your configuration files into a single file using the config:cache Artisan command. This will combine all of the configuration options for your application into a single file which can be quickly loaded by the framework. See here
    • Run:
      • php artisan config:cache
  • Application cache
    • The application cache is the primary cache in Laravel. It stores everything that you manually cache in your application. You can clear only specific elements of the cache if you use tags or different cache stores. The easiest way to clear the Laravel cache is via artisan:
    • Run:
      • php artisan cache:clear
  • View cache
    • Another part of the application that has a cache is the view cache. The view cache stores rendered Blade templates to speed up your application. You can manually render all views to increase the performance by using the artisan command for it:
    • Run:
      • php artisan view:clear

Instructions to run project locally

  1. Download/Clone Project
  2. Run composer install within the project directory to install dependencies for the project (ensure composer is installed on your system)
  3. Create the education_erp database within phpMyAdmin Panel
  4. Run php artisan migrate:fresh to migrate the database
  5. Rename env.example to .env (sample environment variables for Laravel) and populate with your details:
    1. Set up a mailtrap account to enable reset password, and confirm account functionality. Required Step.
    2. Populate the file with the details from your mailtrap account.
  6. Run php artisan serve to starting a Laravel development server on http://127.0.0.1:8000
  7. Create an account
    1. Go into the phpMyAdmin panel and assign a usertype of Admin to your user record.

Routes

  • Login to Dashboard http://127.0.0.1:8000

Deploying on a Server

  • Compress the project folder by adding to a .zip directory for uploading to the server and extracting.
  • Create a MySQL database with your hosting provider and import the education_erp.sql file to create the tables and populate the data.
  • Update the database configuration in the .env file (e.g. database name, username, password etc.)
  • Errors?
    • Specified key was too long?:
    • HTTPS Errors?

Update the following in AppServiceProvider.php the code should be self explainatory.

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\URL;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
        Schema::defaultStringLength(191);
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        if(config('app.env') === 'production') {
            URL::forceScheme('https');
        }
    }
}

Deploying on Heroku

Credentials for this project are redacted for security reasons. Step-by-step instructions below.

Prepare Git

  • git init
  • git add .
  • git commit -m "new laravel project"

Create a Procfile

This is required to tell Heroku where to serve the project from. i.e. with Laravel this must be from the public folder.

  • echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
  • git add .
  • git commit -m "Procfile for Heroku"

Create Application

  • heroku create
    • Set a Laravel encryption key
      • php artisan key:generate --show
      • heroku config:set APP_KEY=<your_app_key_goes_here>
  • Deploy
    • git push heroku master

Set up Database

  • Configure Add-ons
    • Select ClearDB MySQL
      • This will generate a MySQL database and generate credentials (connection string with database name, username, password) in Config Vars (CLEARDB_DATABASE_URL)

Config Vars

Key Value
APP_KEY <your_app_key_goes_here>
CLEARDB_DATABASE_URL <automatically_generated>
APP_DEBUG False
DB_CONNECTION mysql
DB_DATABASE <database_name_goes_here>
DB_HOST <host_goes_here>
DB_PASSWORD <password_goes_here>
DB_PORT 3306
DB_USERNAME <username_goes_here>
APP_ENV production

Migrate the Tables

  • Settings
    • Run Console
      • php artisan migrate:fresh

Connect to the Database

Use a tool such as DataGrip by JetBrains to connect to the Database remotely.

  • Create a user through the Admin Panel Login
    • Update the record in the database and add Admin to the usertype field in the record to access admin features.

Enforcing HTTPS for Production

  • Within AppServiceProvider.php inside the boot function add the following
use Illuminate\Support\Facades\URL;

    public function boot()
    {
        //
        if(config('app.env') === 'production') {
            URL::forceScheme('https');
        }
    }

Setting the Default String Length

If errors occur, add the following to the register function within the same file:

use Illuminate\Support\Facades\Schema;
    public function register()
    {
        //
        Schema::defaultStringLength(191);
    }

education-erp-laravel-8's People

Contributors

mogrady-professional avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.