/parkour-json

A concise, typed, and declarative way to implement a JSON API server.

Primary LanguageTypeScriptMIT LicenseMIT

Declarative JSON API Server Framework

The objective of ParkourJSON is to provide a concise, typed, non-verbose, and declarative way of implementing a JSON API server without the need for code generation (an unnecessary and annoying step).

A 'JSON API' in this sense is an API that:

  • Only responds to JSON-formatted requests.
  • Only responds with JSON-formatted responses.

Getting Started

Simply clone or fork this project.

Forking is recommended to allow for downstream merging of future improvements.

After cloning or forking, see the sample API implementation in the src directory.

How to Fork

To create a new project based on this framework, do not use the 'fork' feature of GitHub. Instead, follow these steps:

  1. On GitHub, create a new empty repository (let's call this the project repo).

  2. git clone the project repo locally and cd into it.

  3. Add this repository as an upstream remote to the local project repo clone, we will name the remote framework.:

      git remote add framework https://github.com/ParkourOps/parkour-json
    
  4. Create a local branch on the project repo clone called framework which will reflect the main branch of this repository.

      git fetch framework main
      
      git checkout -b framework --track framework/main
    
  5. Create the main branch on the project repo.

      git checkout -b main
    
      git push -u origin main
    
  6. Install the Node dependencies and get developing!

      npm install
    

Work to Do

In order of precedent:

  • Implement global middleware.

  • Implement an OPTIONS handler on all possible routes which should respond with concise representation of the API good enough to be used as user documentation.

  • Implement unit tests.

  • Implement functional tests.

  • Documentation!

  • Improve typing to further improve development experience.