Skip to content

Rush741/php-notes-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Notes App 📝

A simple CRUD Notes Application built using Core PHP, MySQL, and Dotenv.


🚀 Features

  • Create notes
  • View all notes
  • Update existing notes
  • Delete notes
  • Uses .env for secure configuration

🛠️ Tech Stack

  • PHP (Core PHP, no framework)
  • MySQL
  • Composer
  • vlucas/phpdotenv
  • XAMPP (Apache + MySQL)

📁 Project Structure

php-notes-app/
│── create.php
│── read.php
│── update.php
│── delete.php
│── db.php
│── .env
│── .gitignore
│── composer.json
│── vendor/

⚙️ Setup Instructions (Step by Step)

1️⃣ Prerequisites

Before running this project, make sure the following are installed and running on your system.

---- ✅ a. Install XAMPP

---- ✅ b. Install Composer

Composer is used to install project dependencies.

You’re now ready to set up and run the project.


2️⃣ Clone the Repository

git clone https://github.com/Rush741/php-notes-app.git
cd php-notes-app

Place the project inside:

C:\xampp\htdocs\

3️⃣ Install Dependencies

Run inside the project folder:

composer install

This will generate:

  • vendor/
  • vendor/autoload.php

4️⃣ Create .env File

Create a file named .env in the project root.

DB_HOST=localhost
DB_USER=root
DB_PASS=
DB_NAME=notesapp
DB_PORT=3306

⚠️ Do not add quotes


5️⃣ Create Database

Open phpMyAdmin:

http://localhost/phpmyadmin

Run:

CREATE DATABASE notesapp;

CREATE TABLE notes (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    body TEXT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

6️⃣ Start the Project

  • Open XAMPP Control Panel

  • Click Start for:

    • Apache
    • MySQL

Open in browser:

http://localhost/php-notes-app/

🧠 How the Project Works (Brief)

  • db.php loads environment variables using Dotenv
  • Database connection is created using MySQLi
  • Each CRUD operation is handled by a separate PHP file
  • Prepared statements are used for secure queries

📌 Notes

  • Default MySQL port is 3306
  • If your MySQL runs on another port, update DB_PORT in .env
  • Restart Apache after changing .env

About

Simple PHP CRUD notes app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors