Skip to main content

API Initialization

This guide explains the different API environments available in the Sumaya369 platform and how to use them effectively. Each environment serves a specific purpose in the development and deployment lifecycle.

Available Environments

Local Environment

http://127.0.0.1:8000/
  • Purpose: Local development and testing
  • Example Route: http://127.0.0.1:8000/v1/customer/articles
  • Description: This environment runs on your local machine for development purposes. It's used for initial development, debugging, and testing new features before pushing to the testing environment.

Testing Environment

http://testing-api.sumaya369.net/
  • Purpose: Testing and quality assurance
  • Example Route: http://testing-api.sumaya369.net/v1/customer/articles
  • Description: This environment is used for testing new features and updates before they are deployed to production. It's suitable for QA teams and developers to verify functionality without affecting the production environment.

Staging Environment

http://staging-api.sumaya369.net/
  • Purpose: Pre-production validation and integration testing
  • Example Route: http://staging-api.sumaya369.net/v1/customer/articles
  • Description: The staging environment mirrors the production setup and is used for final validation before deploying to production. It's ideal for conducting integration tests and verifying application behavior in a production-like setting.

Production Environment

http://api.sumaya369.net/
  • Purpose: Production environment for live applications
  • Example Route: http://api.sumaya369.net/v1/customer/articles
  • Description: This is the main production environment used by the live application. All API calls in production applications should use this base URL. The environment is stable and optimized for performance.

Environment Usage Guidelines

  1. Local Environment

    • Initial development and debugging
    • Rapid prototyping and testing
    • Unit testing and feature development
    • Local configuration testing
  2. Testing Environment

    • Use during development phase
    • Test new features and bug fixes
    • Conduct API integration testing
    • Verify API responses and behavior
  3. Staging Environment

    • Perform final pre-production testing
    • Validate deployment procedures
    • Test with production-like data
    • Verify third-party integrations
  4. Production Environment

    • Use for live applications
    • Ensure proper error handling
    • Implement appropriate caching strategies
    • Monitor API usage and performance

Best Practices

  • Always start development the Local environment
  • Progress through Testing and Staging before Production deployment
  • Maintain separate API keys for each environment
  • Monitor API response times and error rates in all environments
  • Document any environment-specific behaviors or limitations