Code Monkey home page Code Monkey logo

Comments (16)

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

What I have in mind is something like this:

Right now doing a curl on the API root gives the website
image

Instead of giving the website, one can instead return a list of supported endpoints with some special properties which would indicate if that endpoint should be displayed in Athena. One can do both a website and JSON output using the accepts header or one can place the website in the root and the apis can start from https://api.canonn.tech/api/

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

Athena itself will run on https://canonn.tech the api itself will be on https://api.canonn.tech this is mainly due to limitations of Strapi not having a prefix option (it used to but was too broken so they removed it)

Until they re-add prefixes I can't do sub folder based proxying in Nginx, hence the split. Most likely what I will is create a model like navigation to allow us to use the Strapi Admin panel to edit this in production as Strapi is node based meaning all changes to the file system also required node to restart meaning I could knock my production API offline to update (even though in this case it would be a few milliseconds)

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

I may place it on athena-navigation in case we have any other specific Athena endpoints to create

from capiv2-strapi.

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

That would be fine too.

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

All I need to know is what the structure needs to look like @SayakMukhopadhyay I can customize the response structure no matter how I build the model.

Structure and fields required is all I need

from capiv2-strapi.

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

Right now, to start I need a few keys. So the structure of the response could be as such

[{
   endpoint: '<some way to denote the endpoint url>',
   title: '<some user friendly title for the endpoint>',
   athena: true|false
}, 
{...},
...
]

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

I take it for nested menus we also need a parent/child relationship yeah?

from capiv2-strapi.

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

Yeah, but I dont see where a nested menu would be feasible. I think all endpoints can be there own navigation element.

Or, instead of nested elements in the left hand nav bar, one can use tabs.

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

Tabs would also work too

from capiv2-strapi.

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

In that case, having a children key would suffice.

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

with the children just being an array of what specifically say types like: ["ap", "bm", "cs", ... ]

(Thinking in terms of apreports, bmreports, csreports to construct the api queries)

Or an array of objects that lists out the short code and full title of the tab

from capiv2-strapi.

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

An array of objects should be the way to go. One can flatten it if needed.

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

Alright that is what I shall do then. I'll get to work building the navigation model here this weekend

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

(I'll push it into our development server https://api.canonn.tech:2083)

from capiv2-strapi.

derrickmehaffy avatar derrickmehaffy commented on August 30, 2024

So here is the example structure based on the model I created:

[
    {
        "id": 1,
        "title": "Dashboard",
        "endpoint": "/",
        "enabled": true,
        "tabs": [
            {
                "id": 1,
                "title": "Test Tab",
                "code": "test"
            }
        ]
    }
]

from capiv2-strapi.

SayakMukhopadhyay avatar SayakMukhopadhyay commented on August 30, 2024

Dashboard is the root page in the website right? That would mean that its content would be different than that of the different sites right? In that case I think we should only have the sites in that response.
Also the structure itself looks good but got a couple of questions:

  1. What is enabled
  2. What is code and why doesn't the inner object have enabled and outer object doesnt have code?

from capiv2-strapi.

Related Issues (20)

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.