Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/terieyenike/imagen-server

Express.js API designed to deliver random prompts seamlessly.
https://github.com/terieyenike/imagen-server

cors dotenv expressjs openai prisma xata

Last synced: 4 days ago
JSON representation

Express.js API designed to deliver random prompts seamlessly.

Awesome Lists containing this project

README

        

# DALL.E Prompt Generator API

Introducing an Express.js API designed to deliver random prompts seamlessly. With Prisma as the ORM for efficient database interaction, this API comes equipped with dedicated routes for convenient retrieval.

## Features

- Obtain a random prompt
- Manage prompts using RESTful routes
- Set up a basic server with Express.js
- Support for environment variables with dotenv
- Enable Cross-Origin Resource Sharing (CORS)

## Technologies

- Express.js: A web application framework for Node.js designed to build RESTful APIs.
- Xata: A serverless database utilized for data storage.
- Prisma: An ORM (Object-Relational Mapping) tool for interacting with databases.
- OpenAI: Provides an API for generating images based on textual prompts.

## Environment variables

Create a `.env` file in the root of the project and add the following variables:

```bash
OPENAI_API_KEY="Your OpenAI key"
DATABASE_URL="postgresql://:@.sql.xata.sh:5432/:?sslmode=require"
SHADOW_DATABASE_URL="postgresql://:@.sql.xata.sh:5432/:?sslmode=require"
```

To set up [Prisma with Xata's Postgres service](https://xata.io/blog/prisma-postgres-xata-integration)

Feel free to modify the content as per your specific project details and preferences.

## Learn more

- [Prisma documentation](https://www.prisma.io/docs)

- [Get started with Xata](https://xata.io/docs)

[CLIENT CODE](https://github.com/Terieyenike/imagen-pxcc-client)