Skip to content

indahmutiah/nepak-point-api

Repository files navigation

Nepak Point API

Nepak Point API is the backend of Nepak Point's e-commerce personal project.

REST API Specification

  • Production: https://nepak-point-api.indahmutiah.com
  • Local: http://localhost:3000

Products:

Endpoint HTTP Description
/products GET Get all products
/products/:slug GET Get product by slug
/products POST Add new product
/products/:id DELETE Delete product by id
/products/:id PUT Update product by id

Auth:

Endpoint HTTP Permission
/users GET Public
/users/:username GET Public
/auth/register POST Public
/auth/login POST Public
/auth/me GET Authenticated
/auth/logout POST Authenticated
/cart GET Authenticated
/cart/items POST Authenticated
/cart/items/:id DELETE Authenticated
/cart/items/:id PUT Authenticated

Getting Started

Copy and edit .env file:

cp .env.example .env

Setup database:

# Run database only
docker:up

Install dependencies:

bun install

Migrate database and generate Prisma Client:

bun db:migrate
# prisma migrate dev

Seed initial products:

bun db:seed
# prisma db seed

Run development server:

bun dev
# bun run --hot src/index.ts

Open http://localhost:3000.

Production

Make sure the DATABASE_URL is configured in .env file for usage with Docker Compose.

If we need to build the Docker image:

bun docker:build
# docker compose up -d --build

If only run the Docker container:

bun docker:up
# docker compose up -d

Open http://localhost:3000.

About

Nepak Point -API is the backend of Nepak Point's e-commerce personal project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •