Git Product home page Git Product logo

rpc's Introduction

RPC

License Python Version Django Version Node Version Nuxt Version Vue Version

Web tool for the RFC Production Center

Development

Prerequisites

Getting Started

  1. Clone this repository locally.
  2. Clone the ietf-tools/datatracker repository into another directory. Check out the feat/rpc-api branch, start the Docker environment, and start the dev server.
  3. Continue using the steps for your preferred IDE:
  4. Create demo data if you have not already

Using VS Code

  1. Open the project in VS Code
  2. When prompted, in the lower right corner, click Reopen in container
  3. Wait for the devcontainer to initialize. (This can take a few seconds/minutes the first time)
  4. The editor will automatically open 2 side-by-side terminals, running both the backend API server and the client dev server.
  5. Open http://localhost:8088 in your browser and login using some Datatracker user.

Using Generic

  1. In a terminal, from the project root folder, run the command:
    docker/run
  2. Wait for the containers to initialize. (This can take a few seconds/minutes the first time)
  3. A tmux session will automatically be started with the backend API server running on the left and the client dev server running on the right.
  4. Open http://localhost:8088 in your browser and login using some Datatracker user.

Tips

  • The tmux default prefix binding is set to Ctrl+Space and mouse control is enabled by default.
  • If you exit tmux, you'll land in a normal zsh prompt. Type exit again to quit and stop the containers.

Commands

Django Backend API (/workspace)

  • Start Server: ./manage.py runserver 8001

Nuxt Client (/workspace/client)

  • Run Dev Server: npm run dev
  • Generate Production Build: npm run build

Create demo data

To create demo data, open an app container shell and run the management command

./manage.py create_demo_data

This requires that the Datatracker dev server be running.

To remove all data and start afresh, you can run

./manage.py purge --yes-im-sure

and all data in the RPC tool's database will be reset. The Datatracker will not be reset, but running create_demo_data again will work as intended.

APIs

This project uses two distinct HTTP APIs. Both are accessed using clients generated from OpenAPI specifications. The clients are generated using OpenAPI Generator.

Front-end to Back-end: rpctracker_api

This API is used by the Nuxt Client front end to communicate with the Django back end. This API is defined by this project through an OpenAPI specification in rpctracker_api.json. The API is implemented using the django-rest-framework and the spec is generated using drf-spectacular.

Back-end to Datatracker: rpcapi

This API is used by the Django back end to communicate with the Datatracker. It is implemented in the Datatracker code and described (as of Jan 2024) by a hand-written OpenAPI spec in rpcapi.json. The current version of the spec is fetched from the Datatracker's feat/rpc-api branch when starting this project's Docker environment. If the API is updated on the Datatracker side, you must manually copy the new rpcapi.json into the root of this project and update the clients as described in the next section.

Updating the API clients

If changes are made to the APIs, you will need to update the clients. If this includes changes to the Datatracker's rpcapi.json file you must first copy the new version of that file into this project's root. Then, from inside this project's Docker shell, run

./update-rpcapi

This uses OpenAPI Generator to regenerate rpctracker_api.json and builds both the API clients. It may take a minute or two. When it is done, restart the Django dev server. The Nuxt server normally picks up the changes automatically.

Cleanup

To fully tear down the containers created in either of the VS Code or Generic steps, run the following command from the project root folder:

docker/cleanall

Press Y to confirm.

rpc's People

Contributors

dependabot[bot] avatar holloway avatar jennifer-richards avatar ngpixel avatar rjsparks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.