Skip to content

Gresham24/notes-app

Repository files navigation

📝 Notes App

A full-stack notes application built with Node.js, Supabase, and vanilla JavaScript. Create, edit, delete, and search through your notes with a beautiful, responsive interface.

🚀 Tech Stack

  • Backend: Node.js with native HTTP module
  • Database: Supabase (PostgreSQL)
  • Frontend: Vanilla HTML, CSS, JavaScript
  • Styling: Tailwind CSS
  • Deployment: Netlify, or any Node.js hosting

🛠️ API Endpoints

Method Endpoint Description
GET /api/notes Get all notes
GET /api/notes/search?q=query Search notes by title or content
GET /api/notes/:id Get a specific note by ID
POST /api/notes Create a new note
PUT /api/notes/:id Update an existing note
DELETE /api/notes/:id Delete a note

📦 Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • Supabase account and project

1. Clone the Repository

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

2. Install Dependencies

npm install

3. Configure Supabase

  1. Create a new project at supabase.com
  2. Create a table named NotesDB with the following schema:
    CREATE TABLE NotesDB (
      id SERIAL PRIMARY KEY,
      created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
      note_title TEXT NOT NULL,
      note_text TEXT NOT NULL
    );
  3. Update lib/supabase.js with your Supabase URL and API key

4. Start the Development Server

npm start

The application will be available at http://localhost:3000

📁 Project Structure

notes-app/
├── lib/
│   ├── notes.js          # Database operations (CRUD + Search)
│   └── supabase.js       # Supabase configuration
├── public/
│   ├── index.html        # Main application interface
│   ├── script.js         # Frontend JavaScript logic
│   └── styles.css        # Application styling
├── utils/
│   └── serveStatic.js    # Static file serving utility
├── server.js             # Node.js HTTP server
├── package.json          # Dependencies and scripts
└── README.md            # Project documentation

🔍 Search Functionality

The app includes search capabilities:

  • Real-time Search: Results update as you type (300ms debounce)
  • Case-insensitive: Searches work regardless of letter case
  • Multi-field Search: Searches both note titles and content
  • Partial Matching: Finds notes containing your search terms
  • Clear Search: Reset to view all notes

🚀 Deployment

Deploy to Vercel

  1. Connect your GitHub repository to Vercel
  2. Set environment variables for Supabase
  3. Deploy automatically on push

🧪 Testing

Test the API endpoints using Postman or curl:

# Get all notes
curl http://localhost:3000/api/notes

# Search notes
curl "http://localhost:3000/api/notes/search?q=test"

# Create a note
curl -X POST http://localhost:3000/api/notes \
  -H "Content-Type: application/json" \
  -d '{"note_title":"Test Note","note_text":"This is a test note"}'

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is open source and available under the MIT License.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published