A modern web application built with React (TypeScript) frontend and Ruby on Rails backend, containerized for easy deployment.
- Docker
- Docker Compose
- Clone the repository:
git clone <repository-url>
cd <repository-name>
- Generate a secret key for Rails:
SECRET_KEY_BASE=$(openssl rand -hex 64)
- Start the application:
SECRET_KEY_BASE=$SECRET_KEY_BASE docker-compose up --build
The application will be available at:
- Frontend and API: http://localhost:3000
While Docker Compose is the recommended way to run the application, you can also set up the development environment locally:
cd fullstack-app
bundle install
bundle execrails db:create db:migrate
bundle exec rails server
cd ../fullstack-app-frontend
yarn install
yarn dev
SECRET_KEY_BASE=$SECRET_KEY_BASE docker-compose up --build
docker-compose down
docker-compose logs -f
docker-compose exec web rails db:migrate
docker-compose exec db psql -U postgres -d fullstack_app_production
docker-compose build
SECRET_KEY_BASE
: Rails secret key for production (generated in quick start)
POSTGRES_USER
: Database username (default: postgres)POSTGRES_PASSWORD
: Database password (default: postgres)RAILS_ENV
: Rails environment (default: production)RAILS_LOG_TO_STDOUT
: Enable logging to stdout (default: true)
PostgreSQL data is persisted in a Docker volume. To remove all data:
docker-compose down -v
Run tests inside the containers:
# Backend tests
docker-compose exec web rails test
# Frontend tests
docker-compose exec web sh -c 'cd /app/frontend && yarn test'
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.