Skip to content

Repository files navigation

SkyNotes - Full-Stack Notes REST API & Board

SkyNotes is a premium, full-stack notes management application featuring a robust REST API backend built with Node.js, Express, and MongoDB Atlas, paired with a modern, glassmorphic dark-mode web user interface.

🚀 Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB Atlas (Cloud) / Local MongoDB
  • ODM (Object Data Modeling): Mongoose
  • Frontend: Vanilla HTML5, CSS3 (Glassmorphism, custom animations), and Javascript (async fetch API)
  • Environment Management: dotenv
  • Development Helper: nodemon

🛠️ Features

  • MVC (Model-View-Controller) Design: Clean separation of concerns between data schemas, business logic, and routing routes.
  • Full CRUD REST Endpoints: Exposes stable JSON-based endpoints for note creation, retrieval, updates, and deletion.
  • Custom Request Validation: Middleware verifying request bodies before reaching controllers to ensure data sanitization.
  • Centralized Error Handling: Centralized Express error middleware managing MongoDB cast errors, schema validations, and runtime server errors.
  • DNS SRV Bypass Fallback: Configured database connection module supporting direct node shard lists to bypass local network DNS lookup restrictions (querySrv ECONNREFUSED).
  • Responsive Dark Theme UI: Smooth hover animations, CSS grids, category-specific tags, and animated toast feedback notifications.

📂 Project Structure

notes-api/
├── config/
│   └── db.js               # Database connection configuration
├── controllers/
│   └── noteController.js   # CRUD controller actions
├── middleware/
│   ├── errorHandler.js     # Centralized global error handling
│   └── validateNote.js     # Input request validation
├── models/
│   └── Note.js             # Mongoose schema and schema validations
├── public/                 # Static asset server directory
│   ├── app.js              # Frontend UI logic and API fetch integration
│   ├── index.html          # Main HTML structure
│   └── style.css           # Premium glassmorphic styles & keyframes
├── routes/
│   └── noteRoutes.js       # Express routing endpoints
├── .env.example            # Environment variables template
├── .gitignore              # Files excluded from git tracking
├── package.json            # Scripts and packages manifest
└── server.js               # App entry point and middleware assembly

⚙️ Installation & Setup

1. Clone the repository

git clone https://github.com/aryanbnrj/notes-api.git
cd notes-api

2. Install dependencies

npm install

3. Setup Environment Variables

Create a .env file in the root of the project (copying .env.example as a template):

PORT=3000
MONGO_URI=your_mongodb_connection_string

4. Run the Application

For local development with automatic hot-restarts:

npm run dev

For production execution:

npm start

Once running, navigate to http://localhost:3000 in your browser to view the interface.


📝 API Reference

Endpoint Method Description Request Body Structure
/api/notes GET Retrieve all notes sorted by date (newest first) None
/api/notes/:id GET Retrieve a single note None
/api/notes POST Create a new note {"title": String, "content": String, "category": String}
/api/notes/:id PUT Update an existing note {"title": String, "content": String, "category": String}
/api/notes/:id DELETE Delete a note None

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages