Plan Done, Dockerization and cleanup
Build & Push Docker Images / test-backend (push) Successful in 55s
Build & Push Docker Images / test-frontend (push) Successful in 43s
Run Tests / test-backend (push) Successful in 48s
Run Tests / test-frontend (push) Successful in 42s
Build & Push Docker Images / build-backend (push) Failing after 4m7s
Build & Push Docker Images / build-frontend (push) Failing after 32s
Build & Push Docker Images / test-backend (push) Successful in 55s
Build & Push Docker Images / test-frontend (push) Successful in 43s
Run Tests / test-backend (push) Successful in 48s
Run Tests / test-frontend (push) Successful in 42s
Build & Push Docker Images / build-backend (push) Failing after 4m7s
Build & Push Docker Images / build-frontend (push) Failing after 32s
This commit is contained in:
@@ -29,7 +29,46 @@ A web application to search for medicines from the official Spanish CIMA databas
|
||||
- npm or yarn
|
||||
- **Redis server** (v6.0 or higher)
|
||||
|
||||
## 🚀 Setup Instructions
|
||||
## 🐳 Docker Setup (Recommended)
|
||||
|
||||
Runs the full stack (backend, frontend, Redis) with a single command.
|
||||
|
||||
**Prerequisites**: Docker and Docker Compose v2.
|
||||
|
||||
```bash
|
||||
# Copy and configure environment (optional — defaults work for local dev)
|
||||
cp backend/.env.example backend/.env
|
||||
# Edit backend/.env to set SESSION_SECRET and any other vars
|
||||
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
App available at `http://localhost:3000`.
|
||||
|
||||
**First run — create an admin user:**
|
||||
```bash
|
||||
docker compose exec backend node create-admin.js
|
||||
# Default: admin / admin123 — change after first login
|
||||
```
|
||||
|
||||
**Seed sample pharmacies:**
|
||||
```bash
|
||||
docker compose exec backend node seed.js
|
||||
```
|
||||
|
||||
**Stop:**
|
||||
```bash
|
||||
docker compose down
|
||||
```
|
||||
|
||||
Database is persisted in a named Docker volume (`backend_data`). To wipe it:
|
||||
```bash
|
||||
docker compose down -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Manual Setup Instructions
|
||||
|
||||
### 1. Install Redis
|
||||
|
||||
@@ -151,19 +190,24 @@ The frontend will run on `http://localhost:3000`
|
||||
|
||||
```
|
||||
FarmaFinder/
|
||||
├── docker-compose.yml # Full stack: backend + frontend + Redis
|
||||
├── backend/
|
||||
│ ├── Dockerfile
|
||||
│ ├── server.js # Express server and API routes
|
||||
│ ├── cima-service.js # CIMA API integration with Redis cache
|
||||
│ ├── redis-client.js # Redis connection configuration
|
||||
│ ├── seed.js # Database seeding script
|
||||
│ ├── create-admin.js # Admin user creation script
|
||||
│ ├── database.sqlite # SQLite database (created after first run)
|
||||
│ ├── .env.example # Environment variable template
|
||||
│ └── package.json
|
||||
├── frontend/
|
||||
│ ├── Dockerfile
|
||||
│ ├── nginx.conf # Nginx config (Docker): serves SPA + proxies /api
|
||||
│ ├── src/
|
||||
│ │ ├── components/ # React components
|
||||
│ │ │ ├── admin/ # Admin panel components
|
||||
│ │ │ └── ... # Public view components
|
||||
│ │ │ ├── PharmacyMap.jsx # Leaflet map (OpenStreetMap)
|
||||
│ │ │ └── ...
|
||||
│ │ ├── views/ # View components (Public/Admin)
|
||||
│ │ ├── App.jsx # Main app component
|
||||
│ │ └── main.jsx # Entry point
|
||||
|
||||
Reference in New Issue
Block a user