Skip to content

DeySulit/abc-journal

Repository files navigation

ABC Journal

A web application for tracking and analyzing ABC (Antecedent-Behavior-Consequence) data for children. This tool helps parents and guardians log behavioral patterns, identify trends, and export data for professional review.

Features

  • Multi-User Support: Secure authentication allowing multiple families to use the same instance
  • Child Profiles: Manage multiple children per family
  • ABC Data Logging: Record detailed information about:
    • Antecedent (what happened before)
    • Behavior (what the child did)
    • Consequence (what happened after)
    • Additional context: duration, intensity, location, notes
  • Analytics Dashboard: View trends and patterns including:
    • Most common behaviors and triggers
    • Intensity distribution
    • Timeline trends
  • Data Export: Export entries to CSV format for external analysis
  • Responsive Design: Works on desktop and mobile devices

Technology Stack

  • Frontend: React with Vite
  • Backend: Node.js with Express
  • Database: SQLite with better-sqlite3
  • Authentication: JWT with bcrypt

Getting Started

Option 1: Docker (Recommended for Production)

Prerequisites

  • Docker Engine 20.10+
  • Docker Compose 2.0+

Quick Start

# Clone the repository
git clone <your-repo-url>
cd abc-journal

# Create environment file
cp .env.example .env

# Generate a secure JWT secret
openssl rand -base64 32

# Edit .env and add the JWT secret
nano .env

# Create data directory
mkdir -p data

# Start the application
docker-compose up -d

# Access at http://localhost:3100

See DEPLOYMENT.md for complete deployment documentation.

Option 2: Local Development

Prerequisites

  • Node.js (v16 or higher)
  • npm

Installation

  1. Install dependencies:
npm install
  1. Initialize the database:
npm run db:migrate
  1. Start the development server:
npm run dev

This will start both the backend server (port 3100) and the frontend development server (port 3000).

  1. Open your browser and navigate to http://localhost:3000

Production Build

To build the frontend for production:

npm run build

To preview the production build:

npm run preview

Docker Commands

# Production
docker-compose up -d              # Start in background
docker-compose logs -f            # View logs
docker-compose down               # Stop
docker-compose restart            # Restart

# Development (with hot reload)
docker-compose -f docker-compose.dev.yml up

# Backup database
cp data/abc-journal.db data/backup-$(date +%Y%m%d).db

Development Commands

  • npm run dev - Start both frontend and backend in development mode
  • npm run server:dev - Start only the backend server
  • npm run client:dev - Start only the frontend development server
  • npm run build - Build the frontend for production
  • npm run lint - Run ESLint
  • npm test - Run tests
  • npm run db:migrate - Initialize or update the database schema

Project Structure

abc-journal/
├── client/               # React frontend
│   ├── src/
│   │   ├── components/  # Reusable components
│   │   ├── pages/       # Page components
│   │   ├── styles/      # CSS files
│   │   └── utils/       # Utility functions (API client)
│   └── index.html
├── server/              # Node.js backend
│   ├── db/             # Database configuration and migrations
│   ├── middleware/     # Express middleware (auth)
│   └── routes/         # API routes
└── package.json

Usage

  1. Register: Create an account with email and password
  2. Add Children: Navigate to "Manage Children" to add child profiles
  3. Log Entries: Click "New Entry" to record ABC data
  4. View Analytics: Select a child and click "View Analytics" to see trends
  5. Export Data: Use "Export CSV" to download data for external analysis

Security Notes

  • JWT Secret: Always set a strong JWT_SECRET in production environments
    • Generate with: openssl rand -base64 32
    • Configure in .env file
  • Data is stored locally in a SQLite database
  • Passwords are hashed using bcrypt (10 rounds)
  • All API endpoints (except auth) require authentication

Deployment

For production deployment with Docker, reverse proxy setup, monitoring, and troubleshooting, see DEPLOYMENT.md.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT

About

A web application for tracking and analyzing ABC (Antecedent-Behavior-Consequence) data for children. This tool helps parents and guardians log behavioral patterns, identify trends, and export data for professional review.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors