mjgold / examples-sinatra

A repository of example Sinatra apps illustrating common patterns in web development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples: Sinatra

This repository will contain examples of common web development patterns implemented with the Sinatra framework.

Current Examples

The authentication directory contains an example Sinatra application that implements basic user authentication, i.e., signing up, logging in, and logging out.

The public-file-upload directory contains an example Sinatra application that implements a basic photo gallery to demonstrate how file uploading and manipulation works. It saves the files in the public/photos directory, which means it won't work on Heroku since Heroku has a read-only file system.

In that environment, you would need to save photos to Amazon's Simple Storage Service (aka S3) or a similar third-party hosting service.

Like the Public File Upload example, this Sinatra application implements a basic photo gallery. It's located in the s3-file-upload directory.

However, rather than saving the files to the public/photos directory, this application processes user uploads and then sends them up to Amazon's Simple Storage Service (aka S3). This is necessary on services like Heroku which have a read-only file system.

You will have to sign up for an Amazon Web Services (AWS) account in order to do this.

The flash-messages directory contains an example Sinatra application that implements a common feature in web applications: displaying a temporary message about the results of a previous HTTP request.

For example, if you try to login but enter the wrong password, you could use a "flash" to display an error message after redirecting to the login page.

This application uses a custom implementation of a "flash" behavior on top of Sinatra's session feature. It is inspired by the rack-flash and Rails' ActionDispatch::Flash.

Facebook Login (Coming Soon)

Sending Email (Coming Soon)

Background Processes (Coming Soon)

About

A repository of example Sinatra apps illustrating common patterns in web development


Languages

Language:Ruby 65.3%Language:HTML 20.6%Language:CSS 14.1%