My Learning Journal

The Live version can be found here

Login Credentials

Email: test@example.com
Password: password

Introduction

My Learning Journal is a web application that allows users to create and manage journal entries. Users can register an account, log in, and start creating journal entries with a title, body, excerpt and a cover photo. The application provides a simple and intuitive interface for users to view, edit, and delete their journal entries. Users can also draft entries, publish them, and view a list of all published entries.

Running the Project

The project can be run locally using Laravel's built-in development server or using Laravel Sail, a light-weight command-line interface for interacting with Laravel's default Docker development environment. The following sections provide instructions for running the project locally and using Docker Sail.

Local Installation

Requirements:

  • PHP 7.4 or higher
  • Composer
  • MySQL/PgSQL
  • Node.js
  • NPM
  • Laravel CLI After installing the above dependencies, you can follow these steps to run the project locally:
  1. Clone the repository to your local machine:
git clone
  1. Change into the project directory:
cd my-learning-journal
  1. Install PHP dependencies:
composer install
  1. Install NPM dependencies:
npm install
  1. Create a new .env file by copying the .env.example file:
cp .env.example .env
  1. Generate an application key:
php artisan key:generate
  1. Update the .env file with your database credentials:
DB_CONNECTION=mysql
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

To use Sqlite, update the .env file with the following configuration:

DB_CONNECTION=sqlite
DB_DATABASE=/path/to/database.sqlite
  1. Run the database migrations and seed the database with sample data:
php artisan migrate --seed 
  1. Start the development server:
php artisan serve
  1. Visit http://localhost:8000 in your browser to view the application.
  2. You can now register a new account, log in, and start creating journal entries.
  3. An example user with the following credentials has been seeded into the database:
Email: test@example.com
Password: password

Docker Sail

Alternatively, you can use Laravel Sail to run the project in a Docker container. Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment. To use Sail, you need to have Docker installed on your machine.

To run the project using Sail, follow these steps: Requirements:

  1. Clone the repository to your local machine:
git clone
  1. Change into the project directory:
cd my-learning-journal
  1. Copy the .env.example file to a new .env file:
cp .env.example .env
  1. Start the Sail containers:
./vendor/bin/sail up
  1. Install PHP dependencies:
./vendor/bin/sail composer install
  1. Install NPM dependencies:
./vendor/bin/sail npm install
  1. Generate an application key:
./vendor/bin/sail artisan key:generate
  1. Run the database migrations:
./vendor/bin/sail artisan migrate --seed
  1. Visit http://localhost in your browser to view the application.
  2. You can now register a new account, log in, and start creating journal entries.
  3. An example user with the following credentials has been seeded into the database:
Email: test@example.com
Password: password

Deployment

The application is deployed on an AWS EC2 instance using Laravel Forge as the server management platform. The deployment process is automated using GitHub Actions, which triggers a deployment whenever changes are pushed to the main branch of the repository.

Laravel Forge is a server management and deployment platform for PHP applications. It provides a simple yet powerful interface for deploying and managing web applications on cloud servers. Forge supports popular cloud providers such as AWS, DigitalOcean, and Linode, and it automates the process of setting up servers, configuring databases, and deploying applications.

Technologies Used

  • Laravel: Laravel is a PHP web application framework that provides an elegant syntax and tools for building modern web applications. It follows the MVC (Model-View-Controller) architectural pattern and includes features such as routing, authentication, and database migrations.
  • PGSQL: PostgreSQL is a powerful, open-source relational database management system that provides robust support for complex queries, transactions, and data integrity. It is widely used in production environments for its scalability, performance, and reliability.
  • Docker: Docker is a platform for developing, shipping, and running applications in containers. It provides a lightweight, isolated environment for applications to run consistently across different environments.
  • AWS: Amazon Web Services (AWS) is a cloud computing platform that offers a wide range of services, including computing power, storage, and databases. It provides scalable, reliable, and cost-effective solutions for hosting web applications and managing infrastructure.
  • Laravel Forge: Laravel Forge is a server management and deployment platform for PHP applications. It simplifies the process of setting up servers, configuring databases, and deploying applications on cloud providers such as AWS, DigitalOcean, and Linode.
  • GitHub Actions: GitHub Actions is a continuous integration and continuous deployment (CI/CD) platform that automates the process of building, testing, and deploying code. It allows developers to define workflows in code and trigger actions based on events such as pushes, pull requests, and issue comments.
  • Vue.js: Vue.js is a progressive JavaScript framework for building user interfaces. It provides a simple and flexible API for creating interactive web applications and components.
  • Tailwind CSS: Tailwind CSS is a utility-first CSS framework that provides a set of pre-built classes for styling web applications. It allows developers to quickly design responsive layouts and customize styles using a functional approach.
  • Inertia.js: Inertia.js is a library that allows developers to build single-page applications using server-side routing and client-side rendering. It provides a seamless experience for users by preserving the server-rendered HTML and updating the page content dynamically.

