Prerequisites
Before you begin, ensure you have the following installed:- PHP 8.2 or higher
- Composer
- Node.js 18 or higher
- npm or yarn
- MySQL or MariaDB
- Git
Clone the repository
Clone the MyDiary repository to your local machine:Install dependencies
Install both PHP and JavaScript dependencies:Configure environment variables
Copy the example environment file and configure it:.env file with your local database credentials:
Key configuration options
APP_KEY- Will be generated in the next stepDB_DATABASE- Create this database before running migrationsSESSION_DRIVER- Set todatabasefor database-backed sessionsQUEUE_CONNECTION- Set todatabasefor database queue driver
Generate application key
Generate a unique application key:Create the database
Create a new MySQL database for the application:Run database migrations
Run the migrations to create all required tables:userspassword_reset_tokenssessionsfriend_requestsentriesentry_usersimage_usersimage_entrieslikescachejobsjob_batchesfailed_jobs
Create storage symlink
Create a symbolic link frompublic/storage to storage/app/public:
Start the development server
You can start the development server using one of these methods:Using composer script (recommended)
This starts all services in parallel:- Laravel development server (http://localhost:8000)
- Queue worker
- Laravel Pail (log viewer)
- Vite dev server (for hot module replacement)
Manual start
Alternatively, start services individually in separate terminal windows:Access the application
Once the development server is running, access the application at:- Frontend: http://localhost:8000
- API routes: http://localhost:8000/api (if configured)
Development tools
Laravel Pail
View real-time logs:Laravel Tinker
Interact with your application via REPL:Code formatting
Format your code using Laravel Pint:Troubleshooting
Permission issues
If you encounter permission errors, ensure the storage and cache directories are writable:Database connection errors
Verify your database credentials in.env and ensure MySQL is running:
Node module issues
If you encounter issues with node modules, try clearing and reinstalling:Next steps
Now that your environment is set up, you can:- Review the architecture overview
- Explore the database schema
- Learn about frontend components