Skip to content

A full-stack note-taking application built with Go/Gin backend and React/Vite frontend.

Notifications You must be signed in to change notification settings

ilramdhan/GoNote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GoNote πŸ“

A full-stack note-taking application built with Go/Gin backend and React/Vite frontend.

License Go React PostgreSQL

✨ Features

Notes

  • πŸ“ Create, edit, delete notes with rich text editor (Quill)
  • πŸ“Œ Pin/unpin important notes
  • 🏷️ Organize with tags (multiple per note)
  • πŸ“ Group into folders
  • πŸ” Full-text search
  • πŸ“„ Markdown support

Folders & Tags

  • Create, edit, delete folders with custom icons & colors
  • Create, edit, delete tags with color picker
  • View all notes inside a folder

User Experience

  • πŸ”” Toast notifications for all actions
  • ❓ Confirmation modals for destructive actions
  • πŸ”” Notification bell with history
  • πŸŒ™ Dark mode support
  • πŸ“± Responsive design

Authentication

  • JWT-based authentication
  • User registration & login
  • Profile management with avatar

πŸ—οΈ Tech Stack

Backend (apps/backend)

Technology Purpose
Go 1.21+ Language
Gin HTTP framework
GORM ORM
PostgreSQL Database
JWT Authentication
MinIO Object storage (avatars, images)
Zap Structured logging

Frontend (apps/frontend)

Technology Purpose
React 19 UI library
Vite Build tool
TypeScript Type safety
TailwindCSS v4 Styling
ReactQuill Rich text editor
react-markdown Markdown rendering
react-hot-toast Notifications
Axios HTTP client

πŸ“ Project Structure

simple-note-app/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ backend/                 # Go API server
β”‚   β”‚   β”œβ”€β”€ cmd/api/            # Entry point
β”‚   β”‚   β”œβ”€β”€ config/             # Configuration
β”‚   β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”‚   β”œβ”€β”€ dto/            # Data transfer objects
β”‚   β”‚   β”‚   β”œβ”€β”€ handlers/       # HTTP handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ middleware/     # Auth, CORS, rate limit
β”‚   β”‚   β”‚   β”œβ”€β”€ models/         # GORM models
β”‚   β”‚   β”‚   β”œβ”€β”€ repository/     # Database layer
β”‚   β”‚   β”‚   └── services/       # Business logic
β”‚   β”‚   β”œβ”€β”€ migrations/         # SQL migrations
β”‚   β”‚   └── pkg/                # Utilities (jwt, password, logger)
β”‚   β”‚
β”‚   └── frontend/               # React application
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/     # React components
β”‚       β”‚   β”œβ”€β”€ context/        # Auth & Notification context
β”‚       β”‚   β”œβ”€β”€ hooks/          # Custom hooks
β”‚       β”‚   β”œβ”€β”€ lib/            # Axios config
β”‚       β”‚   β”œβ”€β”€ services/       # API services
β”‚       β”‚   └── types/          # TypeScript types
β”‚       └── index.html
β”‚
β”œβ”€β”€ package.json                # Monorepo config
└── README.md

πŸš€ Quick Start

Prerequisites

  • Go 1.21+
  • Node.js 18+
  • PostgreSQL 15+
  • (Optional) MinIO for image uploads

1. Clone & Install

git clone <repository-url>
cd simple-note-app

# Install frontend dependencies
npm install

2. Database Setup

# Create database
createdb gonote

# Run migrations
psql -d gonote -f apps/backend/migrations/001_create_users.sql
psql -d gonote -f apps/backend/migrations/002_create_folders.sql
psql -d gonote -f apps/backend/migrations/003_create_tags.sql
psql -d gonote -f apps/backend/migrations/004_create_notes.sql
psql -d gonote -f apps/backend/migrations/005_create_note_tags.sql
psql -d gonote -f apps/backend/migrations/006_create_note_images.sql

If u got error

connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed

Try to run this command (make sure postre users is postgres)

psql -h localhost -U postgres -d gonote -f 001_create_users.sql
psql -h localhost -U postgres -d gonote -f 002_create_folders.sql
psql -h localhost -U postgres -d gonote -f 003_create_tags.sql
psql -h localhost -U postgres -d gonote -f 004_create_notes.sql
psql -h localhost -U postgres -d gonote -f 005_create_note_tags.sql
psql -h localhost -U postgres -d gonote -f 006_create_note_images.sql

3. Configure Environment

cd apps/backend
cp .env.example .env
# Edit .env with your settings

.env configuration:

# Server
PORT=8080
GIN_MODE=debug

# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=yourpassword
DB_NAME=gonote
DB_SSLMODE=disable

# JWT
JWT_SECRET=your-super-secret-key-here
JWT_EXPIRY_HOURS=72

# MinIO (optional)
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BUCKET=gonote
MINIO_USE_SSL=false

# CORS
CORS_ALLOWED_ORIGINS=http://localhost:5173

Seed Demo Data (Optional)

Populate the database with sample data for testing:

cd apps/backend
go run cmd/seed/seed.go

This creates:

  • Demo user: demo@gonote.app / demo123
  • 6 folders with various categories
  • 8 tags with different colors
  • 15+ sample notes (meeting notes, code snippets, recipes, etc.)

4. Run the Application

Terminal 1 - Backend:

cd apps/backend
go run ./cmd/api/main.go
# Server runs at http://localhost:8080

Terminal 2 - Frontend:

cd apps/frontend
npm run dev
# UI runs at http://localhost:5173

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description
POST /api/v1/auth/register Register new user
POST /api/v1/auth/login Login
GET /api/v1/auth/profile Get profile (auth required)
PUT /api/v1/auth/profile Update profile (auth required)

Notes

Method Endpoint Description
GET /api/v1/notes List notes (with pagination, search, filter)
POST /api/v1/notes Create note
GET /api/v1/notes/:id Get note by ID
PUT /api/v1/notes/:id Update note
DELETE /api/v1/notes/:id Delete note

Query Parameters for GET /notes:

  • page - Page number (default: 1)
  • page_size - Items per page (default: 10)
  • search - Search in title/content
  • folder_id - Filter by folder
  • tag_id - Filter by tag
  • is_pinned - Filter pinned notes

Folders

Method Endpoint Description
GET /api/v1/folders List folders
POST /api/v1/folders Create folder
GET /api/v1/folders/:id Get folder
PUT /api/v1/folders/:id Update folder
DELETE /api/v1/folders/:id Delete folder

Tags

Method Endpoint Description
GET /api/v1/tags List tags
POST /api/v1/tags Create tag
DELETE /api/v1/tags/:id Delete tag

Uploads

Method Endpoint Description
POST /api/v1/upload/note-image Upload note image
POST /api/v1/upload/avatar Upload user avatar

πŸ” Authentication

The API uses JWT tokens. Include the token in requests:

Authorization: Bearer <your-jwt-token>

Example login:

curl -X POST http://localhost:8080/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "password123"}'

🐳 Docker

Build and run with Docker:

cd apps/backend
docker build -t gonote-api .
docker run -p 8080:8080 --env-file .env gonote-api

πŸ“ Development

Backend Development

cd apps/backend
go mod tidy          # Install dependencies
go run ./cmd/api/main.go  # Run server
go build -o gonote ./cmd/api  # Build binary

Frontend Development

cd apps/frontend
npm run dev          # Dev server with HMR
npm run build        # Production build
npm run preview      # Preview production build

πŸ“„ License

MIT License - see LICENSE for details.


πŸ™ Acknowledgments

About

A full-stack note-taking application built with Go/Gin backend and React/Vite frontend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages