Skip to content

DigdarshanMohanty/Notes-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes API

A simple RESTful API built with Go (Gin + GORM) that provides CRUD operations for managing notes.
The project also includes JWT-based authentication and bcrypt password hashing for secure user management.

Features :-

  • User Authentication
    • Register with hashed passwords (bcrypt)
    • Login with JWT token generation
  • Notes CRUD
    • Create, Read, Update, Delete notes
  • Secure endpoints (JWT-protected routes)
  • PostgreSQL integration with GORM ORM
  • Configurable using .env file

Tech Stack

  • Go (Gin framework)
  • GORM (ORM for PostgreSQL)
  • PostgreSQL (Database)
  • JWT (Authentication)
  • Bcrypt (Password hashing)
  • godotenv (Environment variable management)

API Endpoints

Authentication

Method Endpoint Description Auth Required
POST /register Register a new user ❌ No
POST /login Login and get JWT ❌ No

Users (JWT required)

Method Endpoint Description Auth Required
POST /user/:id Display user details ✅ Yes

Notes (JWT required)

Method Endpoint Description Auth Required
POST /notes Create a new note ✅ Yes
GET /notes Get all notes (user) ✅ Yes
PATCH /notes/:id Update a note ✅ Yes
DELETE /notes/:id Delete a note ✅ Yes

About

CRUD Operation performed using Golang & PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages