Toolkit for building scalable web applications with TypeScript, React, Redux and Apollo-Client

Overview

TsToolbox

Toolkit for building scalable web applications with TypeScript, React, Redux and Apollo-Client (inspired by ReKit)

Build Status

Work in Progress

Experimental Tool

The tool follows an architectural style (see below) which might not meet your app architecture. If you have suggestions for generalization, please feel free to file an issue. Any discussion about the architecture is very welcome.

Command line tool to manage actions, reducers, components and apollo queries/mutations.

Typescript provides a great way for statical analysis of your application's code. When using typescript with react, redux and apollo-client however, additional code is necessary which can not be inferred by the typescript compiler. Writing this additional code can make development a little bit more complicated or slower.

You can use this tool to create/rename/move/delete those elements with all the necessary Typescript code.

Example of 'add-Action' task

Installation

yarn:

yarn add ts-toolbox --dev

npm:

npm install ts-toolbox --save-dev

Usage

Currently, the following tasks are supported:

  • add-action:
    • Arguments:
      • Path of UI Component
      • Action name

>ts-toolbox add-action ./app/components/my-component/ NewAction

  • If there is no file actions.ts in the specified path yet, this will create a new file with the following content:

    export const NEW_ACTION = "NEW_ACTION";
    interface NewAction {
        readonly type: typeof ActionTypes.NEW_ACTION;
    }
    export const createNewAction = (): NewAction => {
        return { type: ActionTypes.NewAction };
    };
    export type Action = NewAction;
    const ActionTypes = { NewAction: (<typeof NEW_ACTION>NEW_ACTION) };
    
  • If there is a action.ts in the specified path with the following content:

    export const EXISTING_ACTION = "EXISTING_ACTION";
    interface ExistingAction {
        readonly type: typeof ActionTypes.EXISTING_ACTION;
    }
    export const createExistingAction = (): ExistingAction => {
        return { type: ActionTypes.ExistingAction };
    };
    export type Action = ExistingAction;
    const ActionTypes = { ExistingAction: (<typeof EXISTING_ACTION>EXISTING_ACTION) }
    

    It will be modified to:

    export const EXISTING_ACTION = "EXISTING_ACTION";
    interface ExistingAction {
        readonly type: typeof ActionTypes.EXISTING_ACTION;
    }
    export const createExistingAction = (): ExistingAction => {
        return { type: ActionTypes.ExistingAction };
    };
    export const NEW_ACTION = "NEW_ACTION";
    interface NewAction {
        readonly type: typeof ActionTypes.NEW_ACTION;
    }
    export const createNewAction = (): NewAction => {
        return { type: ActionTypes.NewAction };
    };
    export type Action = ExistingAction | NewAction;
    const ActionTypes = { ExistingAction: (<typeof EXISTING_ACTION>EXISTING_ACTION), NewAction: (<typeof NEW_ACTION>NEW_ACTION) };
    
  • add-reducer: TBD

  • add-sub-reducer: TBD

Development setup

yarn install

Release History

  • 0.0.1
    • Work in progress

Meta

https://github.com/danielnikravesh

Contributing

Feel free to report issues, file change requests, fork the repository or start a pull request.

You might also like...

GraphQL-first boilerplate that scales with TypeScript + Node Express + Apollo GraphQL APIs.

graphql-typescript-boilerplate A boilerplate project for quickly building Graphql APIs and with typescript 🚀 Installation Install the dependencies: y

May 15, 2022

React Native, Typescript, Redux, Healthcare

React Native, Typescript, Redux, Healthcare

nicolab-app React Native project using Redux & typescript This project aims to be a solid foundation for React native applications. It provides a clea

Jun 7, 2022

🛡️ Dead-simple, yet highly customizable security middleware for Apollo GraphQL servers and Envelop 🛡️

🛡️ Dead-simple, yet highly customizable security middleware for Apollo GraphQL servers and Envelop 🛡️

GraphQL Armor 🛡️ GraphQL Armor is a dead-simple yet highly customizable security middleware for various GraphQL server engines. Contents Contents Sup

Jan 9, 2023

Node-cli-starter - Basic starter kit for building Node CLI applications with TypeScript.

node-cli-starter Minimal starter kit for building Node CLI applications with TypeScript. Getting Started To get started clone repo locally and run npm

May 17, 2022

Tutorial building UI5 applications with TypeScript.

Tutorial building UI5 applications with TypeScript.

ui5-typescript-tutorial - Learn App Development in UI5 and TypeScript Overview This brief (~1-2-hours) tutorial introduces developers to UI5 applicati

Nov 21, 2022

Set up and build a Node.js REST API using Typescript, Express, Mongoose with a maintainable and scalable structure.

Introduction Create a maintainable and scalable Node.js REST API with TypeScript, Express and Mongoose. The project structure is based on MVC and foll

Nov 18, 2022

Apollo - a JavaScript library to get real-time economic declarations such as inflation rates

Apollo is a JavaScript library to get real-time economic declarations such as inflation rates, unemployment rates or interest rates reported by governments or other entities.

Dec 10, 2022

Código de estudo da aula de graphl e apollo no youtube da rocketseat

GraphQL (meu aprendizado) O que é GraphQL uma ferramenta criada dentro do facebook, sendo uma linguagem de realização de query (operações de criação é

May 12, 2022

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.

💿 Advanced Remix Workshop Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this

Dec 9, 2022
Owner
Daniel Nikravesh
Senior React Developer | Next.js, Gatsby, JAMstack, Headles, Typescript, Graphql, Vercel, Netlify
Daniel Nikravesh
Simple shopping cart prototype which shows how React components and Redux can be used to build a friendly user experience with instant visual updates and scalable code in e-commerce applications.

This simple shopping cart prototype shows how React components and Redux can be used to build a friendly user experience with instant visual updates a

Ivan Kuznietsov 3 Feb 8, 2022
Next js boilerplate with redux toolkit, redux persist and axios

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jorge Alberto Villarreal Gongora 5 Apr 25, 2022
Trying 5 Redux Alternatives (Zustand, Recoil, Jotai, Rematch and Redux-Toolkit). Expalined on CoderOne Ytb channel

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Islem Maboud 5 Oct 3, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Next.js and Apollo-Client web application, designed for learning and real-world applicability.

NextJs Apollo Boilerplate Boilerplate for building applications using Next.js and Apollo This boilerplate is made for those who want to start a new pr

Youngjin Lim 9 Sep 4, 2022
T3 is a client-side JavaScript framework for building large-scale web applications

Box has migrated using react, webpack, and the latest version of ECMAScript for our frontend projects as of 2018. We no longer support chan

Box 1.6k Dec 8, 2022
A Serverless GraphQL Sample project using Apollo and Serverless Framework with TypeScript and Webpack.

Serverless GraphQL Boilerplate This is a base project with a structure that includes Serverless Framework, Apollo, TypeScript and Webpack. It can be d

Ravi Souza 5 Aug 23, 2022
A framewok for building efficient and scalable, cross-platform bots (WhatsApp, Discord, Telegram and more) in a single codebase

project... An over-engineered all-in-one bot framewok for building efficient and scalable bots. Yep that's not a typo u heard it right "scalable bots"

Shubham Badgujar 6 Dec 24, 2022