A modern full-stack application built with React (TypeScript) and Go, demonstrating a simple book management system.
├── frontend/ # React TypeScript frontend
│ ├── src/
│ │ ├── App.tsx # Main React component
│ │ └── ...
│ ├── index.html
│ └── vite.config.ts
└── go-backend/ # Go backend server
├── main.go # Server implementation
├── go.mod
└── go.sum
- Built with React and TypeScript
- Vite as build tool and dev server
- Clean and responsive UI for book management
- Error handling and loading states
- Real-time book count display
- Styled components for consistent UI
- RESTful API built with Go
- Uses Gorilla Mux for routing
- Persistent storage using JSON file
- CRUD operations for books
- Search functionality with pagination
- Data validation and error handling
GET /books- List all books (supports search and pagination)GET /books/{id}- Get a specific bookPOST /books- Create a new bookPUT /books/{id}- Update a book (full replace)PATCH /books/{id}- Partial update of a bookDELETE /books/{id}- Delete a book
q- Search term (optional)page- Page number (default: 1)page_size- Items per page (default: 10)
type Book = {
id: string
title: string
content: string
}- Navigate to the backend directory:
cd go-backend - Run the Go server:
The server will start on port 8000.
go run main.go
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Start the development server:
The frontend will be available at http://localhost:5173
npm run dev
- The backend uses an in-memory store that persists to a
books.jsonfile - The frontend proxies API requests to the backend during development
- TypeScript is used for type safety in the frontend
- The application includes error handling and loading states
- Backend includes search and pagination functionality
- React
- TypeScript
- Vite
- CSS Modules
- Go
- Gorilla Mux
- Standard library JSON encoding/decoding