This project is a basic ecommerce template that demonstrates a fullstack Harper powered Next.js application.
Harper provides the backend database, API, caching, and a server to run the Next.js frontend on. The same patterns in this code can be used to run any app that requires dynamic data and/or caching.
Almost 2% of global ecommerce sales flow through Harper Systems, with an average p95 latency of 1.12ms across early hints, redirects, and product page lookups for real-world e-commerce applications. See the LCP stats for yourself by opening the Chrome devtools performance tab on our live demo.
- Install Harper:
npm install -g harperdb
- Clone this repository and change directory in your terminal to the code
- Run
npm i
- Run
npm run dev
- View the frontend at localhost:9925
- View the data in Harper Studio UI at localhost:9926
- Run
cp .env.template .env
- Get keys from Algolia and / or OpenAI and add to the .env file
- Restart the application
For more information about getting started with Harper and building your Next.js applications, see our getting started guides and documentation.
This template includes the default configuration, which specifies how files are handled in your application.
The schema.graphql is the schema definition. This is the main starting point for defining your database schema, specifying which tables you want and what attributes/fields they should have.
The resources.js provides a template for defining JavaScript resource classes, for customized application logic in your endpoints. This repo comes with sample product data in a json file.