Skip to content

feather-page/cms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

583 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feather-Page CMS

RSpec Coverage Status

Feather-Page CMS is a Ruby on Rails application that provides a web interface for managing small static websites. It generates static sites directly using Rails ERB templates and provides a simple management UI.

Design Goals

  • A simple interface that can be used by non-technical users.
  • Website should look like a real web-developer hand-coded them.
  • Deployed websites should be static.
  • Deployed websites should NOT load any external resources.
  • Deployed websites should be as small as possible.
  • Deployed websites should be SEO friendly.
  • Deployed websites are on domains that belong to the user.

Requirements

  • Ruby: 4.0.1 (as specified in Gemfile)
  • Node.js & npm: Required for JavaScript assets and Jest tests.
  • System Dependencies:
    • rclone: Used for syncing files to deployment targets.
    • libvips: Image processing library.
    • PostgreSQL: Database.

Setup

  1. Install system dependencies:

    brew install rclone libvips postgresql
  2. Install Ruby dependencies:

    bundle install
  3. Install JavaScript dependencies:

    npm install
  4. Prepare the database:

    cp .env.example .env # Configure your database credentials
    rails db:create
    rails db:schema:load

    Alternatively, you can use:

    bin/setup

Running the Application

To start the Rails server along with background workers (Sidekiq) and other services:

foreman start

Or start just the Rails server:

bin/dev
# or
rails s

Environment Variables

Variable Description Default/Example
BASE_HOSTNAME_AND_PORT Base domain for staging URLs localhost:3000
HTTPS Whether to use HTTPS false
POSTGRES_HOST Database host localhost
POSTGRES_USERNAME Database username postgres
POSTGRES_PASSWORD Database password postgres
SMTP_ADDRESS Mail server address localhost
SMTP_PORT Mail server port 1025
STAGING_SITES_PATH Path where staging sites are built (Defined in Kamal/Production)
UNSPLASH_ACCESS_KEY Unsplash API access key (optional) Get from https://unsplash.com/developers

Unsplash Integration (Optional)

The CMS supports header images with Unsplash integration for posts and pages.

Setup

  1. Create an account at https://unsplash.com/developers
  2. Create a new application (select "Demo" for testing)
  3. Copy your Access Key
  4. Configure credentials:
    EDITOR=nano rails credentials:edit
  5. Add your Unsplash access key:
    unsplash:
      access_key: YOUR_ACCESS_KEY_HERE
  6. Save and close the editor

Alternatively, you can set the UNSPLASH_ACCESS_KEY environment variable in your .env file.

Note: Without Unsplash credentials, users can still upload header images manually - they just won't be able to search Unsplash.

Scripts

  • bin/setup: Automated setup and database preparation.
  • bin/dev: Starts the Rails server.
  • npm run lint: Runs JavaScript linting (standard).
  • bundle exec rubocop: Runs Ruby linting.

Testing

Ruby Tests (RSpec)

bundle exec rspec

JavaScript Tests (Jest)

npm test

Project Structure

  • app/interactions/: Business logic organized using the LightService gem.
  • app/components/: Reusable UI elements using ViewComponent.
  • app/javascript/: Modern JavaScript using Import Maps.
  • spec/: Comprehensive test suite (RSpec and Jest).
  • config/deploy.yml: Kamal deployment configuration.

Deployment

This project uses Kamal for deployment.

kamal lock release -d production
kamal envify -d production
kamal accessory boot all -d production
kamal deploy -d production

License

TODO: Add license information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •