URBANStore is a full-stack e-commerce platform for urban fashion. It provides a seamless shopping experience with features like user authentication, product browsing, cart management, order processing, and an admin dashboard for managing products, orders, and users.
- User registration with email and password
- User login with email and password
- Google OAuth integration for quick sign-up and login
- JWT-based authentication for secure API requests
- Role-based access control (user and admin roles)
- Browse products with pagination and sorting options
- Search products by name or description
- View detailed product information, including images, price, and description
- Filter products by category
- Admin functionality to add, edit, and delete products
- Manage product inventory and stock levels
- Add products to cart
- Adjust quantity of items in cart
- Remove items from cart
- Persistent cart across sessions
- Real-time cart total calculation
- Add products to personal wishlist
- Remove products from wishlist
- View all wishlist items
- Secure checkout flow
- Address input for shipping
- Integration with Stripe for payment processing
- Order summary before final purchase
- Place new orders
- View order history for users
- Detailed view of individual orders
- Admin functionality to update order status (e.g., processing, shipped, delivered)
- Order cancellation (for pending orders)
- View and edit user profile information
- Change password functionality
- View order history and status
- Users can write reviews for products
- Star rating system for products
- View all reviews for a product
- Admin moderation of reviews (approve/reject)
- Overview of key metrics (total products, users, orders, pending reviews)
- Quick access to product, user, order, and review management
- Analytics and reporting features (e.g., sales data, popular products)
- Mobile-friendly interface
- Consistent user experience across devices (desktop, tablet, mobile)
- Fast loading times with optimized assets
- Smooth transitions and animations
- Intuitive navigation with a clear information hierarchy
- Secure password hashing with bcrypt
- Protection against common web vulnerabilities (e.g., XSS, CSRF)
- CORS configuration to restrict API access
- Newsletter subscription option
- Social media integration (sharing products, following store accounts)
- Related products suggestions
- New arrivals and featured products sections
- Discount and promotion system (backend support, frontend display)
- Modular code structure for easy maintenance and feature additions
- Environment-based configuration for development and production setups
- Error logging and monitoring capabilities
The project is divided into two main parts:
client/
: Frontend application built with React and Viteserver/
: Backend API built with Node.js and Express
- React.js
- Vite (for build tooling)
- React Router (for navigation)
- Axios (for API requests)
- Tailwind CSS (for styling)
- React Icons
- @heroicons/react
- @react-oauth/google (for Google OAuth integration)
- @stripe/react-stripe-js and @stripe/stripe-js (for payment processing)
- Node.js
- Express.js
- MongoDB (with Mongoose ORM)
- JSON Web Tokens (JWT) for authentication
- bcryptjs for password hashing
- Passport.js for Google OAuth
- Docker
- Docker Compose
- Node.js (v14 or later) (if running without Docker)
- MongoDB (if running without Docker)
- npm or yarn (if running without Docker)
-
Clone the repository:
git clone https://github.com/ahsanch008/urbanstore.git cd urbanstore
-
Set up environment variables:
- For the frontend, create a
.env
file in theclient/
directory:VITE_API_URL=http://localhost:3000 VITE_GOOGLE_CLIENT_ID=your_google_client_id
- For the backend, create a
.env
file in theserver/
directory:PORT=3000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret SESSION_SECRET=your_session_secret
- For the frontend, create a
-
Ensure Docker and Docker Compose are installed on your machine.
-
Navigate to the project root directory and run:
docker-compose up --build
-
Open your browser and navigate to
http://localhost:5173
to view the application.
-
Start the backend server:
cd server npm run dev
-
In a new terminal, start the frontend development server:
cd client npm run dev
-
Open your browser and navigate to
http://localhost:5173
to view the application.
POST /auth/signup
: Register a new userPOST /auth/login
: Login userGET /auth/google
: Initiate Google OAuth loginGET /auth/google/callback
: Google OAuth callbackGET /auth/logout
: Logout user
GET /users/profile
: Get user profilePUT /users/:id
: Update user profilePUT /users/change-password
: Change user passwordPOST /users/wishlist
: Add product to wishlistDELETE /users/wishlist/:productId
: Remove product from wishlistGET /users/wishlist
: Get user's wishlist
POST /products
: Create a new productGET /products
: Get all productsGET /products/:id
: Get a specific productPUT /products/:id
: Update a productDELETE /products/:id
: Delete a product
POST /orders
: Create a new orderGET /orders
: Get all orders for a userGET /orders/:id
: Get a specific orderPUT /orders/:id/status
: Update order status
POST /reviews
: Create a new reviewGET /reviews/product/:productId
: Get reviews for a productPUT /reviews/:id
: Update a reviewDELETE /reviews/:id
: Delete a review