search
HomeBackend DevelopmentPHP TutorialBuilding EventPress Part 1

Hey there! Just a note before you begin... I haven't written in a long while. I've been threatening to do so for ages, and I finally figured this was as good a topic to start with as any. I'm a little rusty but will try keep at it and hopefully improve.

Building EventPress  Part 1

EventPress is probably the biggest thing I work on. I've been involved since the very beginning and the app has grown exponentially through 3 major versions over the last 10 years. Version 4 is now on the table and there's a few changes I'd like to change as we work through it.

First, a little history. EventPress is owned by HotPress Media and was started because a client requested a simple solution to managing event RSVPs that could replace their Excel spreadsheet. That first version of EventPress was ugly. There was no spec, we ran the project without a proper plan and ended up with a giant bowl of spaghetti. But it worked, and it helped to get a foot in the door with one of the biggest companies in South Africa.

Version 2 was a big leap. We didn't change much in the way of Interface, but the underlying framework went through a big change. EventPress was moved to Laravel (version 5 at the time), and although a lot of the code from version 1 came across to version 2 the structure was much better and we had far less problems. We still didn't have any sort of test suite in those days and we basically tested stuff on the "it works on my machine" basis. Not great.

Building EventPress  Part 1

Version 2 event index

Version 3 brought a complete overhaul to the UI, and Tailwind became the preferred CSS framework. Lots of code was changed, even though there was still a fair amount of version 1 code hiding in dark corners. A big change to version 3 was a brand new distribution system. We learnt a lot about sending mass mail during that transition.

A lot of the public facing UI was a direct copy from version 2. Even now, much of what attendees see is still version 2 code. Instead, version 3 brought a lot more structure to the code base. There was a certain logic that started to come forward. We wrote thin controllers and leaned heavily on the service container. Version 3 was also the first version of EventPress to sport a test suite.

Building EventPress  Part 1

Version 3 event index

I've been writing PHP code for a long time, but I'm self-taught. EventPress was like being thrown in the deep end without any direction on how to swim. It was a massive learning curve, but it got me to where I am today. I built this thing myself with very little input from other developers.

This time around, I'm going to blog my way through the EventPress 4 development. Not because I'm looking for approval, but because I want to record it this time. And maybe my solutions could help other solo developers. I've learnt a lot about building and running large PHP applications.

EventPress 4 is going to be a large rewrite. Although plenty of EventPress 3 code will end up in version 4, it won't just be a copy-and-paste. I feel it's time to finally get rid of all the stale bits that have stuck around since version 1; I want a more robust test suite; and I want to take advantage of some newer tech.

My plan is to write something at least once a month as I work through this. I'll try force myself to keep it up.

So head first, into the fray...

Where to begin.

EventPress 4 will not be getting a new UI. We'll be using almost all of the interface from version 3, and maybe just a few minor changes here and there. EventPress' UI is built using Vue 3 and Tailwind and Inertia is our glue of choice.

EventPress 4 will be a 1-to-1 feature copy of version 3. This means that as version 3 evolves over the next few months, so version 4 needs to be grow alongside it. For now, though, it's just a bit of planning.

to begin with, I looked at where Version 3 was still struggling and made some notes on how those elements could be improved in version 4. I've built up an idea of how I'd like to approach building this version of EventPress. There's some familiarity and some brand new things:

  • Laravel 11
  • Vue 3
  • InertiaJS 2
  • Laravel Octane on FrankenPHP
  • PHP 8.4
  • MySQL (And SQLSRV for out Enterprise Clients)
  • Caddy

There's some interesting choices in there, I know. The Octane one is a big one for us since we've never used something like that before. Octane is a first party package for Laravel that helps run your app on a PHP application server. Swoole, RoadRunner and FrankenPHP are supported. We looked at all three options and decided on FrankenPHP for now. It's newer than the other two, but offers really goo performance. Swoole offers has concurrent workers, which is nice, but not something we see ourselves needing. The deal breaker, however, was that it requires the Swoole extension be installed. That's not something we can expect our enterprise clients to do. I also have some experience with FrankenPHP, so that made sense.

We've used Nginx for years. It's great and I cannot recommend it enough. However, FrankenPHP comes with it's own Caddy server, so we're experimenting with this as well. We might not stick to Caddy, but for now, it's on the list.

