Skip to content

PathwayAPI is designed to help users create, manage and track personalized roadmaps breaking them down into manageable steps

Notifications You must be signed in to change notification settings

ricardoliveira5ro/PathwayAPI

Repository files navigation

PathwayAPI

PathwayAPI is a robust and flexible RESTful API designed to help users create, manage, and track personalized roadmaps for achieving various goals. It enables users to follow predefined roadmaps or create their own custom plans, breaking them down into manageable steps with detailed descriptions, deadlines, and progress tracking.

pathwayapi.onrender.com/api/v2/ hosts a public instance of the API.

Warning

The first request may take up to 60 seconds due to tier restrictions. (Subsequent requests will be normalized)


🚀 Getting Started

This section will guide you through using PathwayAPI, including how to authenticate and access the available features.

🔐 Authentication / Authorization

Each endpoint requires prior authentication based on bearer token. This token can be obtained after signing up and/or logging in as returned header. The token has 30 days expiration date.

POST /signup

{
    "user": {
        "email": "[[email protected]]",
        "password": "[your-password]",
        "name": "[your-username]"
    }
}

POST /login

{
    "user": {
        "email": "[[email protected]]",
        "password": "[your-password]"
    }
}

In the response headers you will see you got your authorization token that will be needed in every request you make to the available endpoints.

📍 Endpoints

GET /roadmaps
GET /roadmaps?per_page=2&page=1 (paginate response)
GET /roadmaps/:id

DELETE /roadmaps/:id

POST /roadmaps
PUT /roadmaps/:id

{
    "roadmap": {
        "title": "First Roadmap",
        "description": "First description of the new roadmap",
        "category_ids": [2,6],
        "steps_attributes": [
            {
                "title": "First Step",
                "description": "First Step Description",
                "order": 1
            }
        ]
    }
}

steps_attributes is optional and in update action (PUT /:id) it appends to existent steps, it does not override unlike the other fields

GET /roadmaps/:id/steps
POST /roadmaps/:id/steps

{
    "step": {
        "title": "Step title",
        "description": "Step description",
        "order": 1
    }
}

POST /roadmaps/:id/steps/batch_steps

{
    "steps": [
        { "title": "Step 1", "description": "Description 1", "order": 1 },
        { "title": "Step 2", "description": "Description 2", "order": 2 },
        { "title": "Step 3", "description": "Description 3", "order": 3 }
    ]
}

GET /categories
GET /categories/:id


GET /steps/:id
PUT /steps/:id

{
    "step": {
        "title": "Step title",
        "description": "Step description",
        "order": 1
    }
}

POST /steps/:id/tracker

{
    "tracker": {
        "completed": true
    }
}

💻 Technical Details

This section is for the developers who want to explore the technical characteristics of the API.

🛠️ Tech stack

  • Ruby (v3)
  • Ruby on rails (v7)
  • Postgresql
  • devise (gem)
  • devise-jwt (gem)
  • will_paginate (gem)

🚀 Run

  • Run bundle install
  • Create the user/role in your local postgres database
  • Edit your database.yml to include your local database information provided by your keys in credentials.yml.enc
  • Run rails db:create and rails db:migrate (every time there is a change in your schema)
  • Edit your seeds.rb file to include any preloaded data and run run db:seed
  • Start the server rails s

💭 Considerations

  • Postgre database hosted in neon.tech
  • Webservice hosted in render.com
  • All endpoints were tested with Postman

About

PathwayAPI is designed to help users create, manage and track personalized roadmaps breaking them down into manageable steps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published