#1 Re: mORMot 1 » Need simple MVC web app using synmustache sample project... » 2014-10-15 07:13:06

Okay .. Mr. AB

I have a little experience in .NET and PHP, so i will take them as reference

from the .NET world (using nancy framework ==> sinatra for .NET)
article and demo : http://people-1.apphb.com/
source code : https://bitbucket.org/woodwardmatt/people

from PHP world (using slim framework ==>sinatra for PHP)
1. https://github.com/chrisgillis/Slim-Blog

2. or using Fat-Free framework. link : http://www.willis-owen.co.uk/2013/02/bl … mework-v3/

Okay, show me to achieve this kind of App using mORMot Mr.AB

Thanks..

#2 Re: mORMot 1 » Need simple MVC web app using synmustache sample project... » 2014-10-15 05:31:42

Thank you for your quick respons Mr. AB

I just found 2 years old project on Github created by an Indian programmer
link : https://github.com/gkathire/DelphiMVC/t … vcWEB/Blog

it seems, the project creator is aimed to mimic the ASP.NET MVC behaviour, from the short description ...

the server side also using mormot & sqlite3 (i guess it is mormot version 1.17)
but the view using Delphi Web Srcipt (DWS)
and sorry ... the model using own ORM that i saw more elegant than TSQLRecord :-)

Actually i'm novice in Delphi for internet/server programming.
I try to compile the sample project using XE6, but Delphi stop and showing error at some point (superobject.pas) ...undeclared variable...bla..bla...

Maybe you can take this project as sample


Thanks
Yudi Purwanto

#3 mORMot 1 » Need simple MVC web app using synmustache sample project... » 2014-10-15 04:40:21

yudipe
Replies: 9

Hello ... Good morning mORMot community..

yesterday , i just downloaded mormot nightly build + sqlite3*.obj
after reading readme.txt, i then compile and running testsqlite3.dpr / testsqlite3register.dpr successfully.
i'm currently using delphi xe6 on windows7 32 bit

i then look at sample folders and really sad because there is no simple demo explaining how to build mvc web application using mormot.

Let's take simple blog app with simple CRUD and authentication as example.
The app will be running on localhost on port 80. I need the following example :

1. How to define model (article and user) using TSqlRecord
2. How to define controller / router class, for example :
    Public route (no need authetication / anonymous user can access)
    - localhost ==> will show main page with list of all articles
    - localhost/article/1 ==> will show article with id = 1
    Protected route (user must login before coming into this page)
    - localhost/article/1/edit ==> will show editing page for article id = 1, then posting data back via html form
    - localhost/article/new ==> will show page to create new article
    - localhost/article/1/delete ==> to delete the article
3. How to define Layout/View using SynMustache to display above page (point no. 2)
4. At this time i don't need javascript / json. Just html generated on the server side
5. Deployment on server

Okay, thats all.
Hope other newbies with the same problem can take advantage from the demo

Thanks
Yudi Purwanto

Board footer

Powered by FluxBB