diff --git a/README.md b/README.md index 4f60d99..8ccdcb4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,70 @@ +## set up db_instance with mariadb engion +## create 2 Ec2 instances +## crete Sequrity group +Screenshot 2026-01-06 at 4 31 52 PM + +--- +# MariaDB Setup and Configuration Guide for Windows + +This guide explains how to set up MariaDB, create a database, and Create Database User + +## 1. Installing MariaDB + +Installing MariaDB on Ubntu + +```shell +apt update && apt install mariadb-server -y +``` + +## 2. Securing MariaDB + +Open the Command Prompt as Administrator and run the following command to secure your installation: + +```shell + +mysql_secure_installation +``` + +Follow the prompts to: +Set a root password. +Remove insecure default users and test databases. +Disable remote root login. + +## 3. Setting Up the Database + +Open terminal and login to MariaDB: + +```bash + +mysql -u root -p +``` + +Enter the root password when prompted. + +Create a new database and user: + +```sql +CREATE DATABASE student_db; +GRANT ALL PRIVILEGES ON springbackend.* TO 'username'@'localhost' IDENTIFIED BY 'your_password'; +``` +Replace username and your_password with your desired username and password. + +Exit MariaDB: + +```sql + +EXIT; +``` + +## 4. You will need Database Credentials to Connect Backend with Database +1. DB_HOST +2. DB_USER +3. DB_PASS +4. DB_PORT +5. DB_NAME + + +--- # EasyCRUD - Student Registration System A full-stack web application for student registration with a React frontend and Spring Boot backend. @@ -325,4 +392,4 @@ For issues and questions: 1. Check the troubleshooting section 2. Review the database setup guide 3. Check application logs for error messages -4. Verify all prerequisites are installed \ No newline at end of file +4. Verify all prerequisites are installed diff --git a/backend/Readme.md b/backend/Readme.md index 1d69609..1541b84 100644 --- a/backend/Readme.md +++ b/backend/Readme.md @@ -39,14 +39,19 @@ mvn -version ## Step 3: Build the Spring Boot Application ### Update DB credentials in application.properties: +``` +pwd +``` -```shell +```bash vim backend/src/main/resources/application.properties - - server.port=8080 - spring.datasource.url=jdbc:mariadb://:3306/ - spring.datasource.username= - spring.datasource.password= +``` +```shell +spring.datasource.url=jdbc:mariadb://localhost:3306/student_db +spring.datasource.username=your_username +spring.datasource.password=your_password +spring.jpa.hibernate.ddl-auto=validate +spring.jpa.show-sql=true ``` ### Build springboot Application using maven @@ -70,4 +75,6 @@ http://localhost:8080 ### Step 5: Keep the Application Running -To keep the application running in the background, you can use nohup or a similar method. \ No newline at end of file + +To keep the application running in the background, you can use nohup or a similar method. + diff --git a/frontend/README.md b/frontend/README.md index b056748..1d133af 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,3 +1,66 @@ +# React Project Setup and Deployment Guide for Windows + +This guide provides step-by-step instructions for setting up a React project. + +## 1. Setting Up the React Project + +### Install Node.js and npm + +```shell +apt update && apt install nodejs npm -y +``` + +### Verify Installation + + +```shell +node -v +npm -v +``` + + +## 2. Install Dependencies + +To install the necessary dependencies for your project, run the following command: + +```shell +npm install +``` + +## 3. Build the React Application for Production + +Update backend URL in .env file + +```bash +vim .env +``` +```shell +VITE_API_URL=http://$BACKEND:8080/api +VITE_API_BASE_URL=http://$BACKEND:8080 +VITE_APP_TITLE=EasyCRUD Student Registration +``` + +To build the React application for production, run: + +```shell +npm run build +``` + +This will create a dist/ directory in your project containing optimized, production-ready files. + +## 4. Deploy production-ready files on s3 or apache2 server + +```shell +apt install apache2 -y +systemctl start apache2 +cp -rf dist/* /var/www/html/ +``` + +You can access the application on http://localhost:80 + + +--- + # CLOUDBLITZ Student Management Frontend A modern, scalable React application built with industry best practices for managing student registrations and data. @@ -292,4 +355,4 @@ For support and questions: - [ ] Advanced analytics dashboard - [ ] Multi-language support - [ ] Dark mode theme -- [ ] Advanced user roles and permissions \ No newline at end of file +- [ ] Advanced user roles and permissions