Skip to content

dascope/absolutely-flawless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Absolutely Flawless

A simple hello world application with a Node.js backend and SQLite database.

Features

  • Express.js REST API server
  • SQLite database for data persistence
  • CRUD operations for messages
  • Health check endpoint

Prerequisites

  • Node.js (v14 or higher)
  • npm

Installation

  1. Clone the repository:
git clone <repository-url>
cd absolutely-flawless
  1. Install dependencies:
npm install

Running the Application

Start the server:

npm start

The server will start on http://localhost:3000

API Endpoints

GET /

Returns a simple hello world message.

Response:

{
  "message": "Hello, World!",
  "status": "success",
  "timestamp": "2025-12-16T19:42:00.000Z"
}

GET /health

Check the health status of the application and database.

Response:

{
  "status": "healthy",
  "database": "connected",
  "messageCount": 1
}

GET /api/messages

Retrieve all messages from the database.

Response:

{
  "messages": [
    {
      "id": 1,
      "content": "Hello, World!",
      "created_at": "2025-12-16 19:42:00"
    }
  ],
  "count": 1
}

POST /api/messages

Create a new message in the database.

Request Body:

{
  "content": "Your message here"
}

Response:

{
  "id": 2,
  "content": "Your message here",
  "message": "Message created successfully"
}

Testing the API

You can test the API using curl:

# Test hello world endpoint
curl http://localhost:3000/

# Check health
curl http://localhost:3000/health

# Get all messages
curl http://localhost:3000/api/messages

# Create a new message
curl -X POST http://localhost:3000/api/messages \
  -H "Content-Type: application/json" \
  -d '{"content": "Hello from curl!"}'

Database

The application uses SQLite with a single messages table:

  • id: Auto-incrementing primary key
  • content: Message text
  • created_at: Timestamp of creation

The database file (database.db) is created automatically when the server starts.

Project Structure

absolutely-flawless/
├── server.js          # Main application file
├── package.json       # Node.js dependencies and scripts
├── database.db        # SQLite database (auto-generated)
├── .gitignore        # Git ignore rules
└── README.md         # This file

License

ISC

About

A series of experiments with Claude Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors