Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

alexstojda/soen344

Repository files navigation

Bon Matin - SOEN 344

Basically a walk-in clinic appointment reservation web app.

Installation

Pre-requisites

  • composer executable
  • yarn & npm, ps: we'll use yarn
  • A MySQL DB & Apache. Use any XAMPP like service I recommended laragon on pc or valet/valet on mac
  • PHP >= 7.1.3, preferable 7.2
  • PHP extensions you might not have be default: bcmath
  • xdebug is always a plus

First Setup Steps

  1. once you clone the repo run composer reset, it will run a batch of the starter commands.
  2. Open the .env and configure it to work with what you need, namely the DB connection
  3. Create a mysql database matching the connection details in your .env
  4. Create the db schema and seed it with random values with composer mfs
  5. verify your setup is functional with alias composer diag or the actual command php artisan self-diagnosis
  6. Access the web app through your preferred local web server setup (I like valet on macs & laragon on PC, ghetto way: php artisan serve manual MySQL install)

Bonus Commands

  • When you see DB issues run php artisan migrate:fresh --seed (composer mfs for short) to quickly recreate the db tables and seed it with random data
  • If you just need more random data in the db run php artisan db:seed.
  • When everything goes to hell run composer fix or composer install:hard if you don't want to rerun migrations
  • Regenerate the frontend resources with composer frontend (requires yarn) if you're working with vue or scss
  • yarn dev or yarn watch for frontend dev build, watcher will recompile when files are changed.

Usage

Website

Open the site, select one of the different login types. (Only Doc/Nurse work for now)

API

Look at the api route group in the routes/web.php file for a quick view of whats available at the moment. I heavily use Postman since I haven't redone much UI yet, holler at me if you want a copy of my half-baked collection.

Console

Tinker is the primary tool for testing queries, php logic, and debugging weird code, basically your best friend. Open with php artisan tinx. Its an interactive repl php shell that makes it easy to test stuff like observer creation rules without having to build out the Resource/Model Controller.

Currently best way to test CRUD functionality for Milestone#1 features

Design Patterns

Laravel Patterns (aka stuff we mostly use but didn't write)

Accidentally found book on laravel design patterns.

  • Builder Pattern ex: Database Manager aka driver support
  • Factory Pattern
  • Repository Pattern
  • Publisher/Subscriber Pattern
  • Dispatcher Pattern
  • Strategy Pattern ex: config loader, encrypt/decrypt, session
  • Provider Pattern ex: Auth or App where we register observers
  • Iterator Pattern Collections
  • Facade Pattern
  • Singleton Pattern
  • Observer pattern
  • Dispatcher Pattern events system
  • Inversion Of Control / Dependency Injection Patterns ex: we use it to automatically find models in controllers
  • Command Pattern ex: migrations
  • SOLID patterns
  • MVC pattern

Patterns we implemented on our own

  • Factory Pattern exposed to dev, used by our seeders, view()
  • Provider Pattern ex: Auth or App where we register observers
  • Observer pattern ex: appointment on save rules
  • Dispatcher Pattern ex: email notification code
  • Command pattern setup command to check appointments and set to complete if end time has passed
  • SOLID Patterns (just need to give examples)
  • Domain Driven Design
  • Builder Pattern extend Support/Manager
  • Repository Pattern easy to implement, abstract eloquent models
  • Service Pattern ex: we can make a booking engine service
  • Facade Pattern ex: provided by laravel for easy service access

Resources

We'll be using laravel and vue.js for this project and a good place to start learning all of this scary new tech is Laracasts, specifically the laravel from scratch series & Vue 2 Step by step Here are some more resources you might want to take a look at :

Documentation

Get good at laravel

Vue.js

  • Vue
  • Remind me to add more if you need any

Architecture and Design Inspiration

Laravel Best Practices and Design Pattern Resources

Bonus

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published