Skip to content

jamj2000/nxapi-shop

Repository files navigation

API Shop

This is a simple API for a shop application.

API Shop

Models

  • User
  • Product
  • ProductImage

ER Diagram

Data

  • users.json
  • products.json
  • product_images.json

Endpoints

  • POST /api/products

  • GET /api/products

  • GET /api/products/:idOrSlug

  • GET /api/products/all/:term

  • PATCH /api/products/:id

  • DELETE /api/products/:id

  • POST /api/auth/register

  • POST /api/auth/login

  • GET /api/auth/check-status

Tech Stack

  • Next.js
  • Prisma
  • Postgres

Setup

  1. Clone the repository
git clone https://github.com/jamj2000/nxapi-shop.git
  1. Install dependencies
cd  nxapi-shop 
npm install
  1. Configure DATABASE_URL in .env
cp .env.example .env

Edit .env file and add your DATABASE_URL

  1. Set up the database
npx prisma db push
  1. Run the seed
npm run seed
  1. Start the development server
npm run dev

Build

npm run build
npm run start

Inspiration

This project was inspired by nest-teslo-shop developed by Fernando Herrera using the NestJS framework.

My project uses NextJS instead of NestJS.😉

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

API for Shop (Prisma, Postgres, Swagger)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published