Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-duffel-app

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-duffel-app

Scaffolding a full-stack app with duffel SDK setup

  • 1.8.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

create-duffel-app

Work in progress!

TODO:

  • Improve README.md (this file and the ones inside the templates)
  • Audit package.json
  • Open-source
  • Add Python template (and possibly others!)

A scaffolding script to bootstrap a fullstack duffel app

The script will guide you through setting up a minimal fullstack application with Duffel API. At the end of the script, you will have:

  • A ready-to-go client and server that can talk to each other locally
  • A Duffel API SDK installed and configured with the provided access token
  • A code example demonstrating how to make a simple flight search using the Duffel API SDK

Boilerplate source:

Getting started

Get the right NodeJS version

If you use nvm, run nvm use. If you use asdf, run asdf install.

Install Yarn

Like all Duffel front-ends, this project uses yarn. If you don't already have it, nstall it globally with npm install --global yarn.

Start developing

yarn dev

This will start a typescript watcher that will regenerate index.js. The scaffold can be run by running node index.js or by linking the package with yarn, just like the following section.

Testing the generated app

Scaffold the sample app by running

# Within the create-duffel-app folder
yarn build && yarn link

# grant permission
chmod +x .yarn/bin/create-duffel-app

# Then on the destination folder
yarn create duffel-app

This will create an app with two folders: client and server. Then to run the server:

# - If express option is selected
yarn start:dev
# - if flask option is selected
chmod +x ./bin/setup.sh && ./bin/setup.sh
flask run

After this, the server will be running at http://localhost:3001.

Then to run the client, open a separate terminal and run

yarn start

Committing to the repository

To be able to publish the correct version to npm, this project is currently following Angular conventional commit message guidelines which is based on conventional commits. This commit message guideline allows the semantic-release GitHub action to be triggered.

CommitLint to the rescue

Before creating a commit you should run a husky hook which will check if the commit structure is valid or not. If you don't want to create the commit manually, you can use yarn commit which will use commitzen to help you out creating the message.

Client CI

Every time a commit is merged to main, a GitHub Action is run to analyse the commit messages with semantic-release and automatically update the current version to be deployed by following semantic versioning. When the deployment is complete, the action updates the package version, using Duffel's machine user (@duffel-bot) as the author, and this change will be automatically approved by the GitHub Action via the [autoapprove workflow] (../.github/workflows/autoapprove.yml).

Continuous Integration

  1. Developer opens pull request to main
  2. Pull request is merged
  3. GitHub Actions are triggered and the commits are analysed
    • if there's a breaking change, bump the major version
    • if there's a feature commit, bump the minor version
    • if there's a fix, bump the patch version
  4. Deploy the new version a. Publish to npm b. Create and push a git tag c. Publish a GitHub release with the relevant commits and descriptions
  5. After the release is published then a pull request is automatically created and approved via a GitHub Action to bump the package version

Keywords

FAQs

Package last updated on 22 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc