Skip to content

Repository files navigation

Accelerated Golang Course - ADHD-Friendly Learning Platform

A modern, containerized learning platform for transitioning from Python/TypeScript to Go, designed with ADHD-friendly features and built with Tailwind CSS for responsive design.

Features

  • 🎯 ADHD-Friendly Design: 45-minute focused sessions with break reminders
  • πŸŒ™ Full Dark Mode: Complete dark/light theme support with Tailwind CSS
  • πŸ“± Responsive Design: Mobile-first design that works on all devices
  • πŸ’Ύ Persistent Progress: PostgreSQL database with Docker volumes for data persistence
  • πŸ”„ Real-time Sync: Progress automatically saved and synced across sessions
  • 🎨 Modern UI: Built with Tailwind CSS for beautiful, accessible design
  • 🐳 Docker Ready: Fully containerized with Docker Compose

Quick Start with Docker

Prerequisites

  • Docker and Docker Compose installed on your system
  • Git (to clone the repository)

1. Clone and Setup

git clone <repository-url>
cd golang_course_guide

2. Environment Configuration

Copy the example environment file and customize if needed:

cp .env.example .env

The default configuration works out of the box with Docker Compose.

3. Build and Run

# Build and start all services
docker-compose up --build

# Or run in detached mode
docker-compose up --build -d

4. Access the Application

5. Stop the Application

# Stop services
docker-compose down

# Stop and remove volumes (⚠️ This will delete all data)
docker-compose down -v

Development Setup

Local Development with Docker

For development with hot reloading:

# Start only the database
docker-compose up postgres -d

# Install dependencies locally
npm install

# Run development server with CSS watching
npm run dev

Manual Setup (Without Docker)

  1. Install Dependencies:

    npm install
  2. Setup PostgreSQL:

    • Install PostgreSQL locally
    • Create database: golang_course
    • Update .env with your database credentials
  3. Build CSS:

    npm run build:css
  4. Start Application:

    npm start

Project Structure

golang_course_guide/
β”œβ”€β”€ public/                 # Static files served by Express
β”‚   β”œβ”€β”€ index.html         # Main HTML file with Tailwind classes
β”‚   β”œβ”€β”€ app.js            # Frontend JavaScript with API integration
β”‚   └── style.css         # Generated Tailwind CSS
β”œβ”€β”€ src/                   # Source files for building
β”‚   └── input.css         # Tailwind CSS input file
β”œβ”€β”€ models/               # Database models (Sequelize)
β”‚   β”œβ”€β”€ index.js         # Database connection and associations
β”‚   β”œβ”€β”€ UserProgress.js  # User progress tracking
β”‚   β”œβ”€β”€ CompletedSection.js # Completed sections
β”‚   └── UserSettings.js  # User preferences
β”œβ”€β”€ routes/              # API routes
β”‚   └── progress.js     # Progress tracking endpoints
β”œβ”€β”€ scripts/            # Database and utility scripts
β”‚   └── init-db.sql    # Database initialization
β”œβ”€β”€ server.js          # Express server setup
β”œβ”€β”€ Dockerfile         # Docker container configuration
β”œβ”€β”€ docker-compose.yml # Multi-container setup
β”œβ”€β”€ tailwind.config.js # Tailwind CSS configuration
└── package.json       # Dependencies and scripts

API Endpoints

Progress Tracking

  • GET /api/progress - Get user progress and settings
  • PUT /api/progress/current-section - Update current section
  • POST /api/progress/complete-section - Mark section as complete
  • PUT /api/progress/settings - Update user settings
  • GET /api/progress/stats - Get progress statistics

Health Check

  • GET /api/health - Application health status

Database Schema

Tables

  • user_progress: Tracks user sessions and overall progress
  • completed_sections: Records completed lessons and labs
  • user_settings: Stores user preferences and settings

Data Persistence

  • PostgreSQL database with Docker volumes
  • Automatic schema creation via Sequelize
  • Data persists across container restarts

Customization

Tailwind CSS

The application uses Tailwind CSS for styling. To customize:

  1. Edit tailwind.config.js for theme customization
  2. Modify src/input.css for custom components
  3. Rebuild CSS: npm run build:css

Dark Mode

Dark mode is implemented using Tailwind's class-based strategy:

  • Toggle via the theme button in the header
  • Preference saved to database and localStorage
  • All components support both light and dark themes

Responsive Design

The application is mobile-first with breakpoints:

  • xs: 475px and up
  • sm: 640px and up
  • md: 768px and up (tablet)
  • lg: 1024px and up (desktop)
  • xl: 1280px and up (large desktop)

Troubleshooting

Common Issues

  1. Port Already in Use:

    # Check what's using port 3000
    lsof -i :3000
    # Kill the process or change the port in docker-compose.yml
  2. Database Connection Issues:

    # Check if PostgreSQL container is running
    docker-compose ps
    # View logs
    docker-compose logs postgres
  3. CSS Not Loading:

    # Rebuild CSS
    npm run build:css
    # Or rebuild the entire container
    docker-compose up --build

Logs and Debugging

# View application logs
docker-compose logs app

# View database logs
docker-compose logs postgres

# Follow logs in real-time
docker-compose logs -f app

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with Docker: docker-compose up --build
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages