A Laravel-based web application for collaborative reading and book management.
- Quick Start
- Prerequisites
- Installation
- Development
- Contributing
- Project Structure
- Development Guidelines
- Troubleshooting
- Contact
β οΈ IMPORTANT: WSL (Windows Subsystem for Linux) is REQUIRED for this project!
-
Clone the repository:
git clone https://github.com/alfinpratamaa/ngabaca.git cd ngabaca -
Run the installation script:
chmod +x install.sh ./install.sh <ENCRYPTION_KEY> # Example: ./install.sh base64:aisdb1231gh20321ojb
The encryption key is available in the group description.
-
Start the development server:
composer run dev
-
Access the application:
http://localhost:8000
If you must use Windows (not recommended), follow the detailed installation steps below.
- WSL 2 (Windows Subsystem for Linux)
- PHP 8.3 or higher
- Composer
- Node.js & npm
- OpenSSL
Ensure the following software is installed and accessible from Command Prompt/PowerShell:
- Download from windows.php.net/download
- Add PHP to your system's PATH
- Verify:
php -v
- Download from getcomposer.org/download
- Verify:
composer -v
- Download from nodejs.org
- Verify:
node -vandnpm -v
- Download from slproweb.com
- Add to PATH
- Verify:
openssl version
The install.sh script automatically handles:
- Decrypting
.env.encryptedto.env - Installing Laravel dependencies (
composer install) - Installing Node.js dependencies (
npm install) - Generating application key
- Setting up database (migration & seed)
-
Clone and navigate to project:
git clone https://github.com/alfinpratamaa/ngabaca.git cd ngabaca -
Set encryption key environment variable:
Command Prompt:
set LARAVEL_ENV_ENCRYPTION_KEY=YOUR_ENCRYPTION_KEY
PowerShell:
$env:LARAVEL_ENV_ENCRYPTION_KEY="YOUR_ENCRYPTION_KEY"
-
Install PHP dependencies:
composer install --no-interaction --prefer-dist --optimize-autoloader
-
Decrypt environment file:
# Remove old .env file del .env 2>NUL # Decrypt .env.encrypted openssl enc -aes-256-cbc -d -in .env.encrypted -out .env -k "%LARAVEL_ENV_ENCRYPTION_KEY%"
-
Install Node.js dependencies:
npm install
-
Generate application key:
php artisan key:generate
-
Setup database:
php artisan migrate --force php artisan db:seed --force
-
Create storage link:
php artisan storage:link
-
Clear caches:
php artisan cache:clear php artisan config:clear php artisan view:clear php artisan route:clear
composer run devThis command starts both the Laravel development server and frontend asset compilation.
# Run PHP tests
php artisan test
# Run JavaScript tests (if available)
npm run test# Create new migration
php artisan make:migration create_table_name
# Run migrations
php artisan migrate
# Rollback migrations
php artisan migrate:rollback
# Fresh migration with seeding
php artisan migrate:fresh --seedWe welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Create a Pull Request
feature/nama-fitur # New features
bugfix/nama-bug # Bug fixes
hotfix/nama-hotfix # Critical fixes
docs/update-readme # Documentation updates
-
Create branch:
git checkout -b feature/nama-fitur
-
Make changes and commit:
git add . git commit -m "feat: menambahkan fitur X"
-
Push branch:
git push origin feature/nama-fitur
-
Create Pull Request:
- Open GitHub repository
- Click "New Pull Request"
- Select your branch
- Add clear description
type: deskripsi singkat
Types:
- feat: fitur baru
- fix: perbaikan bug
- docs: update dokumentasi
- style: formatting, tidak mengubah logika
- refactor: refactoring code
- test: menambahkan test
- chore: maintenance task
ngabaca/
βββ app/ # Laravel application logic
β βββ Http/Controllers/ # Controllers
β βββ Models/ # Eloquent models
β βββ Services/ # Business logic
βββ resources/ # Views, assets, language files
β βββ views/ # Blade templates
β βββ js/ # JavaScript files
β βββ css/ # Stylesheets
βββ public/ # Public assets
βββ database/ # Database files
β βββ migrations/ # Database migrations
β βββ seeders/ # Database seeders
β βββ factories/ # Model factories
βββ routes/ # Route definitions
β βββ web.php # Web routes
β βββ api.php # API routes
βββ config/ # Configuration files
βββ .env.encrypted # Encrypted environment file
βββ install.sh # Automated setup script
βββ README.md # This file
- PHP: Follow PSR-12 coding standards
- JavaScript: Use ESLint for linting
- Formatting: Use Prettier for consistent formatting
- Laravel: Follow Laravel best practices and conventions
# PHP Code Style Fixer
./vendor/bin/php-cs-fixer fix
# PHPStan Static Analysis
./vendor/bin/phpstan analyse
# ESLint for JavaScript
npm run lint
# Prettier formatting
npm run formatKey environment variables in .env:
APP_NAME=Ngabaca
APP_ENV=local
APP_KEY=base64:...
APP_DEBUG=true
APP_URL=http://localhost:8000
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=ngabaca
DB_USERNAME=your_username
DB_PASSWORD=your_password# Fix storage and cache permissions
chmod -R 775 storage bootstrap/cachephp artisan cache:clear
php artisan config:clear
php artisan view:clear
php artisan route:clear
php artisan optimize:clearcomposer dump-autoload# Reset database
php artisan migrate:fresh --seed
# Check database connection
php artisan tinker
>>> DB::connection()->getPdo();# Clear npm cache
npm cache clean --force
# Reinstall node modules
rm -rf node_modules package-lock.json
npm install# If you encounter permission issues in WSL
sudo chown -R $USER:$USER /path/to/ngabaca- Always work within the WSL filesystem (
/home/username/) - Avoid working in
/mnt/c/for better performance
- Ensure the encryption key is exactly as provided
- Check for extra spaces or characters
- Verify the key format (should start with
base64:)
# Test OpenSSL installation
openssl version
#decryption manually
openssl enc -aes-256-cbc -d -pbkdf2 -in .env.encrypted -out .env -k "key"
#encryption manually
openssl enc -aes-256-cbc -pbkdf2 -in .env -out .env.encrypted -k "key"If you encounter any issues or have questions:
- Create an issue on GitHub
- Contact maintainer: @alfinpratamaa
- Project repository: https://github.com/alfinpratamaa/ngabaca
This project is licensed under the MIT License.
Happy Coding! π