Skip to content

Building Structuring Sinatra Web Application with Scaffold Code

Notifications You must be signed in to change notification settings

liyancode/Arowana

 
 

Repository files navigation

#Structuring Sinatra Web Application Scaffold


Starting from here to create your own web applications, or you want to learn how to wirte a sinatra module based app by example

##Folder structure for Arowana:
folder-chart

##MVC flow chart:
MVC-chart

##Precondition:

  • bundle install
  • check how to start the postgresql service in c9.io
  • set username/pwd as postgres/root if you use my default settings
  • create sinatra_web DB
postgres=# create database "sinatra_web";
  • create "user" table in postgresql DB
CREATE TABLE "user" (
	id serial Primary key NOT NULL,
	username varchar(50) NOT NULL,
	pwd varchar(50) NOT NULL,
	permission varchar(10) NOT NULL
);
  • insert one record into user table
INSERT INTO "user" (username, pwd, permission) VALUES ('admin', 'admin', 'rw');
  • more psql commands, refer to docs

##How to run

On c9.io:

$ rackup config.ru -p $PORT -o $IP  

On your local machine:

$ rackup config.ru  

##Thanks To Sinatra Framework
Structuring Sinatra Applications
Structuring Sinatra Apps
c9.io

About

Building Structuring Sinatra Web Application with Scaffold Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 79.9%
  • CSS 20.1%