https://github.com/chathuminibandara/notecollector
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.
https://github.com/chathuminibandara/notecollector
customexception customstatuscode java mit-license notecollector-springfw spring spring-web spring-web-mvc
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/chathuminibandara/notecollector
- Owner: ChathuminiBandara
- License: mit
- Created: 2024-09-07T07:29:47.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-14T17:25:31.000Z (over 1 year ago)
- Last Synced: 2025-01-24T17:35:10.130Z (over 1 year ago)
- Topics: customexception, customstatuscode, java, mit-license, notecollector-springfw, spring, spring-web, spring-web-mvc
- Language: Java
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
```markdown
# 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
```
2. Navigate to the project directory:
```bash
cd note-collector-api
```
3. Configure the database connection in `application.properties`:
```properties
spring.datasource.url=jdbc:mysql://localhost:3306/note_db
spring.datasource.username=root
spring.datasource.password=yourpassword
```
4. Build and run the application:
```bash
mvn clean install
mvn spring-boot:run
```
5. 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](https://github.com/ChathuminiBandara/NoteCollector/blob/master/Licence.txt) file for details.