Skip to content

bsansouci/atdgen-workshop-starter

 
 

Repository files navigation

Atdgen Workshop Starter Project

Clone this repo to help you start the atdgen workshop.

Prerequisites

Install BuckleScript

npm init

# Install bs-platform
npm add bs-platform --dev

# Add runtime to be used by generated code
npm add @ahrefs/bs-atdgen-codec-runtime

# Create basic ReasonReact project
yarn bsb -init . -theme react-lite

We have compiled atdgen for you into a JavaScript file, you can view its documentation by running node bin/atdgen.js --help.

Suggested approach

Milestone 1

  1. Start the server by running yarn src/Server.bs.js
  2. Write a function to fetch the localhost:8000/refdomains endpoint
  3. Add Refdomains.re file and define type like this:
    tbd
    
  4. Use bs-json to decode JSON into your Refdomains.t type
  5. Create Index.re to be your client app entry point
  6. Write logic to display referring domains

Milestone 2

  1. Write refdomains.atd file
  2. Use generated Refdomains_bs module to decode the response

Milestone 3

  1. Use generated Refdomains_bs module to decode the API response and encode it to return to client

About

Starter project for ReasonConf atdgen workshop

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.8%
  • OCaml 12.3%
  • HTML 1.6%
  • C++ 0.3%