Ketabee
Ongoing the development of a Book Store Webapp and a mobile version. Integrating the 2 applications with one backend for seamless user experience.
Tech Stack: Java Spring Boot, MySQL, React.js, SwiftUI, .Net
by the end of this project I should have created:
- Ketabee UI design and Flows using Figma
- Ketabee iOS application using xCode, SwiftUI, Core Data
- A gateway that will handle authentication, versioning and request routing based on App id and verion that will be based on a cloud tool (Microsoft Azure)
- Ketabee server application using two differnet frameworks (Spring Boot, .Net)
- A Ketabee webapp using React.js
29/09/23
Progress Update: Having acquired the necessary iOS knowledge through the Meta iOS Developer Program, including the successful completion of seven courses, I embarked on the initial phases of app development. My first step was focused on UI design using Figma.
The rationale behind initiating the UI design process is rooted in its ability to provide visual clarity regarding the app’s features and requirements. This visual representation serves as a foundational reference point for shaping the app’s overall design and functionality.
03/10/23
While creating the UI design in Figma, I got a clearer picture of the database and how the app will work. I’ve planned for 5 user login screens and 9 app screens.
I also have a rough idea of what data I’ll need for the app.
Right now, the iOS app doesn’t rely on the server app completely. Next, I’ll work on integrating the server app with the iOS app.
I’m aiming to develop the app using a Test-Driven Development (TDD) approach to ensure it’s reliable and maintainable.
Database Design sql script (intial thoughts):
CREATE TABLE users (
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
email VARCHAR(255),
);
CREATE TABLE roles (
role_id INT AUTO_INCREMENT PRIMARY KEY,
role_name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE permissions (
permission_id INT AUTO_INCREMENT PRIMARY KEY,
permission_name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE user_role (
user_id INT,
role_id INT,
PRIMARY KEY (user_id, role_id),
FOREIGN KEY (user_id) REFERENCES users(user_id),
FOREIGN KEY (role_id) REFERENCES roles(role_id)
);
CREATE TABLE role_permission (
role_id INT,
permission_id INT,
PRIMARY KEY (role_id, permission_id),
FOREIGN KEY (role_id) REFERENCES roles(role_id),
FOREIGN KEY (permission_id) REFERENCES permissions(permission_id)
);
CREATE TABLE book_genre (
genre_id INT AUTO_INCREMENT PRIMARY KEY,
genre_name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE books (
book_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(255),
publication_date DATE,
genre_id INT,
FOREIGN KEY (genre_id) REFERENCES book_genre(genre_id)
);
CREATE TABLE user_book (
user_id INT,
book_id INT,
borrowed_date DATE,
returned_date DATE,
PRIMARY KEY (user_id, book_id),
FOREIGN KEY (user_id) REFERENCES users(user_id),
FOREIGN KEY (book_id) REFERENCES books(book_id)
);
CREATE TABLE geofences (
geofence_id INT AUTO_INCREMENT PRIMARY KEY,
geofence_name VARCHAR(255) NOT NULL,
);
CREATE TABLE user_geofence (
user_id INT,
geofence_id INT,
PRIMARY KEY (user_id, geofence_id),
FOREIGN KEY (user_id) REFERENCES users(user_id),
FOREIGN KEY (geofence_id) REFERENCES geofences(geofence_id)
);
08/10/23
Accomplishments:
Developed seven views, each accompanied by its respective model-view, to handle user registration, OTP verification, login, and password reset. Additionally, created an initial version of the homepage that greets users by displaying their name and ID.
Development Status:
Currently, iOS app development is temporarily on hold. The focus has shifted to setting up the Spring Cloud Gateway, a crucial component responsible for user management.
Upcoming Steps:
Following the successful configuration of the Spring Cloud Gateway, the next phase involves integration. If this process proceeds smoothly, I will proceed to build the remaining features of the iOS app.
Use Cases:
- First-time users: When the ‘onboarding’ flag is set to true, the initial view displayed is the onboarding view. Users have the option to choose ‘sign up,’ which navigates them to the sign-up view. After entering and validating their details, users can complete the sign-up process, proceed to the OTP view, and, upon successful verification, receive and store a JWT token. Subsequently, users are automatically logged in and directed to the home page, with the ‘onboarding’ flag set to false.
- First-time users (alternative): When ‘onboarding’ is true, users can alternatively choose ‘sign in,’ which redirects them to the login view. After entering and validating their credentials, users can initiate the sign-up process, proceed to the OTP view, and, upon successful verification, receive and store a JWT token. Subsequently, users are automatically logged in and directed to the home page, with the ‘onboarding’ flag set to false.
- Returning users: When the ‘onboarding’ flag is false, the app checks for a stored JWT token for automatic login. If successful, users are seamlessly directed to the home page.
- Expired JWT token: If the JWT token is expired or fails during login, users are redirected to the login page with a notification stating, ‘Login session expired.’
- Password reset: In cases where login fails, users can initiate a password reset by navigating to the password reset view. The app verifies whether the email is registered. Upon successful validation, an OTP is sent via email, and users are directed to the OTP view. After successful OTP verification, users proceed to the second password reset view, where they can enter and confirm a new password. Upon successful verification, users are navigated back to the login view with a notification reading, ‘Password updated, please log in again.’
Please note that the current views have minimal functionality and are in a preliminary state. A more comprehensive revamp of both UI and functionality is planned during the integration phase, subsequent to the successful setup of the Spring Cloud Gateway.