CampusLearn
← BIT 203 Web Application Development

APIs, Frameworks and Deployment

Notes

Communicating through interfaces An application programming interface, or API, defines how software components exchange requests and responses. Web APIs commonly use Hypertext Transfer Protocol, or HTTP, with methods such as GET for retrieval and POST for creating resources or submitting actions. JavaScript Object Notation, or JSON, represents structured data using objects, arrays and basic values. Inspect status codes and validate response shapes rather than assuming every response contains successful data. Authentication establishes identity, while authorisation determines permitted actions; both require server enforcement regardless of what the interface hides. Building and releasing applications A frontend framework organises interfaces into reusable components and manages changes in state and presentation. Components should have clear responsibilities, predictable data flow and accessible interactions. Deployment releases a built application to an environment where users can reach it. Separate development and production configuration, use encrypted HTTPS connections and keep private credentials on the server. A release process should include automated checks, environment validation, monitoring and a rollback plan. Browser bundles are public, so placing a secret in a frontend environment variable does not make it confidential. Practical example A Mombasa e-commerce startup serves 600 product-page visits per hour. If every visit sends four API requests, traffic is 600 times 4 = 2,400 requests per hour. Caching one public catalogue response per visit reduces repeated calls from four to three, giving 1,800 requests, a saving of 600 or 25 percent. Personal account details must not enter a shared public cache. During deployment, the team verifies the production API address and tests a failed checkout response. Monitoring then compares successful orders before and after release, allowing rollback if error rates rise sharply.

Quiz

1. Reducing hourly requests from 2,400 to 1,800 saves what percentage?

2. Which control must remain on the server even if an administration button is hidden?

3. Why is a private key unsafe in a browser bundle?

Sign in to submit and securely grade your quiz.