Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Add higher HTTP requests per minute limit request form #14

Merged
merged 1 commit into from Aug 21, 2023

Conversation

michaeldev5
Copy link
Collaborator

@michaeldev5 michaeldev5 commented Aug 11, 2023

Introducing Enhanced Functionality to XCM API: DB Module and Email Sending Support

We're excited to announce significant upgrades to XCM API, also known as LightSpell⚡️.

1. Streamlined API Key Management with PostgreSQL:

Managing API keys is now effortless. Our new PostgreSQL database module securely associates each API key with a user, enhancing access control. Each user can now request a custom rate limit that will be associated with his API key in the database. To try this feature you need to setup PostgreSQL database.

MacOS tutorial:

  • Install PostgreSQL: Use a package manager like Homebrew to install PostgreSQL on your macOS system.

    brew install postgresql@14
    
  • Access postgres terminal

    psql postgres
    
  • Create a PostgreSQL Database with user:

    CREATE DATABASE yourdbname;
    CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';
    GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;
  • Update your .env file with following variables:

      DB_HOST=localhost
      DB_PORT=5432
      DB_USER=youruser
      DB_PASS=yourpass
      DB_NAME=yourdbname
    

2. Seamless Nodemailer and Gmail Integration:

Each user will receive a confirmation email after submitting a higher limit request form. Email example:
Screenshot 2023-08-20 at 19 39 26

All emails entered in the EMAIL_ADDRESS_RECIPIENT_ARR env value will receive an email after user submits the form. Email example:
Screenshot 2023-08-20 at 19 40 13

Sending authenticated emails is simplified with Nodemailer and Gmail. Follow this tutorial for a comprehensive guide on setting up Nodemailer with Gmail. Next update the .env with the obtained values:

EMAIL_ADDRESS_SENDER=sender@gmail.com - Email used for sending emails
EMAIL_ADDRESS_RECIPIENT_ARR=admin1@gmail.com,admin2@gmail.com - Email array used for receiving form submissions separated by coma
EMAIL_CLIENT_ID=
EMAIL_CLIENT_SECRET=
EMAIL_REDIRECT_URI=
EMAIL_REFRESH_TOKEN=

3. Other changes:

  • Update generate api key URL. New URL: /app/generate-api-key
  • Higher limit request form URL: /app/higher-request-limit

@michaeldev5 michaeldev5 self-assigned this Aug 11, 2023
@michaeldev5 michaeldev5 force-pushed the feature/higher-request-limit branch 3 times, most recently from 369cb8f to 121ed59 Compare August 11, 2023 19:24
@michaeldev5 michaeldev5 marked this pull request as ready for review August 11, 2023 19:25
@michaeldev5 michaeldev5 force-pushed the feature/higher-request-limit branch 2 times, most recently from 0111276 to 54e0b2b Compare August 11, 2023 19:50
@dudo50 dudo50 self-assigned this Aug 21, 2023
@dudo50 dudo50 merged commit b399b09 into main Aug 21, 2023
1 check passed
@dudo50 dudo50 deleted the feature/higher-request-limit branch September 13, 2023 14:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants