CyberTrends is a web application that provides information on cyber-related news trends. It utilizes the News API to fetch and display news articles based on user queries related to cybersecurity.
- Users can search for cybersecurity-related news by entering keywords or phrases.
- The app queries the News API to fetch relevant articles based on the user's input.
- The app supports pagination to allow users to navigate through multiple pages of search results.
- Users can specify the page and page size to customize their browsing experience.
- The application is configured to use the News API, and it requires an API key for authentication.
- Users need to set up their own News API key in the
env.config
file for the app to function properly.
- The app includes error handling to gracefully manage issues that may arise during the API request process.
- In case of errors, the server responds with a 500 status code and a corresponding error message.
- The app is designed to be responsive, providing a seamless experience across various devices and screen sizes.
- Clone the repository to your local machine.
- Install dependencies using
npm install
. - Obtain a News API key and set it in the
env.config
file. - Run the application using
npm start
. - Access the app in your browser at
http://localhost:3000
(or the specified port).
- axios: Used for making HTTP requests to the News API.
- Node.js: JavaScript runtime for server-side development.
Before running the app, make sure to set up the NEWS_API_KEY
in the env.config
file.
// env.config
module.exports = {
NEWS_API_KEY: "your_news_api_key_here",
};
It looks like you have two modules (complaintRegister
and auth_controller
) that handle different aspects of your application, including complaint registration and user authentication. Below is a simple README.md template for these modules:
This application provides functionality for registering complaints and authenticating users. It includes features such as complaint registration with image uploads and user authentication using OTP.
- Endpoint:
/incidentDetails
- Method: POST
- Description: Register an incident complaint with details such as category, subcategory, date, time, delay reason, and additional information.
- Request Body:
{ "category": "Cybercrime", "subcategory": "Phishing", "date": "2023-01-15", "time": "14:30", "delayReason": "Not applicable", "additionalInfo": "Details of the incident" }
- Response:
{ "message": "Complaint Registered successfully" }
- Endpoint:
/complainantId
- Method: POST
- Description: Upload the complainant's ID image, associated with a specific complaint.
- Request Body:
{ "acknowledgementNumber": "F3E015509F054FE6" }
- Response:
{ "message": "Complaint updated successfully" }
- Endpoint:
/complainantDetails
- Method: POST
- Description: Update complainant details such as name, gender, address, etc., associated with a specific complaint.
- Request Body:
{ "acknowledgementNumber": "F3E015509F054FE6", "name": "John Doe", "gender": "Male", "houseNo": "123", "country": "USA", "streetName": "Main Street", "state": "California", "district": "Los Angeles", "nearestPoliceStation": "Station A" }
- Response:
{ "message": "Complaint updated successfully" }
- Endpoint:
/register
- Method: POST
- Description: Register a new user and send an OTP for verification.
- Request Body:
{ "email": "john.doe@example.com", "name": "John Doe" }
- Response:
{ "message": "Otp Sent successfully" }
- Endpoint:
/verify_otp
- Method: POST
- Description: Verify the user using the received OTP and issue an access token.
- Request Body:
{ "email": "john.doe@example.com", "otp": 1234 }
- Response:
{ "message": "User verified successfully" }
- Clone the repository.
- Install dependencies using
npm install
. - Set up environment variables.
- Run the application using
npm start
.
Feel free to customize this README based on additional features, setup instructions, and any other relevant information specific to your application.