Skip to content

Yushi5058/crafted_symfony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Crafted Logo

🎨 Crafted - Artisan Marketplace

A modern e-commerce platform celebrating handmade artistry

Symfony PHP PostgreSQL TailwindCSS

Live Demo β€’ Features β€’ Installation β€’ Documentation


πŸ“– About

Crafted is a full-featured e-commerce platform built with Symfony 8 as a school project, designed to connect artisans with customers who appreciate authentic, handmade products. The platform demonstrates modern web development practices by bridging traditional craftsmanship concepts with cutting-edge technology.

This academic project showcases the implementation of a complete e-commerce solution with user authentication, order management, admin dashboard, and email notifications.

✨ Features

πŸ›οΈ Customer Features

  • Product Catalog - Browse handcrafted items with advanced filtering by category and artisan
  • Shopping Cart - Real-time cart management with AJAX updates
  • Secure Checkout - Complete order processing with email confirmations
  • User Authentication - Registration, login with email verification
  • Order Management - View order history, track status, and cancel pending orders
  • User Profile - Manage account details, change password, and email
  • Contact Form - Direct communication with validation and subject selection
  • Returns System - Easy return request process
  • Toast Notifications - Clean, non-intrusive feedback system

πŸ‘¨β€πŸ’Ό Admin Features

  • Dashboard - Comprehensive overview of products, categories, and artisans
  • Product Management - Full CRUD operations with image uploads
  • Category Management - Organize products into categories
  • Artisan Management - Manage artisan profiles and their stores
  • Order Management - View, update status, and manage orders
  • Batch Operations - Update multiple order statuses simultaneously
  • Email Notifications - Automated order confirmation and status update emails

πŸ” Security & Authentication

  • Email Verification - Secure account activation system
  • Password Hashing - Industry-standard password security
  • CSRF Protection - Form security tokens
  • Role-Based Access - Admin and user role management
  • Account Deletion - Secure account removal with order validation

🎨 Design & UX

  • Responsive Design - Mobile-first approach with Tailwind CSS
  • Modern UI - Clean, elegant interface with smooth animations
  • Toast Notifications - User-friendly feedback system
  • Password Visibility Toggle - Enhanced form usability
  • Form Validation - Client and server-side validation
  • Loading States - Visual feedback for async operations

πŸ› οΈ Tech Stack

Backend

  • Framework: Symfony 8.0
  • Language: PHP 8.4
  • Database: PostgreSQL 18 (Supabase)
  • ORM: Doctrine ORM 3.5
  • Email: Symfony Mailer with Gmail SMTP
  • Validation: Symfony Validator
  • Security: Symfony Security Bundle

Frontend

  • CSS Framework: Tailwind CSS 3.0
  • JavaScript: Vanilla JS with Stimulus
  • Build Tool: Webpack Encore
  • Icons: SVG icons
  • Fonts: System fonts

Development Tools

  • Package Manager: Composer & npm
  • Database Migrations: Doctrine Migrations
  • Fixtures: Doctrine Fixtures
  • Testing: PHPUnit
  • Code Quality: PHP CS Fixer

πŸ“¦ Installation

Prerequisites

  • PHP 8.4 or higher
  • Composer
  • Node.js & npm
  • PostgreSQL 18
  • Symfony CLI (optional but recommended)

Setup Instructions

  1. Clone the repository

    git clone git@github.com:Yushi5058/crafted_symfony.git
    cd crafted_symfony
  2. Install PHP dependencies

    composer install
  3. Install JavaScript dependencies

    npm install
  4. Configure environment variables

    cp .env .env.local

    Edit .env.local and configure:

    DATABASE_URL="postgresql://user:password@host:port/database"
    MAILER_DSN=smtp://email@gmail.com:app_password@smtp.gmail.com:587?encryption=tls
  5. Create database and run migrations

    php bin/console doctrine:database:create
    php bin/console doctrine:migrations:migrate
  6. Load fixtures (optional)

    php bin/console doctrine:fixtures:load
  7. Build assets

    npm run build
    # or for development with watch mode
    npm run watch
  8. Start the development server

    symfony server:start
    # or
    php -S localhost:8000 -t public/
  9. Create admin account

    php bin/console app:create-admin

Visit http://localhost:8000 to see the application!

πŸ“ Project Structure

