Skip to content

This is a Note Collector API built using the Spring Framework. It serves as a backend system for managing notes and provides an organized structure with layers such as DTO, Controller, Service, Entity, Config, and more. The server runs on Tomcat.

License

Notifications You must be signed in to change notification settings

ChathuminiBandara/NoteCollector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Note Collector API

This is a Note Collector API built using the Spring Framework. It serves as a backend system for managing notes and provides an organized structure with layers such as DTO, Controller, Service, Entity, Config, and more. The server runs on Tomcat.

## Table of Contents

- [Features](#features)
- [Tech Stack](#tech-stack)
- [Project Structure](#project-structure)
- [Getting Started](#getting-started)
- [API Endpoints](#api-endpoints)
- [License](#license)

## Features

- Create, read, update, and delete (CRUD) notes.
- API designed following REST principles.
- Custom error handling using exceptions.
- Modular structure for maintainability.

## Tech Stack

- Java
- Spring Boot
- Tomcat Server
- MySQL (or any preferred database)

## Project Structure

## Project Structure

```bash
/src
│
├── /config         # Configuration classes for Spring Beans, Security, etc.
├── /controller     # REST Controllers to handle incoming requests
├── /dto            # Data Transfer Objects to encapsulate request/response
├── /entity         # JPA Entities mapped to the database
├── /exception      # Custom exception handling and error responses
├── /service        # Service classes that hold business logic
├── /util           # Utility classes for common functionality
└── /AppInit.java   # Main class to launch the Spring Boot application


## Getting Started

### Prerequisites

- Java 17+
- Maven or Gradle for dependency management.
- A database such as MySQL.

### Installation

1. Clone the repository:

   ```bash
   git clone https://github.com/ChathuminiBandara/NoteCollector.git
  1. Navigate to the project directory:

    cd note-collector-api
  2. Configure the database connection in application.properties:

    spring.datasource.url=jdbc:mysql://localhost:3306/note_db
    spring.datasource.username=root
    spring.datasource.password=yourpassword
  3. Build and run the application:

    mvn clean install
    mvn spring-boot:run
  4. The API will run at http://localhost:8080.

API Endpoints

Method Endpoint Description
GET /api/v1/notes Retrieve all notes
POST /api/v1/notes Create a new note
GET /api/v1/notes/{noteId} Get a note by ID
PUT /api/v1/notes/{noteId} Update a note by ID
DELETE /api/v1/notes/{noteId} Delete a note by ID

Custom Status Codes

  • 201: Resource created successfully.
  • 204: Resource deleted successfully.
  • 400: Bad request or validation error.
  • 404: Resource not found.
  • 500: Internal server error.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This is a Note Collector API built using the Spring Framework. It serves as a backend system for managing notes and provides an organized structure with layers such as DTO, Controller, Service, Entity, Config, and more. The server runs on Tomcat.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages