Skip to content

🦉 A public API for random Drake quotes + lyrics (Drake as a Service)

Notifications You must be signed in to change notification settings

devarshi-ap/drake.rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drake.rest
Drake

A public REST API for random Drake quotes + lyrics (Drake as a Service).

VercelBadge

Key Features • Usage • Tech Specs • A Blurb •

app-tutorial.mov

Key Features

  • API endpoints to serve random Drake quote(s) on request
    • GET /api/quotes/random
    • GET /api/quotes/all
    • GET /api/_info
      • idea: API's should have an endpoint dedicated to providing info about itself (much like man man in linux)
  • Twitter Widget for sharing quote
  • Beautiful UI (if i don't say so myself)
  • Dark/Light mode
  • Responsive Design

Usage

GET /api/quotes/random
{
    "quote": "Me and all the dogs acting like some dogs"
}
GET /api/quotes/all
{
    "quotes": [
        "Oh, who am I fooling?",
        // ...and so on
    ]
}
GET /api/_info
{
    "info": {
        "post": {
            "tally": 0,
            "endpoints": []
        },
        "get": {
            "tally": 3,
            "endpoints": [
                "/api/quotes/random",
                "/api/quotes/all"
                "/api/_info"
            ]
        },
        // ... and so forth
    }   
}

$ Dev. Setup

Ensure Git and Node.js (which comes with npm) are installed on your machine. From your command line:

# Clone this repo
$ git clone https://github.com/devarshi-ap/drake.rest.git

# Go into the repo
$ cd drake.rest

# Install dependencies
$ npm install

# Run the dev-server
$ npm run dev

Tech Specs

Here's the toolkit I chose, and my ratinoale as to why:


Nextjs
  • out-of-the-box routing for Pages & API endpoints which helps keep the workdir organized.
  • The GetStaticProps async function helps generate data on build-time also supports cache-control for the API responses
  • For the future, test out the Edge API Routes which are fast and smaller in size
  • Easy deployment to Vercel in a matter of seconds
TypeScript
  • enforces type-safety to all functions & variables, reducing chances of type errors
  • improves developer exp., refrence validation, and code maintainability
Tailwind CSS
  • although inline Tailwind styling can get really long at times, I visioned the design to be minimalist, thus, Tailwind was perfect simply because I am most familiar with it

A Blurb

💡 Project idea: Let this repo act as a template for a random <quote\general-string> generator!

  1. Clone this repo
  2. Change /json/quotes.json to include quotes from _, or a general set of strings.
  3. Update UI in index.tsx accordingly
  4. Deploy it and...💥 you're done!

This project was inspired from @ajzbc/kanye.rest

About

🦉 A public API for random Drake quotes + lyrics (Drake as a Service)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published