├── .gitignore ├── LICENSE ├── README.md ├── app ├── assets │ └── .gitkeep ├── config.coffee ├── controllers │ ├── .gitkeep │ └── example-controller.coffee ├── helpers.coffee ├── initialize.coffee ├── routes.coffee ├── start.coffee ├── validators.coffee └── views │ ├── .gitkeep │ └── hello.eco ├── bower.json ├── brunch-config.coffee ├── core ├── bootstrap.coffee ├── controller.coffee └── view.coffee ├── package.json └── vendor └── .gitkeep /.gitignore: -------------------------------------------------------------------------------- 1 | # Numerous always-ignore extensions 2 | *.diff 3 | *.err 4 | *.orig 5 | *.log 6 | *.rej 7 | *.swo 8 | *.swp 9 | *.vi 10 | *~ 11 | *.sass-cache 12 | 13 | # OS or Editor folders 14 | .DS_Store 15 | .cache 16 | .project 17 | .settings 18 | .tmproj 19 | nbproject 20 | Thumbs.db 21 | 22 | # NPM packages folder. 23 | node_modules/ 24 | 25 | # Brunch folder for temporary files. 26 | tmp/ 27 | 28 | # Brunch output folder. 29 | public/ 30 | 31 | # Bower stuff. 32 | bower_components/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  2 | 3 | # Notes 4 | 5 | This project is quite outdated, still it's working on production for some web applications I built for companies. I will convert the website into a wiki when I will find a bit of time :) 6 | 7 | # Gotham JS Framework 8 | 9 | Gotham is a web application framework for front-end development. After crafting many web applications using Laravel and Rails I couldn't find a simple front-end framework to manage my Javascript. I wanted to code my front-end with an expressive syntax, install a package and use it without any pain. To require/include functions like you can in others languages, execute something when i need it, and do it all in an elegant, logical way. 10 | 11 | Gotham was born. 12 | 13 | # Official Documentation 14 | 15 | Documentation for the framework can be found on the [Gotham website](http://gothamjs.io/documentation). 16 | 17 | # Community 18 | 19 | ### Chat 20 | [](https://gitter.im/gothamjs/framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 21 | 22 | Want to speak with me or the community ? Join us on Gitter. 23 | 24 | ### Bugs 25 | You found a bug ? Let me know. 26 | 27 | # License 28 | 29 | The Gotham framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 30 | -------------------------------------------------------------------------------- /app/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gothamjs/framework/92fd1e1bcd291c0c51033fc7923f021c74beaf95/app/assets/.gitkeep -------------------------------------------------------------------------------- /app/config.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Config 3 | #-------------------------------------------------------------------------- 4 | # 5 | # Sometimes you need to put some configuration variables for your project, 6 | # here it's the right place for that ! 7 | # 8 | # Config = require 'config' 9 | # console.log Config.app.name 10 | ## 11 | 12 | module.exports = 13 | 14 | # Example 15 | app: 16 | name: 'My Gotham Application' 17 | version: 0.1 18 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | .gitkeep -------------------------------------------------------------------------------- /app/controllers/example-controller.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Example Controller 3 | #-------------------------------------------------------------------------- 4 | # 5 | # That controller is just an example. 6 | # 7 | # @see http://gothamjs.io/documentation/1.0.0/controllers 8 | ## 9 | 10 | # Require the controller library of Gotham 11 | Controller = require 'core/controller' 12 | 13 | 14 | class Example extends Controller 15 | 16 | ## 17 | # Before 18 | # 19 | # Executed before the run action. You can use 20 | # @stop() in this method to stop the execution 21 | # of the controller 22 | # 23 | ## 24 | before: -> 25 | 26 | ## 27 | # Run 28 | # 29 | # The main entry of the controller. 30 | # Your code start here 31 | # 32 | ## 33 | run: -> 34 | 35 | 36 | # Export 37 | module.exports = Example 38 | -------------------------------------------------------------------------------- /app/helpers.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Helpers 3 | #-------------------------------------------------------------------------- 4 | # 5 | # If you need to create some functions to use in your application, you are 6 | # in the right place ! 7 | # 8 | # Gotham uses lo-dash and the concept of mixins. 9 | # 10 | # @see http://gothamjs.iodocumentation/1.0.0/helpers 11 | ## 12 | 13 | ## 14 | # Example 15 | # 16 | # Check if the user is batman 17 | # 18 | # @param [string] Name of the user 19 | ## 20 | _.mixin isBatman: (name) -> 21 | 22 | if name.toLowerCase() is "batman" 23 | return true 24 | 25 | return false 26 | -------------------------------------------------------------------------------- /app/initialize.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Initialize 3 | #-------------------------------------------------------------------------- 4 | # 5 | # It's the main entry of your gotham application. We will require the 6 | # bootstrap file and run gotham. 7 | ## 8 | Bootstrap = require 'core/bootstrap' 9 | 10 | # Hey sir, is the document ready ? 11 | $ -> 12 | 13 | # Yep ! We will run gotham ! 14 | bootstrap = new Bootstrap 15 | 16 | # We set the browser's request 17 | request: window.location.pathname 18 | 19 | bootstrap.run() 20 | -------------------------------------------------------------------------------- /app/routes.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Routes 3 | #-------------------------------------------------------------------------- 4 | # 5 | # All routes of your application. 6 | # 7 | # @see http://gothamjs.io/documentation/1.0.0/routing 8 | ## 9 | 10 | module.exports = (route) -> 11 | 12 | #-------------------------------------------------------------------------- 13 | # Basic routing 14 | #-------------------------------------------------------------------------- 15 | # 16 | # route.match '/welcome', -> 17 | # 18 | # console.log "Hello" 19 | # 20 | # If the url is like www.domain.com/welcome, gotham will 21 | # display "Hello" in the console log. 22 | # 23 | # @see http://gothamjs.io/documentation/1.0.0/routing#basic-routing 24 | ## 25 | 26 | 27 | #-------------------------------------------------------------------------- 28 | # Route parameters 29 | #-------------------------------------------------------------------------- 30 | # 31 | # route.match '/users/show/:id', (params) -> 32 | # 33 | # console.log 'User #' + params.id 34 | # 35 | # If the url is like www.domain.com/users/show/3, gotham will 36 | # display "User #3" in the console log. 37 | # 38 | # @see http://gothamjs.io/documentation/1.0.0/routing#route-parameters 39 | ## 40 | 41 | #-------------------------------------------------------------------------- 42 | # Routing to controllers 43 | #-------------------------------------------------------------------------- 44 | # 45 | # route.match '/kill-batman', 'batman.kill' 46 | # 47 | # If the url is like www.domain.com/kill-batman, gotham will 48 | # execute the controller app/controllers/batman/kill.coffee 49 | # 50 | # @see http://gothamjs.io/documentation/1-0-0/controllers#route 51 | ## 52 | 53 | #-------------------------------------------------------------------------- 54 | # Route constraints 55 | #-------------------------------------------------------------------------- 56 | # 57 | # route.match '/kill/:name', 'batman.kill', (params) -> 58 | # 59 | # if params.name is 'Batman' 60 | # return true 61 | # 62 | # return false 63 | # 64 | # If the url is like www.domain.com/kill/joker, gotham will not 65 | # execute the controller app/controllers/batman/kill.coffee 66 | # 67 | # @see http://gothamjs.io/documentation/1.0.0/routing#route-constraints 68 | ## 69 | -------------------------------------------------------------------------------- /app/start.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Start 3 | #-------------------------------------------------------------------------- 4 | # 5 | # Gotham will run after that file the router system. It's the right place 6 | # to put some code to execute globally like the init of jQuery plugins, etc. 7 | ## 8 | 9 | #-------------------------------------------------------------------------- 10 | # Example 11 | #-------------------------------------------------------------------------- 12 | # 13 | # We want to say hello to the developer :) 14 | ## 15 | 16 | # Load library View of Gotham 17 | View = require 'core/view' 18 | 19 | # Invoke View 20 | view = new View() 21 | 22 | # Load view 23 | hello = view.render 'hello', {framework: 'Gotham'} 24 | 25 | # Inject in the html 26 | $('body').html hello 27 | -------------------------------------------------------------------------------- /app/validators.coffee: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | # Errors 3 | #-------------------------------------------------------------------------- 4 | # 5 | # If you want to change / add errors for the Validator library, you can 6 | # do it here. 7 | # 8 | # @see http://gothamjs.io/documentation/1.0.0/validator#custom-error 9 | ## 10 | Validator.errors 11 | 12 | #-------------------------------------------------------------------------- 13 | # Attributes 14 | #-------------------------------------------------------------------------- 15 | # 16 | # If you want to change / add attributes for the Validator library, you can 17 | # do it here. 18 | # 19 | # @see http://gothamjs.io/documentation/1.0.0/validator#change-attributes 20 | ## 21 | Validator.attributes 22 | -------------------------------------------------------------------------------- /app/views/.gitkeep: -------------------------------------------------------------------------------- 1 | .gitkeep -------------------------------------------------------------------------------- /app/views/hello.eco: -------------------------------------------------------------------------------- 1 | 62 | 63 |
I'm executed by `start.coffee` and you can find me in `views/hello.eco`
69 | Documentation 70 |