This project is a simple single-page web application built with React.js, designed to showcase how to create a responsive form that integrates with a RESTful API. The form allows users to submit an email address and performs both front-end and API validations.
- Responsive design for various screen sizes, including mobile, tablet, and desktop.
- Front-end validation to ensure the email field is not empty and follows a valid email format.
- API integration using Axios for sending POST requests to the provided API endpoint.
- Handling API responses, including error messages and success messages.
- Demonstrates error handling for cases when the email ends with "@ez.works."
- React.js: A popular JavaScript library for building user interfaces.
- Axios: A promise-based HTTP client for making API requests.
- CSS: Used for styling the form and making it responsive.
To run this project locally or contribute to it, follow these steps:
- Clone the repository to your local machine.
- Install the necessary dependencies using
npm install
. - Start the development server with
npm start
. - Open your web browser and access the application at
http://localhost:3000
.
- API Link: API Documentation
- API Documentation: API Documentation
- Postman Link: Postman Documentation
- Access the application on your preferred device.
- Fill in the email field and click the "Contact Me" button.
- Front-end validation will prevent empty submissions or invalid email formats.
- If the email ends with "@ez.works," the API will return an error message.
- Successful submissions will display a "Form Submitted" message.
Feel free to explore the code, customize the styling, and adapt the project to your specific needs.