Code Monkey home page Code Monkey logo

appointment's Introduction

About Appointment

Build the backend of an api to manage users and appointments.

During covid, my dentist office specifically kept calling me to change appointments- It made me wonder how things are done from their end and how to possibly make the experience better overall.

This api is specifically for a dentist’s office to help manage their database.

If you would like to follow along in the series - The playlist link for this video can be found here

Tech stack

- Laravel/PHP
- SQL

Project setup

  • Create .env file

    • This should be a replica of the .env.example except:
    • DB_DATABASE=appointment
    • DB_USERNAME=root
    • DB_PASSWORD= NOTE: Password and Username is whatever you set it to. To login to mysql in the command line type in this command: mysql -u root -p
  • Laravel valet

    • If you do not have Laravel Valet installed, follow the instructions here
      TL/DR
      • brew update
      • brew install php
      • Install composer here
      • composer global require laravel/valet. Be sure the ~/.composer/vendor/bin directory is in your system's "PATH".
      • valet install
    • Directions to serve the site (https://laravel.com/docs/6.x/valet#serving-sites):
      TL/DR
      • In your terminal, make a new directory for the project:
        • mkdir ~/Code
        • cd ~/Code
        • run valet park
    • Fork or clone project here into ~/Code directory: appointment api
    • Once project is cloned, spin up the website at appointment.test/api/users
  • MySQL

    • brew install mysql

    • brew services start mysql

    • Once valet and project has been cloned locally, run composer install

How to view api

Use Postman install here or browser to visit api route - Example route to visit Get all users

How to run Test

  • Initialise the database seeder by running the command: php artisan db:seed
  • Remove all tables and add new data: php artisan migrate:fresh --seed

If you need to make changes to the database:

  • Run the command: php artisan migrate:fresh --seed
  • Make your changes
  • Then run the command php artisan db:seed and confirm your changes in the database.

appointment's People

Contributors

dependabot[bot] avatar manjunathrk1251 avatar tthompson899 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

appointment's Issues

Only schedule appointments every half hour in Test

Currently, you can schedule an appointment for any minute, this should be adjusted to only schedule an appointment for every 30 minutes.
Ex. 8:00 AM, 8:30 AM, 4:00 PM, 4:30 PM

Additional Details

This fix should be within the test. Within the ModelFactory.php file there is an appointment seeder:

    return [
        'user_id' => rand(User::first()->id, User::count()),
        'type_id' => rand(Type::first()->id, Type::count()),
        'date_of_appointment' => $faker->dateTimeBetween('2020-10-20', '+2 years', 'America/Chicago'),

The date_of_appointment should be adjusted to include dates that are in 30 minute increments.

How to run Test

To run initial database seeder: php artisan db:seed
Once you make changes run the command again (php artisan db:seed) to confirm changes in database
To remove tables and add new data: php artisan migrate:fresh --seed

Update dependencies

There are some dependencies that are in package-lock.json file that should be updated. Below is the screenshot that should be updated:
Screen Shot 2021-10-02 at 9 25 31 PM

Add testing notes to ReadMe

In the readme file, after the How to Setup and before the How to view api section - Add the testing section.
I have included the format for the testing section below:

How to run Test

To run initial database seeder: php artisan db:seed
To remove tables and add new data: php artisan migrate:fresh --seed
If you make changes run the command again (php artisan db:seed) to confirm changes in database

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.