crafted_symfony/
β”œβ”€β”€ assets/              # Frontend assets (JS, CSS)
β”œβ”€β”€ bin/                 # Executable scripts
β”œβ”€β”€ config/              # Configuration files
β”‚   β”œβ”€β”€ packages/        # Bundle configurations
β”‚   └── routes/          # Routing configurations
β”œβ”€β”€ migrations/          # Database migrations
β”œβ”€β”€ public/              # Public web directory
β”‚   β”œβ”€β”€ images/          # Static images
β”‚   └── index.php        # Front controller
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Command/         # Console commands
β”‚   β”œβ”€β”€ Controller/      # Application controllers
β”‚   β”œβ”€β”€ Entity/          # Doctrine entities
β”‚   β”œβ”€β”€ Form/            # Form types
β”‚   β”œβ”€β”€ Repository/      # Database repositories
β”‚   β”œβ”€β”€ Security/        # Security components
β”‚   └── Service/         # Business logic services
β”œβ”€β”€ templates/           # Twig templates
β”‚   β”œβ”€β”€ admin/           # Admin panel views
β”‚   β”œβ”€β”€ cart/            # Shopping cart views
β”‚   β”œβ”€β”€ catalog/         # Product catalog views
β”‚   β”œβ”€β”€ checkout/        # Checkout process views
β”‚   β”œβ”€β”€ emails/          # Email templates
β”‚   β”œβ”€β”€ home/            # Homepage views
β”‚   β”œβ”€β”€ profile/         # User profile views
β”‚   └── shared/          # Shared components
β”œβ”€β”€ tests/               # Test files
β”œβ”€β”€ var/                 # Cache, logs, sessions
└── vendor/              # Composer dependencies

πŸ—„οΈ Database Schema

Main Entities

  • User - Customer and admin accounts
  • Product - Handcrafted items for sale
  • Category - Product categorization
  • Artisan - Craftspeople information
  • Order - Customer orders
  • OrderItem - Individual items in orders
  • CancelledOrder - Archive of cancelled orders

πŸš€ Key Commands

# Create admin user
php bin/console app:create-admin

# Reset admin password
php bin/console app:reset-admin-password

# Clear cache
php bin/console cache:clear

# Run migrations
php bin/console doctrine:migrations:migrate

# Load fixtures
php bin/console doctrine:fixtures:load

# Build assets
npm run build

# Watch assets for changes
npm run watch

🎯 Features in Detail

Order Management System

  • Order Lifecycle: pending β†’ processing β†’ shipped β†’ delivered
  • Cancellation: Users can cancel pending/processing orders
  • Email Notifications: Automated emails for order confirmation and status updates
  • Admin Controls: Batch status updates and individual order management

Email Verification System

  • Registration: New users receive verification emails
  • Profile Changes: Email changes require re-verification
  • Resend Option: Users can request new verification emails
  • Secure Tokens: Time-limited verification tokens

Shopping Cart

  • AJAX Updates: Real-time cart modifications without page reload
  • Session Storage: Cart persists across sessions
  • Stock Validation: Prevents ordering out-of-stock items
  • Visual Feedback: Toast notifications for cart actions

πŸ”’ Security Features

  • Password Hashing: Bcrypt algorithm
  • CSRF Protection: All forms protected
  • Email Verification: Required for orders
  • Role-Based Access: Admin-only routes
  • SQL Injection Prevention: Doctrine ORM parameterized queries
  • XSS Protection: Twig auto-escaping

🎨 Design Philosophy

Crafted follows a modern, minimalist design approach:

  • Color Palette: Warm terracotta (#E76F51) and charcoal (#2E2E2E)
  • Typography: Clean, readable fonts
  • Spacing: Generous whitespace for clarity
  • Animations: Subtle transitions for smooth UX
  • Accessibility: Semantic HTML and ARIA labels

πŸ“§ Email Configuration

The application uses Gmail SMTP for sending emails. To configure:

  1. Enable 2-factor authentication on your Gmail account
  2. Generate an App Password
  3. Update .env.local:
    MAILER_DSN=smtp://your-email@gmail.com:your-app-password@smtp.gmail.com:587?encryption=tls

🀝 Contributing

This is a school project. Contributions and feedback are welcome for educational purposes!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is for educational purposes only.

πŸ‘₯ Authors

πŸ™ Acknowledgments

  • Symfony community for the framework
  • Tailwind CSS for the utility-first CSS framework
  • All artisans who inspire this platform
  • Open-source contributors
  • Our teachers and classmates for their support

Made with ❀️ for artisans worldwide

Crafted - Where tradition meets technology

About

symfony project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors