Full stack website for users to book developers for a project.
-Ruby -Ruby on Rails -PostgreSQL -Heroku
To get a local copy up and running follow these simple example steps. In your terminal, navigate to your current directory and run this code
git clone https://github.com/Graycemuthui/Book-a-dev.git
Then run:
cd Book-a-dev Open in your preferred text editor. Run code . to open VScode.
This guide assumes you have already installed the necessary dependencies to use a postgreSQL database and Ruby on Rails.
Change the ruby version in your gemfile to the version you have installed on your machine. Add your credentials to the database.yml file.
Run:
bundle install
npm install
rails db:create
rails db:migrate
rails db:seed
foreman start
| Endpoint | Functionality |
To create a new developer, send a POST request to http://localhost:3000/api/v1/developers with the following body:
{ "name": "John Doe", "email": "john@gmail.com", "phone": "08012345678", "city": "Lagos", "bio": "I am a developer", "github": "kell", "photo": "https://res.cloudinary.com/kell/image/upload/v1570628989/developers/developer_1.jpg" }
To create a new booking, send a POST request to http://localhost:3000/api/v1/bookings with the following body:
{ "developer_id": 1, "date": "2019-10-10", "time": "10:00", "city": "Lagos" }
To get all developers, send a GET request to http://localhost:3000/api/v1/developers
The response will be an array of all developers.
` [
{ name: 'Grayce', email: 'grayce@gmail.com', phone: '+23498023432', city: 'Nairobi', bio: 'I am a Javascript developer',
github: 'https://github.com/Graycemuthui', photo: 'https://avatars.githubusercontent.com/u/95374858?v=4' },
{ name: 'Rich', email: 'Rich@gmail.com', phone: '+4343422322', city: 'Ghana', bio: 'I am a Java developer',
github: 'https://github.com/assadounto', photo: 'https://avatars.githubusercontent.com/u/95765079?v=4' },
]`
To get all bookings, send a GET request to http://localhost:3000/api/v1/bookings
The response will be an array of all bookings.
` [
{ developer_id: 1, date: '2021-10-10', time: '10:00', city: 'Nairobi' },
{ developer_id: 2, date: '2021-10-10', time: '10:00', city: 'Nairobi' },
]`
To delete a booking, send a DELETE request to http://localhost:3000/api/v1/bookings/:id
Example :
fetch(
api/v1/bookings/${booking.id}, { method: "DELETE", headers: { "Content-Type": "application/json", }, });
To delete a developer, send a DELETE request to http://localhost:3000/api/v1/developers/:id
Example:
fetch(
/api/v1/developers/${developer.id}, { method: "DELETE", headers: { "Content-Type": "application/json", }, })
👤 K42
- GitHub: @Crystallinebutterfly
- Twitter: @CrystAlline_k42
- Buy me a coffee: K42
👤 MICHAELMUNAVU83
- GitHub: @MICHAELMUNAVU83
- Twitter: @MichaelTrance1
- LinkedIn: @micheal-munavu
👤 GRAYCEMUTHUI
- GitHub: @GrayceMuthui
- Twitter: @Grayce_Muthui
- LinkedIn: @grayce-muthui
👤 RICHMONDADU-KYERE
- GitHub: @assadounto
- Twitter: @adukyerer
- LinkedIn: @richmond-adu-kyere
👤 Said Rašinlić
- GitHub: @SaidRasinlic
- Twitter: @SaidRasinlic
- LinkedIn: @saidrasinlic
The credits of the website design goes to Murat Korkmaz
Give a star if you like this project!
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
This project is MIT licensed.