Melaku05 / booking-app-backend

This app uses a Rails back-end as an API to send doctor details and appointment data to the frontend of a booking application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Booking-app-backend

This app uses a Rails back-end as an API to send doctor details and appointment data to the frontend of a booking application.

Enjoy your API!

Link to Kanban

Group Members

Our group consists of 4 members and we are: @Melaku05 - Team Member #1 @aboongm - Team Member #2 @steveWDamesJr - Team Member #3 @Ismailco - Team Member #4

Link to REACT FRONTEND

REACT FRONTEND

Built With

  • Ruby
  • Ruby on Rails
  • Terminal
  • IRB
  • Rubocop (linters)
  • PostgreSQL

Milestones

Project Requirements - distributed into milestones below:

Booking-app-backend

  • Milestone 1: Setup the project for backend (group task) #1'
  • Milestone 2: Implement devise gem
  • Milestone 3: Rspec test user
  • Milestone 4: Generate table and model for the Doctor (Melaku)
  • Milestone 5: Generate table and model for the Reservation (Ranjit)
  • Milestone 6: Rspec for Reservation (Ranjit)
  • Milestone 7: Rspec for Doctor (Melaku)
  • Milestone 8: Implement Rspec gem (Steve)
  • Milestone 9: Create Documentation (steve)

Booking-app-frontend

  • Milestone 1: Setup the project for the frontend (group task)

  • Milestone 2: Node package manager dependencies (group task)

  • Milestone 3: Create login page (group task)

  • Milestone 4: Create navigation panel (group task)

  • Milestone 5: Create main page (Ranjit)

  • Milestone 6: Create details page (Melaku)

  • Milestone 7: Create Reservation page (Steve)

  • Milestone 8: Create my reservation page (Ismail)

  • Milestone 9: Create the redux store (group task)

  • Milestone 10: Create the doctor reducer (group task)

  • Milestone 11: Create the reservation reducer (group task)

  • Milestone 12: Create the login reducer (group task)

  • Debug linter errors

API Endpoints

Live server: Rswag api documentations

users/ endpoint

  • GET /users/

    • Get the logged in user data
    • returns:
    {
      "id": 1,
      "username": "user",
      "created_at": "2022-08-28T21:31:51.962Z",
      "updated_at": "2022-08-28T21:31:51.962Z",
      "email": "user@email.com"
    }
    
  • POST /users

    • Create a new user
    • e.g:
    {
      "username": "user",
      "email": "user@email.com",
      "password": "password"
    }
    
  • DELETE /users/

    • Logged out the logged in user

doctors endpoint

  • POST /doctors/

    • Create a new doctor
    • e.g:
    {
      "name": "Dr. doc",
      "detail": "Bio",
      "photo": "photo.jpg",
      "city": "London",
      "specialization": "Gynecologist",
      "fee": 100.00
    }
    
  • GET /doctors/

    • Get all doctors
    • returns:
    [{
      "id": 1,
      "name": "Dr. doc",
      "detail": "Bio",
      "photo": "photo.jpg",
      "city": "London",
      "specialization": "Gynecologist",
      "fee": 100.0,
      "created_at": "2022-08-30T10:34:55.953Z",
      "updated_at": "2022-08-30T10:34:55.953Z"
    }]
    
  • GET /doctors/:id

    • Get a doctor by id
    • returns:
    {
      "id": 1,
      "name": "Dr. doc",
      "detail": "Bio",
      "photo": "photo.jpg",
      "city": "London",
      "specialization": "Gynecologist",
      "fee": 100.0,
      "created_at": "2022-08-30T10:34:55.953Z",
      "updated_at": "2022-08-30T10:34:55.953Z"
    }
    
  • DELETE /doctors/:id

    • Delete a doctor by id

reservations endpoint

  • POST /reservations/

    • Create a new reservation
    • e.g:
    {
      "doctor_id": 1,
      "user_id": 1,
      "date": "2022-08-30",
      "city": "London",
    }
    
  • GET /reservations/

    • Get all reservations
    • returns:
    [{
      "id": 1,
      "doctor_id": 1,
      "user_id": 1,
      "date": "2022-08-30",
      "city": "London",
      "created_at": "2022-08-30T10:34:55.953Z",
      "updated_at": "2022-08-30T10:34:55.953Z"
    }]
    
  • GET /reservations/:id

    • Get a reservation by id
    • returns:
    {
      "id": 1,
      "doctor_id": 1,
      "user_id": 1,
      "date": "2022-08-30",
      "city": "London",
      "created_at": "2022-08-30T10:34:55.953Z",
      "updated_at": "2022-08-30T10:34:55.953Z"
    }
    

Getting Started

To get a local copy up and running follow these simple example steps.

Pre-requisites

Make sure you have Ruby and Rails installed on your computer. If not, you can follow this tutorial to install them.

If you don't have PostgreSQL installed, you can follow this tutorial to install it.

Usage

In your terminal, navigate to your current directory and run this code

git clone https://github.com/Melaku05/booking-app-backend.git

Then run:

cd booking-app-backend

Open the project in your favorite code editor. code . for VS Code.

  • Use the command bundle install or just simply bundle to install all project dependencies.
  • Run rails db:create db:migrate to create the database and run migrations.
  • You might need to supply a username and password for your PostgreSQL database if you run into an error with the previous step.
  • Simply navigate to config/database.yml and add your username and password to the username and password fields.

Start terminal

rails s

  • Then click on http://127.0.0.1:3000

Enjoy your fantastic Doctoral bookings as your app opens in the web browser!

Run Linters:

To run rubocop we use:

rubocop

To autocorrect offenses with rubocop we use:

rubocop --auto-correct-all or rubocop -A

Testing

Run Test for models

rspec spec/models

Run Test for views

bundle exec rspec spec/views

Usage

  • Login into Booking App with your username
  • Click on the list of Doctors to see their specific detailed information
  • From Navigation or from details page click 'Reserve' to book an appointment
  • Click from Navigation panel, 'My Reservation' to view a list of your appointment details

Enjoy saving time on long appointment calls by using our top ranking appointment booking App!

Author 1:

πŸ‘€ Melaku Eshetu

Author 2:

πŸ‘€ Ranjit Luwang

Author 3:

πŸ‘€ STEVE W DAMES JR

Author 4:

πŸ‘€ Ismail Courr

🀝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Hat tip to anyone whose code was used
  • Original design idea by Murat Korkmaz on Behance.

πŸ“ License

This project is MIT licensed.

About

This app uses a Rails back-end as an API to send doctor details and appointment data to the frontend of a booking application.


Languages

Language:Ruby 99.7%Language:HTML 0.3%