-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from sebastianconcept/10-Fix-builder
10 fix builder
- Loading branch information
Showing
50 changed files
with
1,645 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Unit Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
smalltalk: [Pharo64-10, Pharo64-11] | ||
name: ${{ matrix.smalltalk }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: hpi-swa/setup-smalltalkCI@v1 | ||
with: | ||
smalltalk-image: ${{ matrix.smalltalk }} | ||
- name: Load Image and Run Tests | ||
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/.unit-tests.ston | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
timeout-minutes: 15 | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
name: ${{matrix.os}}-${{matrix.smalltalk}} | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SmalltalkCISpec { | ||
#loading : [ | ||
SCIMetacelloLoadSpec { | ||
#baseline : 'Ride', | ||
#directory : '', | ||
#load : [ 'Core', | ||
'Tests' | ||
], | ||
#platforms : [ #pharo | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SmalltalkCISpec { | ||
#loading : [ | ||
SCIMetacelloLoadSpec { | ||
#baseline : 'Ride', | ||
#directory : '../', | ||
#load : [ 'Core', 'Tests' ], | ||
#platforms : [ #pharo ] | ||
} | ||
], | ||
#testing : { | ||
#coverage : { | ||
#packages : [ 'Ride', 'Ride-Builder', 'Ride-Pharo' ], | ||
#format: #lcov | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Add auth to your Ride-based web application | ||
|
||
To be done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Building a Twitter like application with Ride | ||
|
||
To be done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Deploying your Ride-based web application on the cloud | ||
|
||
To be done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Make Blog with comments using Ride in 8 minutes | ||
|
||
To be done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,166 @@ | ||
# Ride | ||
|
||
The Smalltalk web application framework with productivity as a feature. | ||
|
||
### Install in a Pharo image | ||
[![Release](https://img.shields.io/github/v/tag/sebastianconcept/ride?label=release)](https://github.com/sebastianconcept/ride/releases) | ||
[![Unit Tests](https://github.com/sebastianconcept/ride/actions/workflows/build.yml/badge.svg)](https://github.com/sebastianconcept/ride/actions/workflows/build.yml) | ||
|
||
Essential core: | ||
[![Coverage Status](https://codecov.io/github/sebastianconcept/ride/coverage.svg?branch=main)](https://codecov.io/gh/sebastianconcept/ride/branch/master) | ||
|
||
```Smalltalk | ||
Metacello new | ||
baseline: 'Ride'; | ||
repository: 'github://sebastianconcept/ride'; | ||
load. | ||
[![Pharo 11](https://img.shields.io/badge/Pharo-11-%23383932.svg)](https://pharo.org/download) | ||
[![Pharo 10](https://img.shields.io/badge/Pharo-10-%23383932.svg)](https://pharo.org/download) | ||
|
||
[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE.txt) | ||
[![Social](https://img.shields.io/github/stars/sebastianconcept/ride?style=social)]() | ||
|
||
[![Commits](https://img.shields.io/github/commit-activity/m/sebastianconcept/ride)](https://github.com/sebastianconcept/ride/graphs/commit-activity) | ||
|
||
## Features | ||
|
||
- MVP - Model-View-Presenter architecture. | ||
- Declarative routing. | ||
- Multiple View options for rendering HTML, JSON, XML and more. | ||
- Default Views based in smart efficient templates using [STTemplate](https://github.com/sebastianconcept/STTemplate). | ||
- Versatile and comfortable persistence without lock-in using [Mapless](https://github.com/sebastianconcept/Mapless). | ||
- Intuitive conventions. | ||
- Made with scalability and performance in mind. | ||
- [RESTful](https://restfulapi.net/). | ||
- Builder to scaffold useful code fast. | ||
- ~~Basic validation~~. To be done. | ||
- Optional custom JavaScript for presenters. | ||
- AJAX via [htmx](https://htmx.org/). | ||
- ~~Able to deploy containerized from day one~~. To be done. | ||
|
||
--- | ||
|
||
1. [Description](#description) | ||
2. [Examples](#examples) | ||
3. [Hello World](#hello-world) | ||
4. [Install](#install) | ||
5. [Guides](#guides) | ||
6. [Talks](#talks) | ||
|
||
## Description | ||
|
||
Ride is a framework designed for building Web Applications and [RESTful](https://restfulapi.net/) APIs, optimizing for developer productivity while preserving production efficiency and scalability. Ride focuses on eliminating the hurdles to quickly build and deploy real projects without compromising your architecture's ability to scale in production. | ||
|
||
It comes equipped with a builder that streamlines the process of scaffolding models, views, presenters, [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations and their unit tests for the models you need. Ride removes many technical obstacles, allowing you to progress rapidly in your application development journey from proof of concept and startup product to a growing business. | ||
|
||
## Install | ||
|
||
#### Fetch a fresh Pharo image | ||
|
||
``` | ||
mkdir my-ride-app | ||
cd my-ride-app | ||
curl get.pharo.org/64/100 | bash | ||
curl get.pharo.org/64/vm100 | bash | ||
``` | ||
|
||
All optionals: | ||
And run it | ||
|
||
``` | ||
./pharo-ui Pharo.image | ||
``` | ||
|
||
#### Install Ride in it | ||
|
||
```Smalltalk | ||
Metacello new | ||
baseline: 'Ride'; | ||
repository: 'github://sebastianconcept/ride'; | ||
load: #('Core' 'Examples' 'Tools'). | ||
onConflict: [ :ex | ex useIncoming ]; | ||
load. | ||
``` | ||
|
||
### Snippets | ||
Handy to start stop the Ride in the Welcome example app: | ||
## Examples | ||
|
||
```Smalltalk | ||
"Stop anything Ride that is currently running in the image and reset caches" | ||
Ride stop; reset. | ||
RideWelcomeApp install. | ||
"A Ride-based application has its own helper RideService subclass. Like BlogApp in this example:" | ||
"Install BlogApp as the Ride service" | ||
BlogApp install. | ||
Ride stop. | ||
Ride start. | ||
"Start and stop the service" | ||
BlogApp start. | ||
BlogApp stop. | ||
Ride restart. | ||
"Service restart" | ||
BlogApp restart. | ||
``` | ||
|
||
### Enhancing developer productivity | ||
Ride offers you a convenient way to quickly draft the basic elements needed for implementing a feature based in a new model. For example, given a CoffeeSystem web application a new `CoffeeInvoice` model, you could: | ||
#### Enhanced developer productivity | ||
|
||
Ride offers you a convenient way to quickly create the basic elements needed for implementing basic operations in a new model. For example, given a `Blog` web application to publish `Post` and `Comment` models, you could find the following snippets helpful for pushing useful things fast: | ||
|
||
```smalltalk | ||
"Set the default package that will be the destination of the generated code" | ||
Ride draft defaultPackageName: 'CoffeeSystem'. | ||
"Set the default package name that will be the destination | ||
of the code generated by Ride's builder" | ||
Ride create app setPackageNameTo: #Blog. | ||
"Create a RideModel subclass CoffeeInvoice used as app domain state" | ||
Ride draft model for: #CoffeeInvoice. | ||
"Create the foundational Smalltalk code and files | ||
of the project using the given root word 'Blog' " | ||
Ride create app for: #Blog. | ||
"Create a RidePresenter subclass CoffeeInvoicePresenter" | ||
Ride draft presenter for: #CoffeeInvoice. | ||
"Create the Smalltalk code and files for having | ||
basic CRUD features in a model named `Post`" | ||
Ride create mvp crud for: #Post. | ||
"Create the template templates/views/coffee_invoices/index.mustache" | ||
Ride draft view mustache for: #CoffeeInvoice. | ||
"Same for a model named `Comment`" | ||
Ride create mvp crud for: #Comment. | ||
``` | ||
|
||
## MVP | ||
#### MVP | ||
|
||
Ride also can help you create the raw elements of the Model-View-Presenter code separately for a given model: | ||
|
||
```smalltalk | ||
"Create the model and presenter classes and STTemplate file at | ||
`views/templates/posts/index.html.stt` for Post" | ||
Ride create mvp for: #Post. | ||
"Same as before but PostsPresenter loads custom JavaScript" | ||
Ride create mvp withJs for: #Post. | ||
``` | ||
|
||
Using these basic code generators, Ride also can create the elemental Model-View-Presenter code for a given model: | ||
Or even as its individual parts: | ||
|
||
```smalltalk | ||
"Create the model and presenter classes and mustache template file for CoffeeInvoice" | ||
Ride draft mvp for: #CoffeeInvoice. | ||
"Create a RideModel subclass Subscription used to | ||
store people subscribed to the blog." | ||
Ride create model for: #Subscription. | ||
"Same as before but CoffeeInvoicePresenter loads custom JavaScript" | ||
Ride draft mvp withJs for: #CoffeeInvoice. | ||
"Create a RidePresenter subclass SubscriptionPresenter" | ||
Ride create presenter for: #Subscription. | ||
"Have an unstyled but functioning CRUD for the CoffeeInvoice models based on MVP" | ||
Ride draft mvp crud for: #CoffeeInvoice. | ||
"Create the template correponding to Subscription at | ||
templates/views/subscriptions/index.stt" | ||
Ride create view stt for: #Subscription. | ||
``` | ||
|
||
## API | ||
If you need an API and you like to keep concerns organized with MVC, this is how you can generate its boilerplate code: | ||
#### API | ||
|
||
If you need an API and you like to keep concerns organized with MVP, this is how you can generate its boilerplate code: | ||
|
||
```smalltalk | ||
Ride draft api crud for: #CoffeeInvoice. | ||
``` | ||
Ride create api crud for: #Post. | ||
``` | ||
|
||
## Guides | ||
|
||
- [Make a Blog with comments using Ride in 8 minutes](./MakeABlogWithCommentsUsingRideInEightMinutes.md). | ||
- [Building a Twitter like application with Ride](./BuildingATwitterLikeApplicationWithRide.md). | ||
- [Ride-based SaaS template](./RideBasedSaaSTemplate.md). | ||
- [Add auth to your Ride-based web application](AddAuthToYourRideBasedWebApplication.md). | ||
- [Deploying your Ride-based web application on the cloud](DeployingYourRideBasedWebApplicationOnTheCloud.md). | ||
|
||
## Talks | ||
|
||
Ride was presented for the first time at [Smalltalks 2023](https://smalltalks2023.fast.org.ar/) organized by [F.A.S.T.](https://www.fast.org.ar/) at [Universidad Nacional de Quilmes](https://www.unq.edu.ar/). | ||
|
||
#### November 2023 | ||
|
||
[RAD with templates, htmx and stateless Smalltalk images by Sebastian Sastre](https://www.youtube.com/watch?v=4_gmvN0pimI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ Class { | |
RideAPIHelper >> crud [ | ||
|
||
^ RideAPICRUDHelper new | ||
doer: doer; | ||
doer: builder; | ||
yourself | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.