Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”₯ Changes Required : Checked :check #43

Merged
merged 14 commits into from
Jun 22, 2023
Merged
82 changes: 43 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<a name="readme-top"></a>

<details>
<summary>Table of Contents</summary>

Expand All @@ -8,26 +9,26 @@
- [πŸ“‹ Kanban Board](#-kanban-board)
- [Kanban Board.](#kanban-board)
- [The members: @Salwa, @Ahmed, @Talha](#the-members-salwa-ahmed-talha)
- [Tech Stack ](#tech-stack--)
- [✨ Key Features ](#-key-features--)
- [πŸ“˜ Getting Started ](#-getting-started--)
- [Tech Stack ](#tech-stack--)
- [✨ Key Features ](#-key-features--)
- [πŸ“˜ Getting Started ](#-getting-started--)
- [πŸ“‹ Prerequisites](#-prerequisites)
- [Setup ](#setup-)
- [πŸ“₯ Installation](#-installation)
- [πŸ’Ύ Database](#-database)
- [πŸ’» Usage](#-usage)
- [πŸ§ͺ Tests](#-tests)
- [πŸ‘¨β€πŸ’» Authors ](#-authors--)
- [πŸ‘¨β€πŸ’» Authors ](#-authors--)
- [πŸ‘€ **Salwa Ballouti**:](#-salwa-ballouti)
- [πŸ‘€ **Ahmed Hasan Rony**](#-ahmed-hasan-rony)
- [πŸ‘€ **Muhammad Talha Hanif**](#-muhammad-talha-hanif)
- [🎯 Future Features ](#-future-features--)
- [🎯 Future Features ](#-future-features--)
- [πŸ™ Acknowledgements](#-acknowledgements)
- [πŸ’Ž Resources](#-resources)
- [🀝 Contribution ](#-contribution--)
- [πŸ’– Show Your Support ](#-show-your-support--)
- [🀝 Contribution ](#-contribution--)
- [πŸ’– Show Your Support ](#-show-your-support--)
- [πŸ“œ License ](#-license-)
</details>
</details>

# πŸš— RENTCAR - Luxury cars renting platform <a name="about-project"></a>

Expand All @@ -43,59 +44,54 @@
<img src="https://github.com/roniy68/capstone-rails/assets/77187003/f2359c19-0684-4b01-97b2-66236afa374c" width=400 height=250 alt="screenshot" />
</p>


<p align="right">(<a href="#readme-top">back to top</a>)</p>


## πŸš€ Live Demo

[RENTCAR-Luxury Cars](https://capstone-rails.onrender.com/)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## πŸ“‹ Kanban Board
## πŸ“‹ Kanban Board

We have used a Kanban board to split the tasks and simplify the project workflow.

### [Kanban Board](https://github.com/roniy68/capstone-rails/projects/1).

### The members: [@Salwa](https://github.com/Salwa99), [@Ahmed](https://github.com/roniy68), [@Talha](https://github.com/Talha-Hanif5666)


<img src="https://github.com/roniy68/capstone-rails/assets/77187003/bdb6c83b-1e4c-4d1b-98ed-cf28d59ed7f2" width=600 height=400 alt="kanban board" />

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Tech Stack <a name="tech-stack"></a>

- **Back-end** πŸ’»:
<details>
<summary>Client</summary>
<ul>
<li><a href="https://rubyonrails.org/">Ruby on Rails</a></li>
<li><a href="https://redux-toolkit.js.org/">PostgreSQL</a></li>
</ul>
</details>
## Tech Stack <a name="tech-stack"></a>

- **Front-end** πŸ’»:
- **Back-end** πŸ’»:
<details>
<summary>Client</summary>
<ul>
<li><a href="https://react.dev/">React</a></li>
<li><a href="https://redux-toolkit.js.org/">Redux Toolkit</a></li>
<li><a href="https://reactrouter.com/en/main">React Router</a></li>
<li><a href="https://tailwindcss.com/">Tailwind</a></li>
<li><a href="https://reactrouter.com/en/main">React icons</a></li>
<li><a href="https://rubyonrails.org/">Ruby on Rails</a></li>
<li><a href="https://redux-toolkit.js.org/">PostgreSQL</a></li>
</ul>
</details>
</details>

- **Front-end** πŸ’»:
<details>
<summary>Client</summary>
<ul>
<li><a href="https://react.dev/">React</a></li>
<li><a href="https://redux-toolkit.js.org/">Redux Toolkit</a></li>
<li><a href="https://reactrouter.com/en/main">React Router</a></li>
<li><a href="https://tailwindcss.com/">Tailwind</a></li>
<li><a href="https://reactrouter.com/en/main">React icons</a></li>
</ul>
</details>

- **Tools** πŸ› :
- **Tools** πŸ› :
- [Rspec](https://rspec.info/)
- [Esbuild](https://esbuild.github.io/)
- [Render](https://render.com/)


<details>
<summary>Linter</summary>
<ul>
Expand All @@ -107,7 +103,7 @@ We have used a Kanban board to split the tasks and simplify the project workflow

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## ✨ Key Features <a name="key-features"></a>
## ✨ Key Features <a name="key-features"></a>

- **Log in with a username to access the palteform.**
- **Browse list of available cars.**
Expand All @@ -118,13 +114,14 @@ We have used a Kanban board to split the tasks and simplify the project workflow

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## πŸ“˜ Getting Started <a name="getting-started"></a>
## πŸ“˜ Getting Started <a name="getting-started"></a>

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

### πŸ“‹ Prerequisites

Make sure you have the following installed on your machine:

- [Ruby 3.1.3 or higher](https://www.ruby-lang.org/en/)
- [Rails 7.0.4 or higher](https://rubyonrails.org/)
- [PostgreSQL 15.2 or higher](https://www.postgresql.org/)
Expand All @@ -143,6 +140,7 @@ Clone this repository to your desired foler.
```

### πŸ“₯ Installation

Install the required gems with:

```sh
Expand All @@ -155,6 +153,8 @@ Install the node dependencies with:
yarn install
```

or

```sh
npm install
```
Expand Down Expand Up @@ -187,19 +187,21 @@ To run the project, execute the following command:
```sh
./bin/dev
```

### πŸ§ͺ Tests

To run tests, run the following command:

```sh
rspec spec
rspec spec
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## πŸ‘¨β€πŸ’» Authors <a name="author"></a>
## πŸ‘¨β€πŸ’» Authors <a name="author"></a>

### πŸ‘€ **Salwa Ballouti**:

- GitHub: [@Salwa99](https://github.com/Salwa99)
- Twitter: [@SalwaBallouti](https://twitter.com/salwa_ballouti)
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/salwa-ballouti)
Expand All @@ -218,7 +220,7 @@ rspec spec

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## 🎯 Future Features <a name="future-features"></a>
## 🎯 Future Features <a name="future-features"></a>

- [ ] Implement the full authentication.
- [ ] Implement edit car or reservation.
Expand All @@ -228,7 +230,7 @@ rspec spec

## πŸ™ Acknowledgements

This app was designed based on an original design idea by [Murat Korkmaz](https://www.behance.net/muratk) on Behance.
This app was designed based on an original design idea by [Murat Korkmaz](https://www.behance.net/muratk) on Behance.
We would like to thank Murat Korkmaz for this inspiring design.

- [App Design Template](https://www.behance.net/gallery/26425031/Vespa-Responsive-Redesign)
Expand All @@ -238,20 +240,22 @@ We would like to thank Murat Korkmaz for this inspiring design.
## πŸ’Ž Resources

🎨 **Colors**

- 🟒 Accent: #96bf01

πŸ–Œ **Fonts**

- Normal: [Roboto](https://fonts.google.com/specimen/Roboto)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## 🀝 Contribution <a name="contribution"></a>
## 🀝 Contribution <a name="contribution"></a>

Contributions, issues, and feature requests are welcome!

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## πŸ’– Show Your Support <a name="support"></a>
## πŸ’– Show Your Support <a name="support"></a>

If you like this project, please consider giving it a ⭐.

Expand Down
12 changes: 6 additions & 6 deletions app/javascript/components/fragments/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react'
import Sidebar from './Sidebar'
import { Outlet, useNavigate } from 'react-router-dom'
// import NavBar from './NavBar'
import { HiOutlineMenu, HiAnnotation, HiBell, HiOutlineUser } from 'react-icons/hi'
import { HiOutlineMenu, HiAnnotation, HiOutlineUser } from 'react-icons/hi'
import { AiOutlineLogout } from "react-icons/ai";

const Layout = () => {
const [show, setShow] = useState(true)
const [show, setShow] = useState(false)

const handleClick = (e) => {
setShow(current => !current)
Expand Down Expand Up @@ -41,19 +41,19 @@ const Layout = () => {
<div className="flex bg-[#96bf01] lg:h-[80px] md:h-[60px] p-4 sticky top-0 z-10 items-center justify-between">
{/* Navbar Ham burger */}
<div onClick={handleClick} className='flex-none text-white'>
<HiOutlineMenu size={36} />
<HiOutlineMenu size={30} />
</div>
{/* Navbar Menus */}
<div className='flex text-slate-50 justify-end flex-auto gap-2'>
<div className='p-6'>
<HiAnnotation size={36} />
<HiAnnotation size={30} />
</div>
<div className='p-6'>
<HiOutlineUser size={36} />
<HiOutlineUser size={30} />
</div>

<div className='p-6'>
<AiOutlineLogout size={36} onClick={handleLogout} />
<AiOutlineLogout size={30} onClick={handleLogout} />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/fragments/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Sidebar = () => {
{links.map((link) => (
<Link to={link.url}>
<li
className={`p-4 ml-6 mb-4 text-[20px] lg:text-[30px] rounded-md ${
className={`p-4 ml-6 mb-4 text-[15px] lg:text-[25px] rounded-md ${
location.pathname === link.url
? "bg-[#96bf01] text-white"
: "hover:bg-[#96bf01] hover:text-white"
Expand Down
15 changes: 9 additions & 6 deletions app/javascript/components/fragments/navigation/AddCar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const AddCar = () => {

if (response.ok) {
const newCar = await response.json();
console.log("New car added:", newCar);

setCarData({
name: "",
Expand All @@ -72,9 +71,14 @@ const AddCar = () => {
};

return (
<div className="flex flex-col items-center justify-center h-screen">
{carAdded && <p className="bg-green-200 font-bold mb-6 p-4 rounded shadow-lg">New car has been added!</p>}
<div className="h-auto lg:w-[800px] w-[600px] p-6 bg-slate-300 rounded-lg shadow-lg">
<div className="flex flex-col items-center justify-center">
{carAdded && (
<p className="bg-green-200 font-bold mb-6 p-2 rounded shadow-lg">
New car has been added!
</p>
)}
<div className="h-auto w-auto lg:w-[800px] p-6 bg-slate-300 rounded-lg shadow-lg">
<h1 className="text-center text-[25px] font-bold mb-6">Add Car</h1>
<form onSubmit={handleSubmit} className="space-y-4 shadow">
<div>
<label htmlFor="name" className="block mb-1">
Expand Down Expand Up @@ -139,7 +143,6 @@ const AddCar = () => {
onChange={handleChange}
className="w-full border border-gray-300 rounded px-3 py-2"
/>

</div>
<div className="flex justify-center items-center">
<button
Expand All @@ -155,4 +158,4 @@ const AddCar = () => {
);
};

export default AddCar;
export default AddCar;
56 changes: 30 additions & 26 deletions app/javascript/components/fragments/navigation/AllCars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,41 +61,45 @@ const AllCars = () => {
return cars
.slice(startIndex, endIndex + 1)
.map((car) => (
<li key={car.id} className="flex items-center space-x-4 py-4" style={{ transform: "scale(1.7)", marginTop: "60px" }}>
<Link to={`/detail/${car.id}`} className="flex-shrink-0">
<img
src={car.photo}
alt={car.name}
className="w-20 h-20 object-cover rounded p-2"
/>
</Link>
<div className="flex-grow">
<p>
{car.name} - {car.model}
</p>
</div>
<button
type="button" onClick={() => handleDelete(car.id)}
className="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-sm text-sm float-right "
>
Delete Car
</button>
</li>


));
<li
key={car.id}
className="flex items-center space-x-4 py-4 sm:max-w-600px mx-auto"
style={{ marginTop: "60px" }}
>
<Link to={`/detail/${car.id}`} className="flex-shrink-0">
<img
src={car.photo}
alt={car.name}
className="w-24 h-24 lg:w-52 lg:h-auto object-cover rounded p-2"
/>
</Link>
<div className="flex-grow text-center ml-6">
<p className="text-xl my-2">
{car.name} - {car.model}
</p>
</div>
<div>
<button
type="button"
onClick={() => handleDelete(car.id)}
className="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-sm text-lg"
>
Delete
</button>
</div>
</li>
));
};

return (
<div className="flex flex-col items-center w-300px">
<div className=" flex flex-1 flex-col p-6 items-center w-auto ">
<div>
<h1 className="flex items-center justify-center font-bold mt-10 text-5xl">
ALL CARS
</h1>
<p className="text-3xl">Please press the Delete button to delete cars</p>
</div>

<div>
<div className=" w-auto lg:w-[800px]">
<ul>{renderCars()}</ul>
</div>
</div>
Expand Down
Loading