Lightweight web framework codebase. Just clone and develop on it.
Tech component: Rack+Sinatra+Sequel and default use Postgresql database.
Add rails-like migration command line helpers.
- Multi Env Configuration
- Multi router DSL base on Rack
- CORS support
- Hot reload
- Custom logger
- ORM base on Sequel
- Rails-like migration helpers
- Test
- Seed
- Dockerfile
config/*.config.rb
you can define something here to do boot jobs.
Setting database environment vars:
DATABASE_HOST
DATABASE_PORT
DATABASE_NAME
DATABASE_USER
DATABASE_PASSWORD
rake
or rake -T
all tasks in config/tasks
, you can edit by yourself.
rake server:dev
rake server:prod
you can also use docker
docker built -t <what your docker image label> .
Provide rails-like rake task help you build app quickly.
rake db:check # Checking for current migrations
rake db:connect # Connect database
rake db:console # Database Console
rake db:create[database_name] # Create database
rake db:create_migration[name] # Create a migration
rake db:drop[database_name] # Drop database
rake db:ls # List database tables
rake db:migrate[version] # Run migrations
rake db:rollback[version] # Rollback to migration
rake db:version # Prints current schema version
rake docker:push[version] # Push Docker
rake list # List all tasks
rake server:dev # Start development server
rake server:prod # Start production server
rake test # Run tests
.
├── Dockerfile
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
├── Rakefile
├── app
│ ├── app.rb
│ ├── middlewares
│ │ ├── sample.middleware.rb
│ │ └── sample_auth.middleware.rb
│ ├── models
│ │ └── sample.model.rb
│ ├── routes
│ │ └── hello.route.rb
│ └── tests
│ └── sample.test.rb
├── config
│ ├── core
│ │ ├── base.rb
│ │ └── connect_sequel.rb
│ ├── cors.rb
│ ├── database.rb
│ ├── logger.rb
│ ├── server.rb
│ └── setting.rb
├── config.ru
├── logs
│ ├── development.log
│ └── production.log
├── migrations
└── tasks
├── db.task.rb
├── docker.task.rb
├── server.task.rb
└── test.task.rb