This is a Laravel-based web application for analyzing website content. It scans a given URL and provides insights into various aspects of the content, including scores and analyses for clarity, consistency, SEO, and tone. It also provides suggested headlines, CTAs, and content hierarchy.
| Build | Tests | Coverage |
|---|---|---|
- Laravel
- Inertia.js
- PostgreSQL
- React
- Tailwind CSS
- Google Gemini
- Prism PHP
- PHPStan
- Pest
- Rector
- Pint
- Prettier
- ESLint
- DDEV for local development
- GitHub Actions
This project is configured to use DDEV. Once you have that installed (along with the necessary Docker installation, as detailed in the DDEV documentation), you can continue with local setup.
Create a .env file and copy over the contents of the .env.example file.
In the terminal, from within the project directory, run ddev start. This will spin up the project and configure your database environment variables for you.
Run the following commands in the terminal:
# Install Composer dependencies
$ ddev composer install
# Install NPM dependencies and build assets
$ ddev npm install
$ ddev npm run buildCreate an APP_KEY value by running ddev artisan key:generate.
Run the following commands in the terminal to set up your local database:
# Run migrations
$ ddev artisan migrate
# Seed your local database
$ ddev artisan db:seedYou'll also need to add a testing database for running tests. The necessary environment variables and their values are included in the .example.env file.
These instructions will assume that you use TablePlus as your database GUI. It can be downloaded and used for free.
To create your testing database, run ddev tableplus. This will open the container's database (your local database) in TablePlus. Press ⌘K to open the connection's list of databases, click New..., enter the name of the database (the value for the DB_TESTING_DATABASE environment variable), and click OK. You can then close TablePlus.
To run the entire test suite with coverage, execute the following command in the terminal:
$ make test_with_coverageThis command will enable Xdebug in DDEV, run the tests, and then disable Xdebug again.
To run the entire test suite without coverage, execute the following command in the terminal:
$ ddev artisan testThere are multiple Composer commands for checking code quality and formatting.
To check code formatting and linting with Rector, Pint, Prettier, and ESLint, run:
$ ddev composer lint:checkTo automatically fix code formatting issues with Rector, Pint, Prettier, and ESLint, run:
$ ddev composer lintTo check PHP types with PHPStan, run:
$ ddev composer types:checkTo check PHP type coverage with Pest, run:
$ ddev composer type-coverage:checkTo check code formatting and perform static analysis all in one go, run:
$ ddev composer testTo use the Google Gemini API for content analysis, you need to set up a Google Cloud project and create an API key.
- Go to the Google AI Studio API keys page (log in if necessary).
- Click on
Create API Key. - Provide a name for the API key and select a project (create a new project if needed).
- Click
Create keyto generate the API key. - Copy the generated API key.
- Set the API key as the value for the
GEMINI_API_KEYenvironment variable in your.envfile.