Welcome to Juadah API
Juadah is a bakery that utilizes the web as a platform for purchasing its products. The Juadah API provides a robust backend for managing products, orders, payments, and user authentication for an e-commerce bakery platform. Built with modern technologies and best practices, the API offers a complete solution for running an online bakery business with secure payments, image management, and comprehensive product catalog features.Quickstart
Get up and running with your first API call in minutes
Authentication Guide
Learn about JWT-based authentication with refresh tokens
API Reference
Explore all available endpoints and their parameters
Payment Integration
Integrate Midtrans payment processing for orders
Key features
The Juadah API comes with a comprehensive set of features designed for modern e-commerce operations:- Secure Authentication: JWT-based authentication system with refresh tokens for secure and seamless user sessions
- Product Management: Complete CRUD operations for bakery products with multi-image support via Cloudinary
- Payment Processing: Integrated Midtrans payment gateway for handling transactions securely
- Order Management: Track orders from creation to completion with transaction status updates
- User Roles: Role-based access control with admin and user permissions
- Email Verification: Built-in email verification system using Nodemailer
- Rating System: Allow customers to rate and review products
- Address Management: Support for multiple delivery addresses per user
- Input Validation: Robust request validation using Zod schemas
- Type Safety: Full TypeScript implementation for enhanced developer experience
- API Documentation: Built-in Swagger UI for interactive API exploration
What you’ll need
Before you begin working with the Juadah API, ensure you have the following:Required software
- Node.js: Version 20 or higher
- PostgreSQL: Database for storing application data
- npm: Package manager (comes with Node.js)
Required accounts and credentials
- Cloudinary Account: For image upload and management (sign up here)
- Midtrans Account: For payment processing (sign up here)
- Email Service: SMTP credentials for sending verification emails
Development tools (recommended)
- Postman or similar API testing tool
- Git: For version control
- Code editor with TypeScript support (VS Code recommended)
The API uses Prisma ORM with PostgreSQL. Make sure your database is properly configured before starting development.
Architecture overview
The Juadah API follows a clean, layered architecture:- Handlers: Process HTTP requests and responses
- Services: Contain business logic
- Repositories: Handle database operations via Prisma
- Middlewares: Handle authentication, validation, and request sanitization
- Schemas: Define and validate request/response structures using Zod