A RESTful API for an E-commerce platform built with Hono.js, Postgres, Prisma, and Bun.
- 🔐 JWT Authentication
- 👤 User Management
- 🛍️ Product Management
- 🛒 Shopping Cart Operations
- 📦 PostgreSQL Database with Prisma ORM
- Bun
- PostgreSQL Database
- Clone the repository
- Copy
.env.exampleto.envand configure your environment variables: - Install dependencies
npm install
- Run database migrations
bunx prisma migrate dev
- Seed the database:
bunx prisma db seed
- Start the development server
npm run dev
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register new user |
| POST | /auth/login |
User login |
| GET | /auth/me |
Get current user |
| POST | /auth/logout |
Logout user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /users |
Get all users |
| GET | /users/:id |
Get user by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /products |
Get all products |
| GET | /products/:id |
Get product by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /cart |
Get user's cart |
| POST | /cart/items |
Add item to cart |
| PATCH | /cart/items/:id |
Update item quantity |
| DELETE | /cart/items/:id |
Remove item from cart |