This is a full-stack e-commerce application built with modern web technologies. It provides a platform for users to browse products, add them to their cart, manage wishlists, place orders, and for administrators to manage products and view analytics.
- User Authentication: Secure user registration and login.
- Product Catalog: Browse products by category, view product details, and search for products.
- Shopping Cart: Add products to the cart, update quantities, and remove items.
- Wishlist: Save products to a wishlist for later.
- Checkout: Process orders with a secure checkout flow.
- User Profile: Manage user information and view past orders.
- Admin Dashboard: (For administrators)
- Manage products (add, edit, delete).
- View orders.
- Access analytics and reports.
- Responsive Design: Optimized for various screen sizes.
Frontend:
- React
- Next.js
- TypeScript
- Tailwind CSS
- Shadcn/ui (for UI components)
Backend:
- Firebase (Authentication, Firestore Database, Storage)
Other:
- Zustand (for state management)
- Zod (for validation)
- Various utility libraries (e.g.,
clsx,date-fns)
To set up and run this project locally, follow these steps:
- Clone the repository:
git clone <repository-url>
cd <project-directory>- Install dependencies:
pnpm installor
npm installor
yarn install-
Set up Firebase:
- Create a Firebase project in the Firebase Console.
- Enable Firebase Authentication (Email/Password provider).
- Set up a Firestore database. Choose a location and start in production mode (you can adjust security rules later).
- Enable Firebase Storage.
- Copy your Firebase project configuration.
-
Configure environment variables:
- Create a
.env.localfile in the root of the project. - Add your Firebase configuration to this file:
- Create a
env
NEXT_PUBLIC_FIREBASE_API_KEY=YOUR_API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=YOUR_AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID=YOUR_PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=YOUR_STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=YOUR_MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID=YOUR_APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=YOUR_MEASUREMENT_ID
* If you have a different setup (e.g., using environment variables for the seed script), add those as well.
- Run the development server:
pnpm devor
npm run devor
yarn dev- Access the application: Open your browser and go to
http://localhost:3000.
To populate your Firestore database with sample data, you can use the seeding script:
- Ensure your Firebase project is set up and environment variables are configured.
- Run the seed script:
pnpm tsx scripts/seed-database.tsxor
npx tsx scripts/seed-database.tsx*Note: You might need to adjust the script if you have different data structures or requirements.*
We welcome contributions to this project! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure the code follows the project's style guidelines.
- Write tests for your changes (if applicable).
- Commit your changes with a clear and descriptive message.
- Push your branch to your fork.
- Create a pull request to the main repository.
Please ensure your pull request includes:
- A clear description of the changes.
- Any relevant screenshots or demos.
- References to any issues it resolves.
We will review your pull request and provide feedback. Thank you for your contribution!