78 lines
1 KiB
Markdown
78 lines
1 KiB
Markdown
# BitHarbor
|
|
|
|
Simple Laravel + Vue ecommerce demo with:
|
|
|
|
- Product listing
|
|
- Category sidebar (tree structure)
|
|
- Login, register, forgot password, reset password (SPA flow)
|
|
|
|
## Project Structure
|
|
|
|
- `backend/` Laravel API + auth (Fortify + Sanctum)
|
|
- `frontend/` Vue 3 + Vite SPA
|
|
|
|
## Requirements
|
|
|
|
- PHP 8.2+
|
|
- Composer
|
|
- Node.js 20+
|
|
- npm
|
|
|
|
## Setup
|
|
|
|
### Backend
|
|
|
|
```bash
|
|
cd backend
|
|
cp .env.example .env
|
|
composer install
|
|
php artisan key:generate
|
|
```
|
|
|
|
Set these env values in `backend/.env`:
|
|
|
|
```env
|
|
APP_URL=http://localhost:8000
|
|
FRONTEND_URL=http://localhost:5173
|
|
```
|
|
|
|
Then run migrations + seed:
|
|
|
|
```bash
|
|
php artisan migrate:fresh --seed
|
|
```
|
|
|
|
Start backend server:
|
|
|
|
```bash
|
|
php artisan serve --port=8000
|
|
```
|
|
|
|
### Frontend
|
|
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
```
|
|
|
|
Create/update `frontend/.env`:
|
|
|
|
```env
|
|
VITE_API_BASE_URL=http://localhost:8000
|
|
```
|
|
|
|
Start frontend:
|
|
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Password reset links are generated for SPA URLs using `FRONTEND_URL`.
|
|
- If config/routes seem stale, run:
|
|
|
|
```bash
|
|
php artisan optimize:clear
|
|
```
|
|
|