This project implements a simple login page using React for the frontend, Express for the backend, and MySQL as the database. It allows users to log in with their credentials and performs authentication against a MySQL database.
- Node.js and npm installed
- MySQL server installed and running
- React and Express dependencies installed
- Navigate to the
server
directory:cd server
- Install dependencies:
npm install
- Set up MySQL configuration in
server.js
- Start the server:
node server.js
- Navigate to the
client
directory:cd client
- Install dependencies:
npm install
- Start the React app:
npm start
- Create a MySQL database named
crud
- Import the SQL schema from
database.sql
Update MySQL connection details in server.js
:
const db = mysql.createConnection({
host: "localhost",
user: "root",
password: "your_mysql_password",
database: "crud",
});
API Endpoint
Login API endpoint: POST /login
Usage
Launch the React app and navigate to the login page.
Enter valid login credentials.
Submit the form to perform authentication.
View the result of the login attempt.
Contributing
Feel free to contribute to enhance the functionality or fix issues. Create a pull request with your changes.
License
This project is licensed under the MIT License.
Remember to replace placeholders like `your_mysql_password` with your actual MySQL password and customize any other details based on your project structure and requirements. Additionally, if your project structure differs significantly, you might need to adjust the README accordingly.