This is an e-commerce shop application built with Ruby on Rails. It allows users to sign up, log in, create product ads, and manage a shopping cart. Guest users can add items to the cart, and their cart persists when they sign up or log in.
- User Authentication:
- Sign up, log in, and log out.
- Edit user profile (name, email, password).
- Product Management:
- Create, edit, and delete product ads.
- Add images to products.
- Shopping Cart:
- Add/remove items to/from the cart.
- View cart total.
- Empty the cart.
- Guest users can add items to the cart, and their cart persists after signing up or logging in.
- Ruby: 3.4.1
- Rails: 8.0.1
- Database: SQLite3
- Authentication: Devise
- File Uploads: Active Storage
- Frontend: HTML, CSS, ERB
git clone https://github.com/stkisengese/e-shop.git
cd e-shop- Install Dependencies
bundle install- Set Up the Database
rails db:create
rails db:migrate
rails db:seed- Start the Server
rails sVisit http://localhost:3000 in your browser.
# Build the development image
docker build -t myapp-dev -f .docker/Dockerfile.dev .
# Run the container
docker run -it --rm \
-v $(pwd):/rails \
-v bundle:/usr/local/bundle \
-p 3000:3000 \
myapp-devSign Up
Visit /users/sign_up to create a new account.
Log In
Visit /users/sign_in to log in.
Create a Product Ad
Log in and click "Sell" to create a new product ad.
Manage Cart
Add items to the cart as a guest or logged-in user.
View your cart at /cart.
Remove items or empty the cart.
User Authentication:
Sign up: /users/sign_up
Log in: /users/sign_in
Log out: /users/sign_out
Products:
List products: /products
Create product: /products/new
Show product: /products/:id
Edit product: /products/:id/edit
Cart:
View cart: /cart
Add item: /cart/add_item/:product_id
Remove item: /cart/remove_item/:product_id
Empty cart: /cart
Fork the repository.
Create a new branch (git checkout -b feature/your-feature).
Commit your changes (git commit -m 'Add some feature').
Push to the branch (git push origin feature/your-feature).
Open a pull request.
This project is licensed under the MIT License.
Devise for authentication.
Active Storage for file uploads.
Rails Guides for documentation.
For questions or feedback, please contact Stephen Kisengese.