A full-stack ecommerce platform for selling coffee and related products, built with Next.js, MongoDB, and a modern tech stack. This project delivers a seamless shopping experience with user authentication, cart functionality, and interactive UI components
- Full-Stack Architecture: Backend powered by Next.js API routes and database integration with MongoDB.
- Authentication: User login and registration with JWT-based authentication.
- Interactive UI: Built with reusable React components and styled for responsiveness.
- Forms and Validation: Smooth forms with
react-hook-form
and validation usingzod
andyup
. - Maps Integration: Location-based features powered by Leaflet and react-leaflet.
- Data Visualization: Charts and graphs using
recharts
. - User-Friendly Notifications: Toast messages with react-toastify.
The following scripts are defined in package.json
:
Script | Description |
---|---|
dev |
Start the development server. |
build |
Build the project for production. |
start |
Start the production server. |
lint |
Run ESLint to check code quality. |
Run any script using:
npm run <script-name>
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/alirezashn79/ecommerce-fullstack.git cd ecommerce-fullstack
-
Install dependencies:
npm install
-
Set up the environment variables: Create a
.env.local
file in the root directory and add the following:MONGO_URI=<Your MongoDB URI> JWT_SECRET=<Your JWT Secret> NEXT_PUBLIC_API_URL=<API Base URL>
-
Start the development server:
npm run dev
Your app will be available at http://localhost:3000.
src/
├── components/ # Reusable React components
├── pages/ # Next.js pages and API routes
├── hooks/ # Custom React hooks
├── models/ # Mongoose models for MongoDB
├── services/ # Services and API calls
├── utils/ # Helper functions and utilities
├── styles/ # Global and component-specific styles
public/ # Static assets (images, icons, etc.)
This project can be deployed using Vercel or any Node.js-compatible hosting service. To deploy:
- Push your code to a GitHub repository.
- Link your repository to Vercel.
- Add your environment variables in the Vercel dashboard.
- Deploy your project with a single click!
- Frontend: React, Next.js, TailwindCSS
- Backend: MongoDB, Next.js API routes
- Authentication: JWT, Cookies
- State Management: Zustand
- Forms: React Hook Form, Zod, Yup
- UI/UX Enhancements: AOS (Animations), React Modal, SweetAlert, Swiper
- Maps: Leaflet, React Leaflet
- Data Visualization: Recharts
Contributions are welcome! If you have ideas for new features or find a bug, feel free to:
- Open an issue.
- Fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
✨ Built with ❤️ and ☕ for coffee lovers everywhere. Happy shopping! 🛍️