Skip to content

skiiyuru/changelog-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Changelog API

A robust REST API built with Express.js and TypeScript that manages product changelogs.

Technical Stack

  • Runtime: Node.js
  • Framework: Express.js
  • Language: TypeScript
  • Database: PostgreSQL with Prisma ORM
  • Authentication: JWT
  • Testing: Jest & Supertest
  • Validation: Express Validator
  • Logging: Morgan

Key Features

  • πŸ” Authentication & Authorization

    • JWT-based authentication
    • Password hashing with bcrypt
    • Protected routes with middleware
    • User-specific data access control
  • πŸ“ Resource Management

    • Products CRUD operations
    • Changelog updates with versioning
    • Update points for detailed tracking
    • Nested resource relationships
  • πŸ›‘οΈ Input Validation & Error Handling

    • Request body validation
    • Custom error handling middleware
    • Typed request/response with TypeScript
    • Structured error responses
  • 🎯 API Design

    • RESTful principles
    • Resource nesting
    • Query parameter support
    • Status code best practices

API Endpoints

Authentication

POST /register    # Create new user account
POST /signin     # Authenticate user and get token

Products

GET    /api/product           # List all products
POST   /api/product           # Create new product
GET    /api/product/:id       # Get product details
PATCH  /api/product/:id       # Update product
DELETE /api/product/:id       # Delete product

Updates

GET    /api/product/:p_id/update          # List updates
POST   /api/product/:p_id/update          # Create update
GET    /api/product/:p_id/update/:u_id    # Get update
PATCH  /api/product/:p_id/update/:u_id    # Modify update
DELETE /api/product/:p_id/update/:u_id    # Delete update

Getting Started

  1. Clone repository:

    git clone <repository-url>
  2. Install dependencies:

    pnpm install
  3. Set up environment:

    cp .env.example .env
    # Edit .env with your database credentials
  4. Initialize database:

    pnpm prisma migrate dev
  5. Start development server:

    pnpm dev

Testing

Run the test suite:

pnpm test

License

ISC

About

REST API built with Express.js and TypeScript that manages product changelogs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published