ULID

A ULID is a 128-bit universally unique identifier that is encoded as a 26-character string. It is designed to be used as a primary key for database tables and is well-suited for use in distributed systems. Why I choose ULID as the primary key for my database tables:

  • Sortability: Unlike UUIDs, which are random and do not provide any inherent sorting, ULIDs are designed to be lexicographically sortable. This means that when ULIDs are sorted, they also represent a chronological order of generation. In certain scenarios where sorting is crucial, ULIDs can be more efficient and straightforward to work with.
  • Collision Avoidance: While traditional UUIDs are highly unlikely to collide due to their vast address space, collisions can still occur in distributed systems with a high volume of concurrent requests. ULIDs, with their time-based component, can reduce the likelihood of collisions, especially in scenarios with rapid ID generation.
  • Compactness: ULIDs are generally more compact than standard UUIDs, which are represented in hexadecimal form with dashes. The base32 representation of ULIDs is more space-efficient, which can be beneficial in scenarios where space optimization is important.
  • Lower Entropy: Some argue that the high entropy of traditional UUIDs might not always be necessary, and using ULIDs, which have a portion based on the current time, could provide sufficient uniqueness while being more predictable.
  • Readability: ULIDs, being base32 encoded and containing a timestamp component, can be more human-readable than traditional UUIDs. This can be advantageous in certain contexts, such as debugging or logging.
  • Deterministic Generation: Generating ULIDs does not require a centralized authority or coordination, as is the case with certain versions of UUIDs. This makes them easier to generate in distributed systems without worrying about contention or synchronization.
  • Consistency in Distributed Systems: Because ULIDs have a time-based component, they can lead to a more consistent ordering of events in distributed systems, making it easier to reason about causality and chronology.
  • More information about the differences between ULIDs, UUIDs and Integer can be found here.

Email Verification

For the sake of simplicity, I have disabled email verification in the application. However, enabling email verification is a common practice in web applications to ensure that users provide a valid email address and to prevent spam or abuse. When email verification is enabled, users are required to verify their email address by clicking on a link sent to their email before they can access certain features of the application.

Features to Add

  • Role-based Access Control: Implement role-based access control to restrict certain actions based on user roles. For example, only administrators should be able to delete journal entries or manage user accounts.
  • Search Functionality: Add a search feature to allow users to search for journal entries by title, body, or tags. This can help users quickly find entries based on specific keywords or topics.
  • Tagging System: Implement a tagging system to allow users to categorize journal entries with tags. This can help users organize their entries and find related content more easily.
  • Markdown Support: Add support for Markdown formatting in journal entries to allow users to format text, add links, and embed images. Markdown is a popular lightweight markup language that is easy to read and write.
  • Commenting System: Implement a commenting system to allow users to leave comments on journal entries. This can facilitate discussions, feedback, and engagement among users.
  • Notifications: Add a notification system to alert users about new comments, likes, or mentions in their journal entries. Notifications can help users stay informed and engaged with the application.
  • Export/Import Functionality: Implement export and import functionality to allow users to export their journal entries to a file or import entries from an external source. This can help users back up their data or migrate to other platforms.
  • Dark Mode: Add a dark mode theme option to provide users with a choice of light or dark color schemes. Dark mode can reduce eye strain and improve readability in low-light environments.

Conclusion

My Learning Journal is a simple and intuitive web application that allows users to create and manage journal entries. The application provides a user-friendly interface for users to register an account, log in, and start creating journal entries with a title, body, excerpt, and cover photo. Users can draft entries, publish them, and view a list of all published entries. The application is built using Laravel, Vue.js, Tailwind CSS, and Inertia.js, and it is deployed on an AWS EC2 instance using Laravel Forge. The deployment process is automated using GitHub Actions, which triggers a deployment whenever changes are pushed to the main branch of the repository. My Learning Journal is a showcase of modern web development practices and technologies, and it provides a solid foundation for building more complex web applications in the future.