A modern personal website with a React frontend and Rails API backend, deployed with Docker and Kamal.
# Install dependencies and setup database
bin/setup
# Start development servers (React + Rails)
bin/devThen open http://localhost:3000 in your browser.
- Ruby 3.4+
- Node.js 20+
- Docker (for production builds)
This is a monorepo with:
frontend/- React app (Vite, React Router, Tailwind CSS)app/- Rails API backendconfig/- Rails configurationdb/- Database schemas and migrations
See docs/ARCHITECTURE.md for detailed architecture information.
bin/devThis runs:
- React dev server on http://localhost:3000
- Rails API on http://localhost:3001
bin/rails consoleThen create a company:
Company.create!(
name: "Acme Corp",
ticker: "ACME",
current_revenue: 150,
previous_revenue: 100,
milestone_amount: 150,
milestone_crossed_at: Date.today
)- Create a component in
frontend/src/pages/YourPage.jsx - Add a route in
frontend/src/App.jsx - That's it! React Router handles the rest.
- Create a controller in
app/controllers/api/v1/ - Add routes in
config/routes.rb - Fetch from React with
fetch('/api/v1/endpoint')
See QUICKSTART.md for more examples.
QUICKSTART.md- Getting started guidedocs/ARCHITECTURE.md- System design and architectureMIGRATION_SUMMARY.md- What changed from the old setupCONVERSION_CHECKLIST.md- Verification checklistDEPRECATED_CONTROLLERS.md- Old Rails files (safe to delete)
GET /api/v1/companies- List all companiesGET /api/v1/companies/:id- Get a companyPOST /api/v1/companies- Create a companyPUT /api/v1/companies/:id- Update a companyDELETE /api/v1/companies/:id- Delete a company
docker build -t rieth-site .docker run -p 3000:80 \
-e RAILS_MASTER_KEY=<your-key> \
rieth-sitekamal deploySee config/deploy.yml for deployment configuration.
- React 19 - UI framework
- Vite - Build tool
- React Router v7 - Client-side routing
- Tailwind CSS - Styling
- React Hooks - State management
- Rails 8 - Web framework
- PostgreSQL - Database
- Puma - Web server
- rack-cors - CORS handling
- Docker - Containerization
- Kamal - Deployment orchestration
- Let's Encrypt - SSL certificates
bin/rails testcd frontend && npm test- CORS configured for localhost and production domain
- Rails CSRF protection on POST requests
- Environment variables for secrets (RAILS_MASTER_KEY, DB password)
- SSL/HTTPS enforced in production
VITE_API_URL- API URL for React app (default: http://localhost:3001)
RAILS_MASTER_KEY- Rails credentials keyRAILS_ENV- Set toproduction
- Check both servers are running:
bin/dev - Verify Rails on port 3001: http://localhost:3001/api/v1/companies
- Check browser console for CORS errors
bin/rails db:create
bin/rails db:migratecd frontend && rm -rf node_modules && npm install && cd ..- Check Node version:
node --version(should be 20+) - Check Ruby version:
ruby --version(should be 3.4+) - View build logs:
docker build -t test . 2>&1 | tail -50
- Database stored in
db/development.sqlite3 - No server needed - just run
bin/dev - Production also uses SQLite (in
db/production.sqlite3)
- React documentation
- Rails guides
- Vite documentation
- React Router documentation
- Tailwind CSS documentation
This project is open source and available under the MIT License.
John Rieth - rieth.dev