Giter VIP home page Giter VIP logo

itembase's Introduction

Itembase

This Next.js 13 application serves as a custom REST API for managing items. It utilizes Prisma as the ORM for database interactions and connects to a PostgreSQL database. The project is developed using TypeScript and follows linting rules with ESLint.

Technology Stack

  • Next.js 13: A React framework with server-side rendering and other features.
  • Prisma: An Object-Relational Mapping (ORM) tool for database access.
  • PostgreSQL: A relational database for storing item-related data.
  • TypeScript: A superset of JavaScript that adds static types to the language.
  • ESLint: A pluggable linting utility for JavaScript and TypeScript.

Cache and Rate Limiting

  • Redis: Utilized as a distributed cache to enhance performance and scalability.
  • Rate Limiter: Implements a basic rate limiter to control the frequency of API requests.

Testing

  • Cypress: Used for end-to-end testing of the application.

API Functionality

The API provides the following key functionalities for managing items:

  • Read Operation:

    • Endpoint: GET /items

    • Description: Retrieves information about items.

    • Query Parameters: - limit (optional): Specifies the maximum number of items to retrieve. - offset (optional): Specifies the number of items to skip for pagination. - search (optional): Performs a search for items based on a provided search term.

  • Create Operation:

    • Endpoint: POST /items

    • Description: Creates a new item.

    • Request Payload:

      • Type: Object containing a name property and an optional message property.
      {
        "name": "New Item",
        "message": "Creation of a new item requested."
      }
  • Bulk Delete Operation:

    • Endpoint: DELETE /items

    • Description: Deletes multiple items in a bulk operation.

    • Request Payload:

      • Type: Array of itemIds to delete.
      {
        "itemIds": [123, 456, 789]
      }
  • Bulk Update Operation:

    • Endpoint: PUT /items

    • Description: Updates multiple items in a bulk operation.

    • Request Payload:

      • Type: Object containing an array of itemIds and a message.
      {
        "itemIds": [123, 456, 789],
        "message": "Bulk update of items requested."
      }
  • Read Individual Item:

    • Endpoint: GET /items/:id
    • Description: Retrieves information about a specific item.
  • Update Individual Item:

    • Endpoint: PUT /items/:id
    • Description: Updates information for a specific item.
  • Delete Individual Item:

    • Endpoint: DELETE /items/:id
    • Description: Deletes a specific item.

Use Cases

  • Efficiently manage items with comprehensive CRUD operations.
  • Perform bulk operations for enhanced efficiency when working with multiple items.
  • Utilize search functionality to retrieve specific items based on defined criteria.

Getting Started

  1. Clone the repository.
  2. Install dependencies using npm install.
  3. Configure your PostgreSQL database connection in the Prisma configuration.
  4. Run the application using npm run dev.
  5. Access the API at http://localhost:3000.

Development

  • TypeScript is used for type-safe development.
  • ESLint is configured to ensure code quality and adherence to coding standards.

License

This project is licensed under the MIT License.

itembase's People

Contributors

jarrodsampson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.