npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

next-prisma-tailwind-ecommerce

v1.0.0

Published

![Screenshot](https://github.com/Accretence/next-prisma-tailwind-ecommerce/assets/45223699/00444538-a496-4f90-814f-7e57a580ad17)

Downloads

47

Readme

Screenshot

👋 Introduction

Welcome to the open-source Next.js E-Commerce Storefront with Admin Panel project! This project is built with TypeScript, Tailwind CSS, and Prisma, providing a powerful and flexible solution for building and managing your e-commerce website.

🥂 Features

  • [x] Next.js 13 App Router and React Server Components.
  • [x] Custom dynamic Sitemap.xml generation.
  • [x] Admin dashboard with products, orders, and payments.
  • [x] File uploads using next-cloudinary.
  • [x] Authentication using middleware.ts and httpOnly cookies.
  • [x] Storefront with blog, products, and categories.
  • [x] Database-Stored blogs powered by MDX templates.
  • [x] Email verification and invoices using react-email-tailwind-templates.
  • [x] TailwindCSS for utility-first CSS.
  • [x] UI built with Radix and stunning UI components, all thanks to shadcn/ui.
  • [x] Type-Validation with Zod.
  • [x] Next Metadata API for SEO handling.
  • [ ] Comprehensive implementations for i18n.

🔐 Authentication

The authentication is handled using JWT tokens stored in cookies and verified inside the middleware.ts file. The middleware function takes in the HTTP request, reads the token cookie and if the JWT is successfully verified, it sets the X-USER-ID header with the userId as the value, otherwise the request is sent back with 401 status.

👁‍🗨 Environment variables

Environment variables are stored in .env files. By default the .env.example file is included in source control and contains settings and defaults to get the app running. Any secrets or local overrides of these values should be placed in a .env file, which is ignored from source control.

Remember, never commit and store .env in the source control, just only .env.example without any data specified.

You can read more about environment variables here.

🏃‍♂️ Getting Started Locally

Clone the repository.

git clone https://github.com/accretence/next-prisma-tailwind-ecommerce

Navigate to each folder in the apps folder and and set the variables.

cp .env.example .env

Get all dependencies sorted.

yarn install

Bring your database to life with pushing the database schema.

yarn db:push
yarn dev

🔑 Database

Prisma ORM can use any PostgreSQL database. Supabase is the easiest to work with. Simply set DATABASE_URL in your .env file to work.

yarn db

This project exposes a package.json script for accessing prisma via yarn db:<command>. You should always try to use this script when interacting with prisma locally.

Making changes to the database schema

Make changes to your database by modifying prisma/schema.prisma.

🛸 How to Deploy the Project

Follow the deployment guides for Vercel, Netlify and Docker for more information.

📄 License

This project is MIT-licensed and is free to use and modify for your own projects. Check the LICENSE file for details.

Created by Amirhossein Mohammadi.