PHP 8.4 hasn't been released just yet, but since EventPress 4 won't be out for a while, it made sense to start on the latest version we can. As of writing, PHP 8.4 is about a month away from release, so we're using the latest release candidate.

InertiaJS 2 is much the same story. It's also in BETA, but since we're a long way from release, it will probably be out long before EventPress is. Besides, we ran InertiaJS 1 in BETA for ages without issues.

Static Analysis

I'm a recent static analysis convert. The most I've used is the stuff that PHPStorm gives me as a I coded. For EventPress 4, we've decided to go full hog and bring PHPStan into the mix. PHPStan is a third-party static analyser for PHP. It's dead simple to configure and has helped me to weed out a few bugs in a number of other projects.

Based on the size of EventPress it makes sense here as well. To make this work, I've added a test:types Composer script which I can run whenever I want and an be added to the CI script.

Code Linting

I've never run a PHP code linter. I've used PHP Mess Detector a few times, but never really got stuck into it. For EventPress 4, we've decided that a linter will help to keep code neat and consistent. We've opted for Laravel's own "Pint" which is really just a wrapper around PHP-CS-Fixer and provides a really simple way to keep our code tidy. Again, I've added lint and test:lint Composer scripts to make it easier to run.

Dev Environment

I work on both Mac and Linux machines during development. I have an M1 Max on my desk that I've had for a few years, and a few Linux machines dotted around the office. My main driver is the Mac and I do most of my development work there, but all my code runs on Linux machines. Usually Ubuntu Server.

EventPress 4 adds a few new pieces to the puzzle, but I think for the most part I can continue to develop the way I currently do. I use Homebrew to install most of the tools and Laravel Valet to run local dev environments. I'm not a Laravel Herd user (It's good, but I fell like more of a Herd Pro user and I can't justify spending $99 a year for a tool that does everything I can do already, just a little quicker and wrapped in a nice UI).

So my plan is have an eventpress4.test domain running with a MySQL database on my local machine. I'll use this state for a while during early development and just do some testing with Octane every few days or so. Once we're through the early part, we'll start development using Octane more regularly. We'll host a test server running the app as we intend it to run in production.

Containers

EventPress has never been containerised. However, EventPress 4 will likely go that way. We're still experimenting with a few things but we've been in conversation with some of our enterprise clients, and we feel that this will help to make the deployment process a lot easier for them. We have some early tests running EventPress 3 in a Docker container, and we feel like this is going to be the right move for all releases of EventPress going forward.

GIT

For years, we have relied heavily on GitLab as our CI/CD service of choice. GitLab runs a number of complex CI pipelines and does deployment for almost every project I work on.

However, I've also been a GitHub user for many years. I've used it mainly for my open-source work, but recently started moving some smaller projects to a paid-for GitHub account and I've been super impressed. There's a few things that work very differently to GitLab, but in most aspects I'm really happy.

So EventPress 4 code will be hosted at GitHub and we'll use Actions for or CI pipeline and all deployments.

Ready, set go!

I think that's it for this post. There's still some planning to go through, but I have started putting some code down and writing some tests. I've already got a basic authentication layer going (Thanks Laravel), although most of that it similar to EventPress 3. I'll show some code in the next one. Promise!

Building EventPress  Part 1

Early version 4 login

The above is the detailed content of Building EventPress Part 1. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Continued Use of PHP: Reasons for Its EnduranceThe Continued Use of PHP: Reasons for Its EnduranceApr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python: Exploring Their Similarities and DifferencesPHP and Python: Exploring Their Similarities and DifferencesApr 19, 2025 am 12:21 AM

PHP and Python are both high-level programming languages ​​that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP and Python: Different Paradigms ExplainedPHP and Python: Different Paradigms ExplainedApr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: A Deep Dive into Their HistoryPHP and Python: A Deep Dive into Their HistoryApr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Choosing Between PHP and Python: A GuideChoosing Between PHP and Python: A GuideApr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Frameworks: Modernizing the LanguagePHP and Frameworks: Modernizing the LanguageApr 18, 2025 am 12:14 AM

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHP's Impact: Web Development and BeyondPHP's Impact: Web Development and BeyondApr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools