Giter Club home page Giter Club logo

booking-app-backend's Introduction

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 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": "[email protected]"
    }
    
  • POST /users

    • Create a new user
    • e.g:
    {
      "username": "user",
      "email": "[email protected]",
      "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.

booking-app-backend's People

Contributors

aboongm avatar melaku05 avatar stevewdamesjr avatar

Stargazers

Roman 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.