Coder Social home page Coder Social logo

ryarturogi / random-quotes-generator-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 221 KB

This API allows you to generate random quotes based on a given input and language.

Home Page: https://random-quotes-generator-api.vercel.app/api/generate-quote

JavaScript 100.00%
api nextjs nextjsapi quote-generator quotes rest-api

random-quotes-generator-api's Introduction

Random Quote Generator API

This API allows you to generate random quotes based on a given input and language.

Getting Started

These instructions will help you to get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • A Vercel account
  • A GitHub or GitLab repository for the project
  • OpenAI API key
  • npm (comes with Node.js)

Installing

Clone the repository to your local machine
git clone https://github.com/ryarturogi/random-quote-generator-api.git

Go to the project directory
cd random-quote-generator-api

Install the dependencies
npm install

Set your OpenAI API key in the .env file
NEXT_PUBLIC_OPENAI_API_KEY: '<YOUR_API_KEY>',
NEXT_PUBLIC_OPENAI_API_URL: 'https://api.openai.com/v1/completions'

Start the server
npm run dev or yarn dev

The API will be available at http://localhost:3000/api/generate-quote.

Usage

  • Send a POST request to the /api/generate-quote endpoint with a JSON payload containing the input field and the language field.

  • The response will be a JSON object containing the generated quote.

Example

{
"quote": "The quote generated by the API",
"language": "english" // any languague
}

Deployment

To deploy the API to a production environment on Vercel, you should consider the following steps:

  • Connect your repository to your Vercel account
  • Set your OpenAI API key in the .env file as an environment variable in Vercel
  • Use a logging service such as Loggly or Splunk to collect and analyze the logs
  • Use a monitoring service such as New Relic or Prometheus to monitor the performance of the API

Built With

Authors

License

This project is licensed under the MIT License - see the [MIT]((https://github.com/ryarturogi/random-quote-generator-api/LICENSE) file for details

random-quotes-generator-api's People

Contributors

ryarturogi avatar

Watchers

 avatar

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.