Key Features • Usage • Tech Specs • A Blurb •
app-tutorial.mov
- 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)
- idea: API's should have an endpoint dedicated to providing info about itself (much like
- Twitter Widget for sharing quote
- Beautiful UI (if i don't say so myself)
- Dark/Light mode
- Responsive Design
{
"quote": "Me and all the dogs acting like some dogs"
}
{
"quotes": [
"Oh, who am I fooling?",
// ...and so on
]
}
{
"info": {
"post": {
"tally": 0,
"endpoints": []
},
"get": {
"tally": 3,
"endpoints": [
"/api/quotes/random",
"/api/quotes/all"
"/api/_info"
]
},
// ... and so forth
}
}
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
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
- enforces type-safety to all functions & variables, reducing chances of type errors
- improves developer exp., refrence validation, and code maintainability
- 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
💡 Project idea: Let this repo act as a template for a random <quote\general-string> generator!
- Clone this repo
- Change /json/quotes.json to include quotes from _, or a general set of strings.
- Update UI in index.tsx accordingly
- Deploy it and...💥 you're done!
This project was inspired from @ajzbc/kanye.rest