Skip to content

VictorHanert/Recycle-Fullstack-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Recycle logo Recycle Marketplace

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/

Features

  • 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

Tech Stack

Frontend

React Vite TailwindCSS MUI React Router Zustand Eslint

Backend & Database

Python FastAPI Uvicorn MySQL SQLAlchemy Alembic Pydantic JWT

DevOps & Cloud

Docker Azure Github GitHub Actions Vercel

Getting Started

Prerequisites

  • 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 the Application

# Start whole platform (frontend, backend, and database)
docker-compose up --build -d

# Stop all services
docker-compose down

Seed the Database

The 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

Access Points

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

Project Structure

β”œβ”€β”€ 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

πŸ” Default Credentials

For testing purposes, use these credentials:

Static tests

KΓΈr disse inden push

poetry run safety scan
poetry run bandit -r app
poetry run ruff check .
poetry run mypy app

End-to-end test

  • 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"

Performance tests (k6)

  • KrΓ¦ver backend kΓΈrende (default http://localhost:8000, kan overstyres med BASE_URL).

  • Lokal k6:

    • k6 run --env BASE_URL=http://localhost:8000 performance-tests/load.js
    • k6 run --env BASE_URL=http://localhost:8000 performance-tests/spike.js
    • k6 run --env BASE_URL=http://localhost:8000 performance-tests/stress.js
    • k6 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)

Code Coverage

  • Backend: poetry run pytest --cov=app --cov-report=html --cov-report=term and `poetry run coverage
  • Frontend: npx vitest --run --coverage

Contributors 4

  •  
  •  
  •  
  •