This API server is built to support a mobile chat application that utilizes GPT features. The API server provides the following features:
- User registration
- User login
- Token-based authentication
- Role-based access control
- GPT-powered conversation
- Customizable prompt
- Language detection
- Small talk capability
- Retrieve user profile
- Update user profile
- Delete user profile
- Send message
- Retrieve message history
- Delete message
- Retrieve user's contacts
- Add/remove contact
- Send push notification
- Retrieve notification history
The API server is built using a popular web framework such as Django or Flask, and the database used is MongoDB or Firebase for storing user data, message and contact data.
Endpoints of the API are designed to be RESTful, which means that the endpoints are organized around the standard HTTP methods like GET, POST, PUT, and DELETE, and the endpoints are designed to be stateless.
Authentication of the API is done using JSON Web Token (JWT), which is a compact, URL-safe means of representing claims to be transferred between two parties.
The API server is designed to be scalable and able to handle a high number of requests. Caching is implemented using Redis or Memcached to improve the performance of the API.
- All the endpoints of the API are documented in OpenAPI (Swagger) format and can be accessed at /docs/
- API endpoint are versioned using a versioning scheme like
v1
orv2
- API server is deployed on cloud providers like AWS, GCP or Heroku
- Automated deployments using jenkins
- The API server is regularly updated to the latest version of the framework and dependencies
- Security patches are applied as needed
- Backups are taken regularly to ensure data recovery in case of any disaster