GithubHelp home page GithubHelp logo

benjamincrozat / legacy-blog Goto Github PK

View Code? Open in Web Editor NEW
361.0 10.0 98.0 14.92 MB

Source code for Benjamin Crozat's blog built using the TALL stack and getting more than 45,000 monthly visitors.

Home Page: https://benjamincrozat.com

License: Do What The F*ck You Want To Public License

PHP 71.12% JavaScript 0.71% CSS 0.08% Blade 28.09%
tailwind-css alpine-js laravel livewire blog programming-blogs laravel-blog php-blog

legacy-blog's Introduction

This repository is for version 2 of my blog. The version 3 is hosted on a private repository. However, the content of my blog is now open source and everyone can contribute: benjamincrozat/content

Laravel Forge Site Deployment Status

The logo of the blog of Benjamin Crozat.

This is the source code of my blog, benjamincrozat.com. This blog was built with the TALL stack and gets more than 50,000 visitors per month.

My Pirsch Analytics Dashboard. My Pirsch Analytics dashboard that is publicly accessible.

ย 

My Google Search Console. My Google Search Console. You can see the growth since I launched in September 2022.

ย 

I feel obligated to mention that my relative success is not correlated to my tech stack. I just want to own my piece of real estate online and do whatever I want with it. If you also want to create your blog, I don't recommend to copy and paste anything I did. While the code works for my specific needs, it might not be the ideal solution for everyone. But if you're curious, there you go, enjoy!

Before you proceed

  • I don't need pull requests. This is a project I'm working on alone, and I only have time for the bad code I write myself. ๐Ÿ˜…
  • This isn't an opportunity for mentoring. Please try to resolve your issues on your own. If you tried your hardest, then you can open a new discussion! Also, feedback is welcome (but useful feedback, not something like "whAt aBoUt SrP DudE?"
  • The code from this codebase won't help you rank on Google. Getting organic traffic requires hard work, to write content people search for (aka smart work), and lots and lots of patience. I actually wrote about my journey on the blog.

What you will learn

This is a small project. It certainly won't teach you how to maintain apps at huge scales. That being said, you can learn about:

  1. Simplicity. Most developers underestimate its benefits. I love figuring out how to do more with less.
  2. Using the GPT API from OpenAI to create features that were unthinkable not so long ago.
  3. Creating admin pages using Filament.
  4. Testing. This is a crucial part in ensuring everything don't break and Google does not penalize me. Because I can be forgetful, distracted and overconfident sometimes. These are flaws of human beings that can easily be mitigated by machines. By the way, I don't aim for 100% code coverage, I don't think this metric reflects the stability of the codebase.
  5. How to use various frontend technologies such as Livewire v3, Volt, Alpine.js, and Tailwind CSS.

Notes

  • I don't care about code coverage and static analysis, so you won't find that here.
  • This is pure and plain Laravel. If you know the framework, you can find your way around the codebase.
  • The tests are organized just like the source code. Most of the time, it makes it easier to know what is tested and what is not.
  • My commit history is garbage. I'm sorry and I know it's wrong. But when you are working alone on a project, it's hard to maintain discipline for such things.

Requirements

  • PHP 8.2+
  • MySQL 8+

Installation

The instructions below have been written assuming that you are using Laravel Valet. But you can run the project in whichever environment you want (Herd, Docker with Laravel Sail, Laragon, etc.).

Clone the repository and cd into it:

git clone [email protected]:benjamincrozat/benjamincrozat.com.git

cd benjamincrozat.com

Create a .env file and generate the app key:

cp .env.example .env

php artisan key:generate

Install the dependencies:

composer install

Create the database:

mysql -u root -e "CREATE DATABASE benjamincrozat"

Migrate the database with some fake data:

php artisan migrate --seed

Install the frontend dependencies and build the assets using Bun (use NPM or Yarn if you prefer):

bun install && bun run build

Testing

To run the tests, execute the following command:

php artisan test

Deployment

Once the tests are green in the CI environment, a webhook from Laravel Forge is called, which triggers the deployment.

Some details about the production environment:

  • I host the blog on a $6 DigitalOcean VPS that's managed by Ploi.
  • I use Sentry to monitor errors in the production environment only.

legacy-blog's People

Contributors

benjamincrozat avatar buismaarten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

legacy-blog's Issues

Create a better table of contents

This issue can only be closed if #11 is also closed.

Right now, I still need to decide if I should do it server-side again or use JavaScript.

One error to avoid, though, is not to overcomplicate it this time. The current code is pretty bad.

Render math and chemical equations?

Markdown is used for blog content, but if I wanted to display math or chemical formulas it doesn't render as it should, do you have a package or setup to do it? thank you

Create shortcodes

This has to replace the weird system I created to embed affiliate reviews.

  • Create shortcodes
  • Add the possibility to override values

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.