https://github.com/budiigunawan/bambino-backend
API for Bambino, a simple and user-friendly e-commerce platform built to sell baby clothes.
https://github.com/budiigunawan/bambino-backend
e-commerce example-project hono postgres postgresql prisma zod
Last synced: 5 months ago
JSON representation
API for Bambino, a simple and user-friendly e-commerce platform built to sell baby clothes.
- Host: GitHub
- URL: https://github.com/budiigunawan/bambino-backend
- Owner: budiigunawan
- Created: 2024-07-10T03:04:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-30T10:04:42.000Z (almost 2 years ago)
- Last Synced: 2025-04-05T01:41:20.401Z (about 1 year ago)
- Topics: e-commerce, example-project, hono, postgres, postgresql, prisma, zod
- Language: TypeScript
- Homepage: https://bambino-api.budigunawan.com/
- Size: 543 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bambino API
API for Bambino, a simple and user-friendly e-commerce platform built to sell baby clothes.
## API Specification
### Register
### Login
Request :
- Method : POST
- Endpoint : `/login`
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
```json
{
"email": "string",
"password": "string"
}
```
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"token": "string"
}
}
```
### Authentication
All API below must use this authentication
Request :
- Header :
- Authorization: "Bearer {token}"
### Create Product
Request :
- Method : POST
- Endpoint : `/products`
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
```json
{
"name": "string",
"price": "integer",
"imageUrl": "string",
"categoryId": "string",
"slug": "string",
"sku": "string",
"overview": "string",
"materials": "string"
}
```
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"id": "string",
"name": "string",
"price": "integer",
"imageUrl": "string",
"categoryId": "string",
"slug": "string",
"sku": "string",
"overview": "string",
"materials": "string"
}
}
```
### Get Products
Request :
- Method : GET
- Endpoint : `/products?page=1&limit=10&q={name}`
- Header :
- Content-Type: application/json
- Accept: application/json
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"totalData": "integer",
"totalPage": "integer",
"products": [
{
"id": "string",
"name": "string",
"price": "integer",
"imageUrl": "string",
"categoryId": "string",
"slug": "string",
"sku": "string",
"overview": "string",
"materials": "string"
}
]
}
}
```
### GET Product by id
Request :
- Method : GET
- Endpoint : `/products/{id}`
- Header :
- Content-Type: application/json
- Accept: application/json
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"id": "string",
"name": "string",
"price": "integer",
"imageUrl": "string",
"categoryId": "string",
"slug": "string",
"sku": "string",
"overview": "string",
"materials": "string"
}
}
```
### Update Product
Request :
- Method : PUT
- Endpoint : `/products/{id}`
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
```json
{
"name": "string",
"price": "integer",
"imageUrl": "string",
"categoryId": "string",
"slug": "string",
"sku": "string",
"overview": "string",
"materials": "string"
}
```
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"id": "string",
"name": "string",
"price": "integer",
"imageUrl": "string",
"categoryId": "string",
"slug": "string",
"sku": "string",
"overview": "string",
"materials": "string"
}
}
```
### Delete Product
Request :
- Method : DELETE
- Endpoint : `/products/{id}`
- Header :
- Accept: application/json
Response :
```json
{
"code": "number",
"status": "string"
}
```
## Database Design

## Links
- Production:
- Swagger:
## Tech Stacks
- [Bun](https://bun.sh/)
- [Hono](https://hono.dev/)
- [Typescript](https://www.typescriptlang.org/)
- [PostreSQL](https://www.postgresql.org/)
- [Prisma](https://www.prisma.io/)
- [Zod](https://hono.dev/examples/zod-openapi)
- [SwaggerUI](https://hono.dev/examples/swagger-ui)
## Getting Started
To install dependencies:
```sh
bun install
```
To run:
```sh
bun run dev
```
open http://localhost:3000