An author platform and ecosystem built with Rails 8.1.1 - Milestone 1 MVP
MekarPad is a comprehensive platform where writers can create, edit, publish, and monetize serialized stories, and readers can discover and engage with them. The platform combines the core publishing features of platforms like Wattpad with distribution capabilities similar to Draft2Digital, creating a complete solution for independent authors.
Current Phase: Milestone 1 MVP - Building the foundational author platform with core writing, publishing, and reading features in a clean, minimal interface.
Latest Update: Epic 4 (Public Reading & Discovery) completed with 100% test coverage, performance monitoring, and multi-language support.
- Create, edit, and publish stories with chapters
- Simple text editor for content
- Cover image uploads via Active Storage
- Categorization by genre
- Draft and published status
- Basic view count tracking
- Magic link email authentication (OTP)
- Passwordless authentication with 6-digit codes
- 15-minute code expiration
- No password storage
- View all your stories (drafts and published)
- Manage chapters
- Track story statistics
- Simple, clean interface
- Discover Page: Browse newest published stories with filters
- Multi-Language Support: Filter by English, Bahasa Indonesia, Bahasa Melayu
- Category Filtering: 7 genres (Romance, Fantasy, Mystery, Thriller, SciFi, Horror, Adventure)
- Book Public Pages: Cover, description, and chapter list
- Seamless Navigation: Next/previous chapter links at top and bottom
- Performance Optimized: All pages load in <2 seconds
- Mobile-Responsive: Clean reading experience on all devices
- ✅ Epic 1: Authentication & User Roles (Complete)
- ✅ Epic 2: Authoring (Dashboard & Book Creation) (Complete)
- ✅ Epic 3: Writing (Chapter Editor) (Complete)
- ✅ Epic 4: Public Reading & Discovery (Complete - 100%)
- 🔄 Epic 5: Non-Functional & Foundation (In Progress)
This is a focused MVP. The following features are planned for future milestones:
- Monetization (coins, payments, earnings)
- Social features (comments, votes, follows, reading lists)
- Author profile pages and custom subdomains
- Marketplace integration
- External distribution (Amazon KDP, Google Books, etc.)
- Advanced customization and premium features
- Author Activation: ≥30% of new users create at least one book
- Reader Engagement: ≥50% of sessions exceed 3 minutes of reading
- Publishing Time: First-time authors can publish within 10 minutes
- Reliability: 99% uptime for MVP release
- Backend: Ruby on Rails 8.1.1
- Frontend: Hotwire (Turbo + Stimulus)
- Database: SQLite3 (development) / PostgreSQL (production)
- Storage: Active Storage for cover images
- Styling: Tailwind CSS
- Ruby: 3.3.6
bundle installbin/rails db:setupThis will:
- Create the database
- Run migrations
- Seed initial data (default coin packages, system settings)
bin/devOr for a simple Rails server:
bin/rails serverOpen your browser and navigate to http://localhost:3000
- Sign in with your email (OTP code will be in server logs during development)
- Complete your profile
- Start creating stories!
Discovering Stories (No Login Required)
- Visit the home page to see newest published stories
- Filter by Category: Romance, Fantasy, Mystery, Thriller, SciFi, Horror, Adventure
- Filter by Language: English, Bahasa Indonesia, Bahasa Melayu
- Click on any story to view cover, description, and chapter list
- Browse by combining category and language filters
Reading Stories
- Click on any story to view details
- Click on a chapter to start reading
- Use Next and Previous buttons to navigate seamlessly
- Navigation available at both top and bottom of page
- End-of-story message when reaching the last chapter
Sign In (Optional for Reading)
- Enter your email to receive an OTP code
- Check your email (or server logs in development) for the 6-digit code
- Verify code to access additional features
Creating Stories (Epic 2 Complete ✅)
- Sign in and go to Dashboard
- Click "Create New Story" or "New Story"
- Add title, description, category, language, and cover image
- Choose category from 7 genres
- Select language (English, Bahasa Indonesia, Bahasa Melayu)
- Save as draft or publish immediately
Adding Chapters (Epic 3 Complete ✅)
- Open your story from the dashboard
- Click "Add Chapter"
- Write your chapter title and content
- Save as draft or publish
- Chapters are automatically ordered
Managing Stories
- Edit story details anytime (including language and category)
- Add, edit, or delete chapters
- Toggle between draft and published status
- View basic statistics (views, chapter count)
- Your stories are discoverable by language and category filters
Create a .env file or set environment variables:
# Email Configuration
SMTP_ADDRESS=smtp.example.com
SMTP_PORT=587
SMTP_DOMAIN=example.com
SMTP_USERNAME=your_username
SMTP_PASSWORD=your_password
# Database
DATABASE_URL=postgresql://user:password@host:port/database
# Rails
RAILS_ENV=production
SECRET_KEY_BASE=your_secret_keyIn development, emails are logged to console. Check Rails server output for OTP codes.
For production, configure SMTP settings in config/environments/production.rb or use environment variables.
# Create a new migration
bin/rails generate migration MigrationName
# Run migrations
bin/rails db:migrate
# Rollback
bin/rails db:rollback
# Reset database
bin/rails db:resetThe seed file (db/seeds.rb) creates:
- Default coin packages
- System settings with default values
- Optional demo data
Run with:
bin/rails db:seedMekarPad has 168+ comprehensive tests covering all Epic 4 features:
- Unit Tests: 146 tests (controllers + models)
- Feature Tests: 30 scenarios (end-to-end user journeys)
- Performance Tests: 22 tests (validating <2s load time requirement)
Run all tests
bundle exec rspecRun specific test suites
# Epic 4 feature tests (complete user journeys)
bundle exec rspec spec/features/public_reading_discovery_spec.rb
# Performance tests (NFR validation)
bundle exec rspec spec/performance/reading_pages_spec.rb
# Controller tests
bundle exec rspec spec/controllers/
# Model tests
bundle exec rspec spec/models/Run with coverage
COVERAGE=true bundle exec rspecPerformance Testing
# Validate <2s page load requirement
bundle exec rspec spec/performance/reading_pages_spec.rb --format documentationRuboCop (Linting)
bundle exec rubocopBrakeman (Security)
bundle exec brakemanBundler Audit
bundle exec bundler-audit check --updateGET /- Discover page (browse published stories)GET /stories- Browse stories with filters?category=Romance- Filter by category?language=en- Filter by language (en/id/ms)?category=Romance&language=en- Combined filters
GET /stories/:id- View story details and chapter listGET /stories/:story_id/chapters/:id- Read chapter with navigation
GET /session/new- Login pagePOST /session- Send OTP code to emailGET /session/verify- OTP verification pagePOST /session/validate_otp- Verify OTP codeDELETE /session- Sign out
GET /user/edit- Edit profilePATCH /user- Update profileGET /dashboard- Author dashboardGET /stories/my_stories- View your storiesGET /stories/new- New story formPOST /stories- Create storyGET /stories/:id/edit- Edit storyPATCH /stories/:id- Update storyDELETE /stories/:id- Delete storyGET /stories/:story_id/chapters/new- New chapter formPOST /stories/:story_id/chapters- Create chapterGET /stories/:story_id/chapters/:id/edit- Edit chapterPATCH /stories/:story_id/chapters/:id- Update chapterDELETE /stories/:story_id/chapters/:id- Delete chapter
Build and run with Docker:
# Build image
docker build -t mekarpad .
# Run container
docker run -p 3000:3000 \
-e DATABASE_URL=your_database_url \
-e SECRET_KEY_BASE=your_secret \
mekarpadDeploy with Kamal (included in Gemfile):
# Setup
kamal setup
# Deploy
kamal deploy
# Other commands
kamal app logs
kamal app exec 'bin/rails console'- Set up PostgreSQL database
- Configure environment variables
- Precompile assets:
RAILS_ENV=production bin/rails assets:precompile - Run migrations:
RAILS_ENV=production bin/rails db:migrate - Start server:
RAILS_ENV=production bin/rails server
app/
├── controllers/ # Request handlers
├── models/ # Data models and business logic
├── views/ # HTML templates (ERB)
├── mailers/ # Email templates and logic
├── jobs/ # Background jobs
└── helpers/ # View helpers
config/
├── locales/ # Translation files (9 languages)
├── routes.rb # URL routing
└── environments/ # Environment-specific configs
db/
├── migrate/ # Database migrations
└── seeds.rb # Seed data
spec/
├── controllers/ # Controller unit tests (61 tests)
├── models/ # Model unit tests (85 tests)
├── features/ # End-to-end feature tests (30 scenarios)
└── performance/ # Performance tests (22 tests)
test/ # Minitest tests
doc/
├── EPIC4_COMPLETION_REPORT.md # Epic 4 implementation details
└── PERFORMANCE.md # Performance optimization guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Ruby Style Guide
- Run RuboCop before committing
- Write tests for new features
- Update documentation as needed
- Report security vulnerabilities to security@mekarpad.com
- Do not commit sensitive data (.env files, credentials)
- Use environment variables for all secrets
- Keep dependencies updated
Epic 4 implements strict performance requirements:
- ✅ All pages load in < 2 seconds (NFR validated with automated tests)
- ✅ Database indexes on all critical queries
- ✅ N+1 query prevention via eager loading
- ✅ Counter caches for efficient counts
- ✅ Pagination limiting (20 stories per page)
Automatic Monitoring (Production):
- Slow queries logged automatically (>100ms)
- Slow page loads logged (>2s - NFR violations)
- See
config/initializers/performance_monitoring.rb
Recommended APM Tools:
- New Relic
- Scout APM
- Skylight
- Datadog
For complete performance guide, see: doc/PERFORMANCE.md
-
Completion Report:
doc/EPIC4_COMPLETION_REPORT.md- Full implementation details
- Test coverage summary
- Production readiness checklist
-
Performance Guide:
doc/PERFORMANCE.md- Optimization strategies
- Monitoring setup
- APM recommendations
- Troubleshooting guide
- See
/prdfolder for all Product Requirements Documents prd/PRD MekarPad [1_7] Core Author Platform.md
OTP not received
- In development: Check Rails server logs for the OTP code
- In production: Verify SMTP settings in environment variables
- Check spam/junk folder
- OTP expires after 15 minutes
Can't upload cover image
- Verify Active Storage is configured
- Check file size limits
- Ensure storage directory is writable
Slow page loads (>2 seconds)
- Check
log/production.logfor slow query warnings - Review performance monitoring logs
- See troubleshooting section in
doc/PERFORMANCE.md - Run performance tests:
bundle exec rspec spec/performance/
Tests failing
- Ensure database is set up:
bin/rails db:test:prepare - Check for pending migrations:
bin/rails db:migrate - Clear test cache:
bin/rails tmp:clear
This project is available as open source under the terms of the MIT License.
This is Milestone 1 of 7 in the MekarPad platform development. Each milestone builds upon the previous to create a comprehensive author ecosystem.
Goal: Launch a working MVP where authors can write, edit, and publish serialized stories.
Deliverables:
- User registration (Magic link login)
- Author dashboard (My Books, Drafts, Published)
- Book creation (title, cover, description)
- Chapter writing + editor
- Publish/unpublish chapters
- Public book view with reading experience
- Simple feed / discover page
- Basic reader account system
- Mobile-friendly UI
User Stories organized in 5 Epics:
- Epic 1: Authentication & User Roles
- Epic 2: Authoring (Dashboard & Book Creation) ✅ Completed
- Epic 3: Writing (Chapter Editor)
- Epic 4: Public Reading & Discovery
- Epic 5: Non-Functional & Foundation
Goal: Let each author have their own page or subdomain (e.g., gilang.mekarpad.com)
Deliverables:
- Author profile page with bio, photo, social links
- List of books by the author
- Optional vanity URL or subdomain support
- Custom branding options (basic theming)
Goal: Add features for reader growth and monetization prep
Deliverables:
- Chapter locks (for email or future coins)
- Newsletter signup integration (Mailchimp, ConvertKit, etc.)
- Comments or reactions per chapter
- Book likes or bookmarks
- Author follow system
Goal: Connect published books with a marketplace
Deliverables:
- Book listing metadata (genre, price, etc.)
- Integration with MekarBooks or dedicated storefront
- Search, filters, category views
- "Add to Cart" or "Read Sample" options
- Free vs paid version control
Goal: Enable authors to earn
Deliverables:
- Coin/token purchase system (Midtrans/Xendit or Stripe)
- Unlocking content via tokens
- Author revenue dashboard
- Commission/split settings
- Payment gateway + payout integration
Goal: Enable authors to distribute books to outside platforms (Draft2Digital-style)
Deliverables:
- Manuscript export (EPUB/PDF)
- Metadata export tools
- Distribution options: Amazon KDP, Google Books, etc.
- Integration hooks (manual or API-first)
- Simple agreement & approval flow for distribution
Goal: Personal branding, premium author experience
Deliverables:
- Custom domain mapping (
authorname.com) - Page builder for authors
- Premium author themes
- Author-only analytics
- Collaboration tools (co-authoring)
For detailed product requirements, see the /prd folder which contains:
- MekarPad Milestone Plan - Complete 7-milestone roadmap
- PRD Milestone 1: Core Author Platform - Detailed requirements and user stories
- PRD README - Documentation overview and external PRD links
- ✅ Discover page with newest stories
- ✅ Category filtering (7 genres)
- ✅ Language filtering (3 languages)
- ✅ Book public pages with all details
- ✅ Seamless chapter navigation
- ✅ Performance optimized (<2s load time)
- ✅ 168+ comprehensive tests
- ✅ Production-ready monitoring
| Type | Count | Status |
|---|---|---|
| Unit Tests | 146 | ✅ |
| Feature Tests | 30 scenarios | ✅ |
| Performance Tests | 22 | ✅ |
| Total | 168+ | ✅ |
| Page | Target | Status |
|---|---|---|
| Discover Page | <2s | ✅ Validated |
| Book Page | <2s | ✅ Validated |
| Chapter Page | <2s | ✅ Validated |
- Issues: Open an issue on GitHub
- Documentation: Check
doc/directory - PRD: Check
prd/directory for product requirements - Performance: See
doc/PERFORMANCE.md - Epic 4 Details: See
doc/EPIC4_COMPLETION_REPORT.md - Product Requirements: Check
prd/directory for detailed PRDs and milestone plans - Documentation: See
prd/README.mdfor complete documentation overview
Built with:
- Ruby on Rails 8.1.1
- Hotwire (Turbo + Stimulus)
- SQLite3 / PostgreSQL
- Active Storage
- Tailwind CSS
- RSpec (Testing framework)
- Capybara (Feature testing)
Last Updated: 2025-11-12 | Epic 4 Status: ✅ Complete (100%)