A modern fullstack web application for buying and selling bicycles. Users can browse products, manage favorites, send messages to sellers, and more.
Live Demo: https://recycle-marketplace.vercel.app/
- User authentication with JWT tokens
- Rate limiting for security (5 login attempts/minute)
- User profiles and product management
- Product listing and browsing
- Seeding scripts for test data with Unsplash API images
- Favorites system
- Stored Procedures for optimized database operations
- Audit data for tracking changes
- Messaging between users
- Advanced search and filtering
- Admin dashboard with analytics and CRUD operations
- Responsive design for mobile and desktop
- Docker and Docker Compose installed
- Node.js 20+ (for local frontend development)
- Python 3.13+ (for local backend development)
Copy .env.example to .env and set your environment variables for BOTH /frontend and /backend.
# Start whole platform (frontend, backend, and database)
docker-compose up --build -d
# Stop all services
docker-compose downThe MySQL database is automatically seeded with test data during application startup:
- 👤 Sample users ([email protected] / admin123)
- 📦 Product categories and details
- 🚴 Test products with images and price history
- 💬 Sample conversations and favorites
Manual seeding (if needed):
cd backend
poetry install
poetry run python scripts/seed.py| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:5173 | React application |
| Backend API | http://localhost:8000 | FastAPI server |
| API Docs (Swagger) | http://localhost:8000/docs | Interactive API documentation |
| API Docs (ReDoc) | http://localhost:8000/redoc | Alternative API docs |
├── frontend/ # React application with Vite, Tailwind and MUI
│ └── src/
│
├── backend/ # Python FastAPI app
│ ├── app/
│ │ ├── main.py # Application entry point
│ │ ├── db/ # Database configuration
│ │ ├── models/ # Database models
│ │ ├── repositories/ # Data access layer
│ │ ├── routers/ # API routes
│ │ ├── schemas/ # Pydantic schemas
│ │ └── services/ # Business logic
│ ├── alembic/ # Database migrations
│ ├── scripts/ # Utility scripts (seeding, etc.)
│ └── tests/ # Backend tests
│
└── docker-compose.yml # Container orchestration
For testing purposes, use these credentials:
- Admin: [email protected] / admin123
- Regular User: register your own
Kør disse inden push
poetry run safety scan
poetry run bandit -r app
poetry run ruff check .
poetry run mypy app- Cd \frontend
- Kør:
npm run test:e2e - Kør en fil:
npm run test:e2e -- e2e/messaging.spec.js - Kør en test:
npm run test:e2e -- e2e/messaging.spec.js -g "User can contact seller and send a quick message"
-
Kræver backend kørende (default
http://localhost:8000, kan overstyres medBASE_URL). -
Lokal k6:
k6 run --env BASE_URL=http://localhost:8000 performance-tests/load.jsk6 run --env BASE_URL=http://localhost:8000 performance-tests/spike.jsk6 run --env BASE_URL=http://localhost:8000 performance-tests/stress.jsk6 run --env BASE_URL=http://localhost:8000 performance-tests/soak.js
-
Nuværende mål:
- Load: p95 < 2s @ 50 VU
- Spike: p95 < 6s @ 150 VU
- Stress: p95 < 4.5s @ 150 VU
- Soak: 20 VU i 1 time (overvåg for fejlrate/drift)
- Backend:
poetry run pytest --cov=app --cov-report=html --cov-report=termand `poetry run coverage - Frontend:
npx vitest --run --coverage