A Laravel-based REST API that serves as the backend for the Invstorly Alpha test application. This API handles user authentication, listing management, and file storage.
- PHP >= 8.2
- Composer
- MySQL/PostgreSQL database
- Laravel 11.x
- Clone the repository
git clone <repository-url>
cd backend- Install dependencies
composer install- Environment setup
cp .env.example .env
php artisan key:generate- Configure your database in
.env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=invstorly
DB_USERNAME=your_username
DB_PASSWORD=your_password- Run migrations
php artisan migrate- Start the development server
php artisan servePOST /api/register- Register a new userPOST /api/login- User login
GET /api/listings- Get all listingsGET /api/listings/{id}- Get a specific listingPOST /api/listings- Create a new listing (requires authentication)PUT /api/listings/{id}- Update a listing (requires authentication)DELETE /api/listings/{id}- Delete a listing (requires authentication)
Run the test suite:
php artisan test