Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (131)
Showing with 395 additions and 23 deletions
MYSQL_ROOT_PASSWORD=
MYSQL_HOST=db-tubes-1
MYSQL_DATABASE=tubeswbd
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_PORT=3306
\ No newline at end of file
.env
\ No newline at end of file
FROM php:8.0-apache
\ No newline at end of file
FROM php:8.0-apache
WORKDIR /var/www/html
COPY src/public/index.php .
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN a2enmod rewrite
RUN apt-get -y update && apt-get -y upgrade
EXPOSE 80
\ No newline at end of file
## Panduan Pengerjaan
Berikut adalah hal yang harus diperhatikan untuk pengumpulan tugas ini:
1. Buatlah grup pada Gitlab dengan format "IF3110-2023-01-XX", dengan XX adalah nomor kelompok (untuk K1 dan K2) atau kode kelompok (untuk K3).
2. Tambahkan anggota tim pada grup anda.
3. **Fork** pada repository ini dengan organisasi yang telah dibuat.
4. Ubah hak akses repository hasil Fork anda menjadi **private**.
5. Hal-hal yang harus diperhatikan.
* Silakan commit pada repository anda (hasil fork)
* Lakukan beberapa commit dengan pesan yang bermakna, contoh: “add register form”, “fix logout bug”, jangan seperti “final”, “benerin dikit”, “fix bug”.
* Disarankan untuk tidak melakukan commit dengan perubahan yang besar karena akan mempengaruhi penilaian (contoh: hanya melakukan satu commit kemudian dikumpulkan).
* Commit dari setiap anggota tim akan mempengaruhi penilaian.
* Jadi, setiap anggota tim harus melakukan commit yang berpengaruh terhadap proses pembuatan aplikasi.
* Sebagai panduan bisa mengikuti [semantic commit](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716).
6. Buatlah file README yang berisi:
* Deskripsi aplikasi web
* Daftar requirement
* Cara instalasi
* Cara menjalankan server
* Screenshot tampilan aplikasi (tidak perlu semua kasus, minimal 1 per halaman), dan
* Penjelasan mengenai pembagian tugas masing-masing anggota (lihat formatnya pada bagian pembagian tugas).
# Kinokuniya: Digital Audiobook Store
> Made as a Web Development course project by Bandung Institute of Technology Informatics Engineering Major, 2023.
Welcome to Kinokuniya's Digital Audiobook Store, where the world of literature comes to life through the power of sound. Dive into a captivating realm of storytelling as we bring you an extensive collection of digital audiobooks that will transport you to different worlds, ignite your imagination, and provide a rich auditory experience like no other.
Explore our vast library of audiobooks spanning various genres, from gripping thrillers to heartwarming romance, from mind-bending science fiction to inspiring self-help titles. Whether you're a seasoned audiobook enthusiast or new to the world of spoken-word literature, Kinokuniya's Digital Audiobook Store has something for everyone.
With our easy-to-use platform, you can browse, discover, and purchase your favorite audiobooks with just a few clicks. Our audiobooks are narrated by talented voices that bring characters to life and immerse you in the narrative, making it a perfect companion for your daily commute, a lazy afternoon, or any moment when you want to lose yourself in a great story.
# Requirements
- [HTML5](https://www.w3schools.com/html/)
- [CSS3](https://www.w3schools.com/css/)
- [JavaScript](https://www.w3schools.com/js/)
- [PHP](https://www.php.net/)
- [MySQL](https://www.mysql.com/)
- [Docker](https://www.docker.com/)
# Installation
1. Clone this repository
```bash
$ git clone https://gitlab.informatika.org/if3110-2023-01-06/tugas-besar-1.git
```
2. Change directory to the cloned repository
```bash
$ cd tugas-besar-1
```
3. Create a `.env` file
```bash
$ cp .env.example .env
```
4. Open the `.env` file and complete the following lines
```bash
MYSQL_ROOT_PASSWORD=
MYSQL_USER=
MYSQL_PASSWORD=
```
5. Make sure the database `scheme.sql` is in `/mysql` directory. If not, copy the `scheme.sql` file to the `/mysql` directory
# How to Run
1. Make sure you are in the cloned repository
```bash
$ cd tugas-besar-1
```
2. Run the docker-compose
```bash
$ docker-compose up
```
3. Open the website on your browser
```bash
http://localhost:8080/public/user/login
```
4. To stop the docker-compose, press `Ctrl + C` on your terminal and run the following command
```bash
$ docker-compose down
```
# Usage
## Login and Register
- Login with your account or register a new account
- You can login as an admin with the following credentials:
- Username: admin
- Password: admin123
## Home Page
- You can see the latest books on the home page
- You can click on the book card to see the book details
## Catalogue
- You can see all the books on the catalogue page
- You can filter the books by genre
- You can click on the book card to see the book details
## My Books
- You can see all the books you own on the my books page
- You can click on the book card to see the book details
## Book Details
- You can see the book details on the book details page
- You can add the book to your cart
## Cart
- You can see all the books in your cart on the cart page
- You can remove the book from your cart
- You can checkout your cart
## Admin Panel
- You can see all the books on the catalogue control page
- You can add a new book
- You can edit a book
- You can delete a book
- You can see all the users on the user control page
- You can edit a user
- You can delete a user
# Page Screenshots
## Login and Register Page
![Login Page](./screenshots/login.png)
![Register Page](./screenshots/register.png)
## Home Page
### Desktop View
![Home Page](./screenshots/home1.png)
![Home Page](./screenshots/home2.png)
### Tablet View
<img src="./screenshots/home3.png" alt="Home Page" width="300">
## Catalogue and My Books Page
![Catalogue Page](./screenshots/catalogue.png)
![My Books Page](./screenshots/mybooks.png)
## Book Details Page
![Book Details Page](./screenshots/bookview1.png)
![Owned Book Details Page](./screenshots/bookview2.png)
## Cart Page
![Cart Page](./screenshots/cart.png)
## Settings Page
![Settings Page](./screenshots/settings.png)
## Admin Panel
### Catalogue Control Page
![Catalogue Control Page](./screenshots/admin1.png)
### Add and Edit Book Page
![Add Book Page](./screenshots/admin2.png)
![Edit Book Page](./screenshots/admin4.png)
### User Control Page
![User Control Page](./screenshots/admin3.png)
# Task Distribution
## UI/UX Design
| Feature | NIM | Name |
| ------------------------ | -------- | -------------------- |
| Login | 13521142 | Enrique Alifio Ditya |
| Register | 13521142 | Enrique Alifio Ditya |
| Home Page | 13521142 | Enrique Alifio Ditya |
| Catalogue | 13521142 | Enrique Alifio Ditya |
| Book Details Page | 13521142 | Enrique Alifio Ditya |
| Cart | 13521142 | Enrique Alifio Ditya |
| Settings | 13521142 | Enrique Alifio Ditya |
| Catalogue Control Page | 13521142 | Enrique Alifio Ditya |
| User Control Page | 13521142 | Enrique Alifio Ditya |
| Add Book Page | 13521142 | Enrique Alifio Ditya |
| Edit Book Page | 13521142 | Enrique Alifio Ditya |
## Setup
| Requirements | NIM | Name |
| ------------------------ | -------- | -------------------- |
| Database | 13521142 | Enrique Alifio Ditya |
| Server | 13521142 | Enrique Alifio Ditya |
| Docker | 13521142 | Enrique Alifio Ditya |
| Configuration | 13521142 | Enrique Alifio Ditya |
## Client Side
### Components
| Components | NIM | Name |
| ------------------------ | -------- | -------------------- |
| Sidebar | 13521142 | Enrique Alifio Ditya |
| Top Navbar | 13521142 | Enrique Alifio Ditya |
| Search Bar | 13521142 | Enrique Alifio Ditya |
| Dropdown | 13521142 | Enrique Alifio Ditya |
| Book Card | 13521142 | Enrique Alifio Ditya |
| Pagination | 13521142 | Enrique Alifio Ditya |
| Containers | 13521142 | Enrique Alifio Ditya |
### Pages
| Pages | NIM | Name |
| ------------------------ | -------- | -------------------- |
| Login | 13521142 | Enrique Alifio Ditya |
| Register | 13521142 | Enrique Alifio Ditya |
| Home Page | 13521142 | Enrique Alifio Ditya |
| Catalogue | 13521142 | Enrique Alifio Ditya |
| My Books Page | 13521142 | Enrique Alifio Ditya |
| Book Details Page | 13521142 | Enrique Alifio Ditya |
| Cart | 13521142 | Enrique Alifio Ditya |
| Settings | 13521142 | Enrique Alifio Ditya |
| Catalogue Control Page | 13521142 | Enrique Alifio Ditya |
| Add Book Page | 13521142 | Enrique Alifio Ditya |
| Edit Book Page | 13521142 | Enrique Alifio Ditya |
| User Control Page | 13521073 | Ezra M C M H |
## Server Side
### Features
| Features | NIM | Name |
| ------------------------ | -------- | -------------------- |
| Login | 13521142 | Enrique Alifio Ditya |
| Register | 13521142 | Enrique Alifio Ditya |
| Home Page | 13521142 | Enrique Alifio Ditya |
| Catalogue | 13521142 | Enrique Alifio Ditya |
| My Books Page | 13521142 | Enrique Alifio Ditya |
| Book Details Page | 13521142 | Enrique Alifio Ditya |
| Cart | 13521142 | Enrique Alifio Ditya |
| Settings | 13521142 | Enrique Alifio Ditya |
| Catalogue Control Page | 13521142 | Enrique Alifio Ditya |
| Add Book Page | 13521142 | Enrique Alifio Ditya |
| Edit Book Page | 13521142 | Enrique Alifio Ditya |
| User Control Page | 13521073 | Ezra M C M H |
### Models
| Models | NIM | Name |
| ------------------------ | -------- | -------------------- |
| User | 13521142 | Enrique Alifio Ditya |
| Book | 13521142 | Enrique Alifio Ditya |
### Controllers
| Controllers | NIM | Name |
| ------------------------ | -------- | -------------------- |
| User | 13521142 | Enrique Alifio Ditya |
| Book | 13521142 | Enrique Alifio Ditya |
### Routes
| Routes | NIM | Name |
| ------------------------ | -------- | -------------------- |
| User | 13521142 | Enrique Alifio Ditya |
| Book | 13521142 | Enrique Alifio Ditya |
| Admin | 13521142 | Enrique Alifio Ditya |
### Middlewares
| Middlewares | NIM | Name |
| ------------------------ | -------- | -------------------- |
| Authentication | 13521142 | Enrique Alifio Ditya |
| Authorization | 13521142 | Enrique Alifio Ditya |
### Database
| Database | NIM | Name |
| ------------------------ | -------- | -------------------- |
| User | 13521142 | Enrique Alifio Ditya |
| Book | 13521142 | Enrique Alifio Ditya |
| Cart | 13521142 | Enrique Alifio Ditya |
### Error Handler
| Error Handler | NIM | Name |
| ------------------------ | -------- | -------------------- |
| All | 13521142 | Enrique Alifio Ditya |
### Helpers
| Helpers | NIM | Name |
| ------------------------ | -------- | -------------------- |
| All | 13521142 | Enrique Alifio Ditya |
## Testing and Debugging
| Features | NIM | Name |
| ------------------------ | -------- | -------------------- |
| All | 13521142 | Enrique Alifio Ditya |
# Author
- [Enrique Alifio Ditya - 13521142](https://github.com/AlifioDitya)
# Made With
![HTML5](https://camo.githubusercontent.com/d63d473e728e20a286d22bb2226a7bf45a2b9ac6c72c59c0e61e9730bfe4168c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f48544d4c352d4533344632363f7374796c653d666f722d7468652d6261646765266c6f676f3d68746d6c35266c6f676f436f6c6f723d7768697465)
![CSS3](https://camo.githubusercontent.com/e8ba07fa7cc79831afca90c574b74f1eefd0bf76af4e498cb0674330a1634e2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4353532d3233393132303f267374796c653d666f722d7468652d6261646765266c6f676f3d63737333266c6f676f436f6c6f723d7768697465)
![JavaScript](https://camo.githubusercontent.com/9d07c04bdd98c662d5df9d4e1cc1de8446ffeaebca330feb161f1fb8e1188204/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a6176615363726970742d4637444631453f7374796c653d666f722d7468652d6261646765266c6f676f3d6a617661736372697074266c6f676f436f6c6f723d626c61636b)
![PHP](https://camo.githubusercontent.com/b7e290d2aeff9829bba45e897265ceebd34b25f6f7efba4b08e1b23cfe0815e7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2532333737374242342e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)
![MySQL](https://camo.githubusercontent.com/988b23566a8e239f9717abbed64d36834115c8a8c7082a71c358e04f47f8398c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d7953514c2d3030303030463f7374796c653d666f722d7468652d6261646765266c6f676f3d6d7973716c266c6f676f436f6c6f723d7768697465)
\ No newline at end of file
version: '3.3'
services:
web:
image: tubes-1:latest
build: .
ports:
- 8008:80
- 8080:80
hostname: web-tubes-1
env_file: .env
volumes:
- ./src:/var/www/html
mysql:
image: mysql:latest
ports:
- 3307:3306
hostname: db-tubes-1
env_file: .env
volumes:
- ./mysql:/docker-entrypoint-initdb.d/:ro
networks:
web-mysql:
driver: bridge
\ No newline at end of file
-- Create the User table
CREATE TABLE IF NOT EXISTS user (
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
CONSTRAINT CheckPasswordLength CHECK (CHAR_LENGTH(password) >= 8),
CONSTRAINT CheckUsernameLength CHECK (CHAR_LENGTH(username) >= 5)
);
-- Create the Book table to store information about books
CREATE TABLE IF NOT EXISTS book (
book_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL UNIQUE,
author VARCHAR(100) NOT NULL,
category VARCHAR(255) NOT NULL,
book_desc TEXT,
price INT NOT NULL,
publication_date DATE,
cover_img_url VARCHAR(255),
audio_url VARCHAR(255),
CONSTRAINT CheckPositivePrice CHECK (price > 0)
);
-- Create the BookOwnership table to represent the relationship between users and books they own
CREATE TABLE IF NOT EXISTS book_ownership (
user_id INT NOT NULL,
book_id INT NOT NULL,
PRIMARY KEY (user_id, book_id),
FOREIGN KEY (user_id) REFERENCES user(user_id) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (book_id) REFERENCES book(book_id) ON UPDATE CASCADE ON DELETE CASCADE
);
-- Create a table to store current cart items
CREATE TABLE IF NOT EXISTS cart (
user_id INT NOT NULL,
book_id INT NOT NULL,
PRIMARY KEY (user_id, book_id),
FOREIGN KEY (user_id) REFERENCES user(user_id) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (book_id) REFERENCES book(book_id) ON UPDATE CASCADE ON DELETE CASCADE
);
-- DUMMY DATA
-- Books
INSERT INTO book VALUES (
DEFAULT,
'Nebula',
'Tere Liye',
'Sci-Fi',
'Nebula adalah novel fiksi ilmiah karya Tere Liye yang diterbitkan pada 2019 oleh Gramedia Pustaka Utama. Novel ini merupakan novel fiksi ilmiah pertama yang ditulis oleh Tere Liye.',
200000,
'2019-01-01',
'http://localhost:8080/storage/book-img/nebula.svg',
'http://localhost:8080/storage/audio/TOP-G.mp3'
);
INSERT INTO book VALUES (
DEFAULT,
'Klara and the Sun',
'Kazuo Ishiguro',
'Drama',
"'Klara and the Sun' is a thought-provoking novel written by Kazuo Ishiguro. The story revolves around Klara, an Artificial Friend with remarkable observational capabilities. Klara's perspective is unique, as she observes the world from her place on a store shelf, carefully studying the lives of the people who pass by.
Set in a futuristic world where technology blurs the lines between humans and machines, the novel explores themes of love, consciousness, and the desire for companionship. Klara's journey leads her to Josie, a teenager suffering from an undisclosed illness, and together they form a deep and unique bond.
As Klara navigates the complexities of human emotions and relationships, the novel delves into questions about the nature of consciousness, artificial intelligence, and the impact of technology on society. Kazuo Ishiguro's exquisite storytelling and exploration of human and artificial existence make 'Klara and the Sun' a compelling and contemplative read.",
150000,
'2021-03-02',
'http://localhost:8080/storage/book-img/klara.svg',
'http://localhost:8080/storage/audio/TOP-G.mp3'
);
INSERT INTO book VALUES (
DEFAULT,
'Rich People Problems',
'Kevin Kwan',
'Comedy',
'Rich People Problems is a 2017 satirical romantic comedy novel by Kevin Kwan. It is the third and final novel in Kwans Crazy Rich trilogy that looks at the rich and powerful families of Singapore. The plot revolves around the three clans descending upon Shang Su Yis deathbed to attempt to be included in her will, as she is allegedly extremely wealthy.',
200000,
'2017-05-23',
'http://localhost:8080/storage/book-img/rich-people-problem.svg',
'http://localhost:8080/storage/audio/TOP-G.mp3'
);
INSERT INTO book
VALUES
(DEFAULT, 'To Kill a Mockingbird', 'Harper Lee', 'Fiction', 'A classic novel about racial injustice and moral growth in the American South.', 499000, '1960-07-11', 'http://localhost:8080/storage/book-img/to-kill-a-mockingbird.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, '1984', 'George Orwell', 'Dystopian', 'A dystopian novel about a totalitarian regime and government surveillance.', 1299000, '1949-06-08', 'http://localhost:8080/storage/book-img/1984.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'Pride and Prejudice', 'Jane Austen', 'Romance', 'A classic romance novel revolving around Elizabeth Bennet and Mr. Darcy.', 1099000, '1813-01-28', 'http://localhost:8080/storage/book-img/pride-and-prejudice.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'The Great Gatsby', 'F. Scott Fitzgerald', 'Fiction', 'A story of decadence and excess in the Roaring Twenties.', 1199000, '1925-04-10', 'http://localhost:8080/storage/book-img/the-great-gatsby.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'To the Lighthouse', 'Virginia Woolf', 'Modernist', 'An experimental novel exploring the inner thoughts and emotions of characters.', 999000, '1927-05-05', 'http://localhost:8080/storage/book-img/to-the-lighthouse.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'Moby-Dick', 'Herman Melville', 'Adventure', 'The epic tale of Captain Ahabs obsessive quest for the white whale.', 599000, '1851-10-18', 'http://localhost:8080/storage/book-img/moby-dick.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'The Lord of the Rings', 'J.R.R. Tolkien', 'Fantasy', 'A high-fantasy epic featuring a hobbit, a wizard, and a powerful ring.', 1999000, '1954-07-29', 'http://localhost:8080/storage/book-img/the-lord-of-the-rings.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'Brave New World', 'Aldous Huxley', 'Dystopian', 'A dystopian novel set in a future world of genetic engineering and social control.', 1299000, '1932-12-30', 'http://localhost:8080/storage/book-img/brave-new-world.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'The Hobbit', 'J.R.R. Tolkien', 'Fantasy', 'The adventure of Bilbo Baggins as he joins a group of dwarves to reclaim their homeland.', 1099000, '1937-09-21', 'http://localhost:8080/storage/book-img/the-hobbit.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'War and Peace', 'Leo Tolstoy', 'Historical Fiction', 'A historical novel set during the Napoleonic era in Russia.', 699000, '1869-01-01', 'http://localhost:8080/storage/book-img/war-and-peace.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'Crime and Punishment', 'Fyodor Dostoevsky', 'Psychological Thriller', 'A psychological thriller about a young student who commits a murder.', 399000, '1866-11-11', 'http://localhost:8080/storage/book-img/crime-and-punishment.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'The Odyssey', 'Homer', 'Epic Poetry', 'An ancient Greek epic poem about the adventures of Odysseus on his journey home.', 1199000, '0800-01-01', 'http://localhost:8080/storage/book-img/the-odyssey.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'Letters from a Stoic', 'Seneca', 'Philosophy', 'A collection of moral letters offering Stoic wisdom and guidance.', 1299000, '0065-01-01', 'http://localhost:8080/storage/book-img/letters-from-a-stoic.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3'),
(DEFAULT, 'Meditations', 'Marcus Aurelius', 'Philosophy', 'A series of personal writings by the Roman Emperor, reflecting on Stoic philosophy.', 1099000, '0161-01-01', 'http://localhost:8080/storage/book-img/meditations.svg', 'http://localhost:8080/storage/audio/TOP-G.mp3');
INSERT INTO user
VALUES
(
DEFAULT,
'admin',
'$2y$10$.Etq0AVKCwgFpI0UZWtOX.5ISSCmaP9LnZBcCv7LN5hoUcCfk4eyK',
TRUE
);
\ No newline at end of file
screenshots/admin1.png

2.83 MiB

screenshots/admin2.png

140 KiB

screenshots/admin3.png

59.8 KiB

screenshots/admin4.png

205 KiB

screenshots/bookview1.png

460 KiB

screenshots/bookview2.png

345 KiB

screenshots/cart.png

1.14 MiB

screenshots/catalogue.png

1.45 MiB

screenshots/home1.png

397 KiB

screenshots/home2.png

1.35 MiB

screenshots/home3.png

310 KiB

screenshots/login.png

83.6 KiB

screenshots/mybooks.png

1.56 MiB

screenshots/register.png

97.7 KiB