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 (admin@test.com / 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: admin@test.com / 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