Xest Framework

website·Indexed 31 days ago

https://xestjs.com

A light-weight JavaScript API framework built by Cyprus Codes for building REST APIs. It features a dedicated CLI for bootstrapping projects, an endpoint generator, seed data generation, and a query interface that supports SQL. Xest includes built-in support for MySQL via Docker, Yup schema validation, and a customizable React UI companion called xest-ui/data-table.

Tokens
17.4K
Snippets
84
Records
134
Agent score
50%

What's inside Xest

  1. Overview of Xest Javascript API Framework

    Xest is a lightweight JavaScript framework designed for rapid development of REST APIs. It is built on top of Node.js, Express.js, MySQL, and Docker. The framework includes a dedicated Xest CLI to streamline the generation of API endpoints, database queries, and other boilerplate components.
  2. Overview of Xest API Boilerplate

    Xest is an opinionated Express API boilerplate designed to help developers get productive quickly. It provides a pre-configured environment for managing local development workflows via Docker, testing API endpoints, managing database migrations, and interacting with databases using SQL query helpers and decorators.
  3. Overview of Xest API Boilerplate

    Xest is an opinionated Express API boilerplate designed for rapid development and reliability. It provides a pre-configured environment for managing local development workflows via Docker, testing API endpoints, managing database migrations, and interacting with databases using SQL query helpers and decorators.
  4. Overview of the Xest API Framework

    Xest is a lightweight JavaScript API framework built by Cyprus Codes, designed for rapid REST API development. It is built on top of Express.js and follows a "convention over configuration" philosophy, providing sane defaults for local development, testing, and deployment to reduce manual configuration and development time.
  5. Xest Framework Overview

    Xest is a framework designed for rapid development of REST APIs. It provides a zero-config experience with pre-configured development, test, and deployment pipelines, allowing developers to focus on application logic rather than infrastructure setup.
  6. Xest Project Structure Overview

    A bootstrapped Xest project includes the following key files for local development:

    • docker-compose.yml: Configuration for the local development environment (starts a MySQL container).
    • database/database-schema.sql: SQL CREATE TABLE statements used to populate the local database.
    • database/seed-data.sql: Test data for local development and testing.
    • src/: Directory containing core API files.
  7. Manage MySQL databases in Xest via Docker

    Xest framework runs MySQL within Docker, eliminating the need for a separate MySQL installation on the development machine. The database is automatically architected and populated with seed data from database-schema.sql and seed-data.sql files whenever the project is started using the xx run or xx fresh commands.
    xx run
    # OR
    xx fresh
  8. Understand the XestJS architectural file structure

    Xest follows a specific data flow pattern: routes > controllers > actions > queries.

    • Router: Directs incoming requests to the appropriate controller.
    • Controller: Acts as the application brain; responsible for validating incoming request formats and returning responses to the client.
    • Action: Contains the business logic and interacts with the database. Actions can be shared across multiple controllers.
    • Query: SQL query files that use submitQuery and database helpers to communicate with the database. These can be called directly or wrapped within action modules.
  9. Implement a CRUD endpoint flow in XestJS

    To implement a read, create, update, or delete operation in XestJS, follow a three-tier architecture:

    1. Query Function: Handles the direct database interaction (SQL).
    2. Action: Orchestrates the business logic and calls the query functions.
    3. Controller: Handles the HTTP request/response cycle, extracts data from the request body, and invokes the action.

    These layers are connected by importing the query into the action, and the action into the controller.

  10. XestJS Framework Overview

    XestJS is a framework designed for rapid API development. It is built on top of Node.js and Express.js and provides seamless integration with MySQL and Docker. The framework is designed for a low learning curve, allowing developers to focus on API design and development without unnecessary complexity.
  11. Use Docker for Xest local development

    Xest framework utilizes Docker to manage the local development environment, specifically to run a MySQL container. This container is initialized using database-schema.sql and seed-data.sql. If these SQL files are modified, the local development environment can be restarted using the xx fresh command.
  12. Refresh MySQL database state after schema or seed changes

    When modifications are made to database-schema.sql (database architecture) or seed-data.sql (test data), the MySQL database container must be re-initialized. Running the refresh command restarts the Xest API project and recreates the MySQL docker container from the ground up to apply these changes.
    xx fresh