Welcome to NoteKeeper API, an demo project. Crafted with the latest technologies and best practices, NoteKeeper API is designed to provide a seamless, secure, and scalable experience. Built with TypeScript, it offers a type-safe environment, ensuring that user's data is always valid and consistent.
- Type-Safe Development: Leverages TypeScript and Zod for schema validation, ensuring data integrity and reducing runtime errors.
- Secure by Design: Implements basic authentication and secure headers to protect your notes from unauthorized access.
- Performance Optimized: Features rate limiting to prevent abuse and ensure fair usage, ensuring your API remains responsive.
- Scalable and Efficient: Utilizes Drizzle ORM for efficient database operations, supporting MySQL as the backend, ensuring your notes are stored securely and efficiently.
- Developer-Friendly: Comes with a comprehensive set of middleware for logging, compression, CORS, and more, enhancing the development experience and making it easier to integrate with other services.
- Node.js (v14.x or higher)
- MySQL Database
-
Clone the Repository
git clone https://github.com/ItsPinion/NoteKeeper-API.git
-
Install Dependencies
Navigate to the project directory and run:
npm install
-
Environment Setup
Create a
.env
file in the root of your project and add the following environment variables:MYSQL_HOST=your_mysql_host PMA_USER=your_mysql_user MYSQL_DATABASE=your_mysql_database MYSQL_ROOT_PASSWORD=your_mysql_password
-
Start the Server
npm start
POST /
Content-Type: application/json
{
"text": "This is a new note",
"date": "2023-04-01T00:00:00Z"
}
GET /1
PUT /1
Content-Type: application/json
{
"text": "Updated note text",
"date": "2023-04-02T00:00:00Z"
}
DELETE /1
GET /?page=1&limit=10
NoteKeeper API is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, please open an issue on GitHub or contact me directly at out discord server.
NoteKeeper API is built on the shoulders of giants. Here are the key packages that make it possible:
- Hono: A lightweight and flexible framework for building web applications, providing the necessary tools to build our API.
- Drizzle ORM: Our ORM of choice, enabling efficient database operations and ensuring data integrity.
- zod: Our schema validation library, ensuring that all data passed through our API is valid and consistent.