This is a Node.js e-commerce application built using Hono as the serverless framework and Prisma for interacting with the database and Firebase Auth for Authentication.
- Prerequisites:
- Node.js and npm (or yarn) installed on your system.
- Clone the repository:
git clone https://github.com/kofta999/hono-ecommerce.git cd hono-ecommerce - Install dependencies:
npm install
- Environment variables:
Create a
.envfile in the project root directory and add the following environment variables:
DATABASE_URL: URL of your database (e.g., for Prisma)JWT_SECRET: Secret key used for generating JSON Web Tokens (JWT)FIREBASE_API_KEY: Your Firebase project's API keyFIREBASE_AUTH_DOMAIN: Your Firebase project's authentication domainFIREBASE_PROJECT_ID: Your Firebase project IDFIREBASE_STORAGE_BUCKET: Your Firebase project's storage bucketFIREBASE_MESSAGING_SENDER_ID: Your Firebase project's messaging sender IDFIREBASE_APP_ID: Your Firebase project's application ID
- Database Setup:
- Run Prisma migrations to create the database schema:
npx prisma migrate dev
- (Optional) Seed the database with some initial data using Prisma seeds:
npx prisma seed dev
- Run Prisma migrations to create the database schema:
- Start the development server:
(or
npm run dev
yarn dev)
This will start the server on the port specified in the .env file (defaults to 3000).
- Access API documentation at
/reference