# Nestling: a pijul frontend a la cgit

**URL:** <https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27>\
**Category:** Community\
**Created:** [June 2, 2017, 2:01pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27 "2017-06-02T14:01:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [June 2, 2017, 2:01pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/1 "2017-06-02T14:01:11Z")

</div>

As some of you may have noticed, I have started to work on a pijul frontend “a la cgit” a few days ago. You can found it [on the Nest](https://nest.pijul.com/lthms/nestling) and I am planning to use the Nestling to browser the Nestling as soon as possible (this is so meta).

Of course, the Nestling is not an opponent of any sort of the Nest, which still is the best tool available to collaborate to write a software with pijul. The Nestling is a _read-only_ front-end and nothing more.

## Current Features

### Server

The server is written in Rust using [rocket](https://rocket.rs).

- `ndrc.toml` file for configuration
- One server, multiple repositories
- Several `GET` routes
  - one to get the list of repositories
  - one to get the list of branches of a given repo
  - one to get the list of patch hashes of a given branch of a given repo
  - one to get the patch info of a given hash

### WebUI

The webUI is written in Purescript using Halogen.

- A view to list the patches of a repository, with a branch selector
  - Rely on avatar to display a picture of an author
  - A patch can be selected to display only its dependencies

## Future Work

There are still a lot of work to do. Before a first `v0.1`, I am planning to add a view to list the repositories and a view to visualize a patch alone. In a `v0.2`, I will tackle files browsering. Then, I intend to play a little with metrics of all sort.

The project is GPL3, so if you’d like to contribute, feel free to ping me on the `#pijul` irc channel.

## Pictures

### Patch Dependencies

 ![Patch Dependencies View](https://yyz1.discourse-cdn.com/flex031/uploads/pijul/original/1X/60f91e30b79503773c42dbd51d02ba970a3542f0.jpg)

---

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [June 15, 2017, 10:23pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/2 "2017-06-15T22:23:40Z")

</div>

I just updated the nestling [README](https://nest.pijul.com/lthms/nestling/ef4f1db68ca283d202). You now have a how-to setup a nestling instance.

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 19, 2017, 12:08am UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/3 "2017-06-19T00:08:33Z")

</div>

So I just did `pijul clone laumann@nest.pijul.org:lthms/nestling` (no problems there) and did:

```auto
$ make
make[1]: Entering directory `/home/tj/pijul/nestling/nestlingd'
../print.mk:3: *** commands commence before first target. Stop.
make[1]: Leaving directory `/home/tj/pijul/nestling/nestlingd'
make: *** [daemon] Error 2

```

I have all dependencies (AFAICT) - what am I missing?

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 19, 2017, 12:13am UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/4 "2017-06-19T00:13:33Z")

</div>

If I uncomment the `include ../print.mk` line in `nestlingd/Makefile` it seems to work…

EDIT: Also in `nestling-ui/Makefile`. Maybe my problem a too old `make` (I’m on 3.81)?

---

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [June 19, 2017, 9:08am UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/5 "2017-06-19T09:08:15Z")

</div>

Does it work if you call `make` from the the root of the repository?

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 21, 2017, 3:14am UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/6 "2017-06-21T03:14:43Z")

</div>

No, that’s what didn’t work. Just removing the `include ../print.mk` lines made it work though (and I needed to install bower)

---

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [June 21, 2017, 8:04am UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/7 "2017-06-21T08:04:03Z")

</div>

That’s strange, I will need to investigate somehow. That being settled, you were able to make it work?

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 21, 2017, 4:38pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/8 "2017-06-21T16:38:36Z")

</div>

My version of make may be too old (3.81). I got it running, but having some trouble with the cross-site thing - I tried Firefox and Chromium (the former with the CorsE add-on), but no luck so far.

Otherwise both the UI and backend seem to be running nicely 🙂

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 28, 2017, 5:08pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/9 "2017-06-28T17:08:21Z")

</div>

Screenshot of nestling running on my machine

 ![](https://canada1.discourse-cdn.com/flex031/uploads/pijul/original/1X/f1602d32ca921af731bf6bd02a05153203b4b809.png)

I still need to figure out the XSS/CORS thing…

---

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [June 28, 2017, 8:11pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/10 "2017-06-28T20:11:40Z")

</div>

Can you copy paste both your `ndrc.toml` and you `api-infos.json`?

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 28, 2017, 8:14pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/11 "2017-06-28T20:14:45Z")

</div>

Sure:

`nrdc.toml`:

```auto
title = "My Nest"

[repos.nestling]
name = "nestling"
path = ".."

```

and `api-infos.json`:

```auto
{
  "base": "http://localhost",
  "port": 8000,
  "mount": ""
}

```

---

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [June 28, 2017, 9:15pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/12 "2017-06-28T21:15:12Z")

</div>

And what does the javascript console say?

---

<div class="post-metadata">

**Author:** ![laumann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/laumann/32/8_2.png) [@laumann](https://discourse.pijul.org/u/laumann)\
**Post date:** [June 28, 2017, 9:24pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/13 "2017-06-28T21:24:41Z")

</div>

The console

```auto
BranchSelector: fetching branches now
PatchesList: fetching patches now
:8001/#r/nestling/branch/master:1 XMLHttpRequest cannot load http://localhost:8000/repository/nestling/branches. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8001' is therefore not allowed access.
Uncaught Error: AJAX request failed: GET http://localhost:8000/repository/nestling/branches
    at XMLHttpRequest.xhr.onerror (nestling.js:10842)
:8001/#r/nestling/branch/master:1 XMLHttpRequest cannot load http://localhost:8000/repository/nestling/branch/master/patches. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8001' is therefore not allowed access.

```

---

<div class="post-metadata">

**Author:** ![lthms](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/lthms/32/124_2.png) [@lthms](https://discourse.pijul.org/u/lthms)\
**Post date:** [September 6, 2017, 8:30pm UTC](https://discourse.pijul.org/t/nestling-a-pijul-frontend-a-la-cgit/27/14 "2017-09-06T20:30:39Z")

</div>

Sorry for the late response.

I am pretty sure you have an issue which is CORS-related. This is really annoying and I really need to dig this. For the record, I have cleaned my repository on the nest. I had some issue with duplicated patches and probably vicious unrecords but everything is fine now.

Hope I will be able to make some progress on nestling really soon.
