Back to .md Directory

CLAUDE.md

Guides Claude Code on the architecture, commands, and API endpoints for a Go + Angular anonymous note board project.

May 2, 2026
0 downloads
0 views
ai claude
View source

What this file does

Guides Claude Code on the architecture, commands, and API endpoints for a Go + Angular anonymous note board project.

When to use it

  • You want Claude to understand a two-tier Go/Angular project structure
  • You need Claude to run frontend or backend dev commands from the correct directories
  • You want Claude to know the database setup and connection defaults
  • You need Claude to call or debug the REST API endpoints

Assumes this stack

GoAngular 17PostgreSQLTypeScriptKarma

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Noted is a modern, simplistic board where anyone can anonymously post text notes. It consists of a Go REST API backend and an Angular frontend client.

Architecture

Backend (Go):

  • Clean architecture with layered structure: controller → service → repository → database
  • PostgreSQL database with a simple note table (id, text)
  • REST API endpoints at /api/note/* for CRUD operations
  • CORS enabled for frontend communication on http://localhost:4200
  • Server runs on localhost:8888

Frontend (Angular 17):

  • Standard Angular CLI project structure
  • Services for API communication (api.service.ts, note.service.ts)
  • Home component for displaying notes
  • TypeScript with strict configuration

Data Flow:

  1. Angular frontend makes HTTP requests to Go backend
  2. Go controllers handle requests and delegate to services
  3. Services contain business logic and call repositories
  4. Repositories interact with PostgreSQL database
  5. Response flows back through the layers

Development Commands

Frontend (run from /client directory):

npm run start    # Start dev server on localhost:4200
npm run build    # Build for production
npm run test     # Run unit tests with Karma
ng generate component component-name  # Generate new component

Backend (run from /server directory):

go run main.go   # Start server on localhost:8888
go mod tidy      # Clean up dependencies

Database Setup:

  • Create PostgreSQL database named noted_dev
  • Run /server/sql/note_table.sql to create the note table
  • Default connection: postgres:password@localhost:5432/noted_dev
  • Configure database connection in /server/config/database.go

Key Directories

  • /client/src/app/ - Angular components and services
  • /client/src/types.ts - TypeScript interfaces (Note, NotesResponse, Options)
  • /server/controller/ - HTTP request handlers
  • /server/service/ - Business logic layer
  • /server/repository/ - Database access layer
  • /server/model/ - Data structures
  • /server/data/ - Request/response DTOs
  • /server/helper/ - Utility functions (JSON, error handling)
  • /server/config/ - Database configuration

API Endpoints

  • GET /api/note - Get all notes
  • GET /api/note/:noteId - Get note by ID
  • POST /api/note - Create new note
  • PATCH /api/note/:noteId - Update note
  • DELETE /api/note/:noteId - Delete note

What's inside

Project overview, architecture description, 6 development commands, 10 key directories, 5 API endpoints.

Change this for your project

  • Replace noted_dev with your own PostgreSQL database name
  • Replace postgres:password@localhost:5432/noted_dev with your own database connection string
  • Replace http://localhost:4200 with your frontend's actual origin

Where it goes

Save as CLAUDE.md in your repository root. Claude Code reads it automatically at the start of every session.

Worth borrowing

  • Layered backend structure (controller → service → repository → database) for clean separation of concerns
  • Separate directory-level commands for frontend and backend to avoid running commands in the wrong folder

Related Documents