Jump to content

Can anyone share how to build web application using PW?


fmgujju
 Share

Recommended Posts

I would like to build web application using PW because I love ProcessWire so much the way it's built.

What I am looking for is that to use my own relational tables to store data instead of the PW fields. Can anyone help me out to build web application using PW?

Link to comment
Share on other sites

Sure,

1st question: what type of app u wanna build?

2nd : why and which data u wanna store outside the Pages?

For the very first try to point out what you want to do, what should the app do?

What use cases do you have?

Link to comment
Share on other sites

I am part of one of the non-profit organization where they give scholarship to student. 

Here is the business logic:

- Student create their user account online to apply for scholarship and upload their documents/pictures/reports

- Admin user login to review scholarship application and approve/reject application.

- Once application approved, they assign donor to the student

- Student upload their progress report, results and expense details every semester or whenever ask for.

- Admin generate report of accounting how much donation they received, funded, admin expenses.

- Donor logged into to see student's progress and communicate with them

I think above will give you better idea of what I am trying to build. Please note that I will be using PW to build the website for that organization and so I would like to use PW for Web application as well.

Thanks!

Link to comment
Share on other sites

Well doesnt sound much complicated.

Ok, my clock says its 2300, I will collect some usefull posts for you tomorrow morning when MadeMyDays coffee machine brews my first Ninjacoding Cup.

Be sure to receive any help you need.

Hope you could wait so long :)

  • Like 2
Link to comment
Share on other sites

Good morning little app builder ninjas,

As promised yesterday I will point you to the important forum posts on how you could build your own app in Processwire.

Are we all seated?

First we assume that our app is separated into two main parts.

The Frontend with custom login and the Backend for App Administration and User Dashboard.

Before we beginn follow this link: http://processwire.com/api/cheatsheet/

Say hello to the Processwire API Cheatsheet made by Soma, whenever you meet Soma just give him a hug for this outstanding work.

Why? I just hug my wife, girlfriend, boyfriend!

Well the Cheatsheet would be definitely your best and maybe your most intimate friend during developing process. 

Make yourself familiar with the Cheatsheet and make sure you activated the advanced view.

Ok, lets beginn.

Right before coding any line in our editor we have to think about our App.

What should the App do?

Which functionality do we need?

Maybe you mockup your first design, but do not start to code!

Think about your App, think about structuring your data, fields, templates,folder structure and ,believe me (really important), think about name conventions. 

What does he mean with name conventions?

A little example from one of my projects.

The app handles three use cases, Frontend, Backend Administration and Client Dashboard, maybe a normal setting. 

I started to think about naming template files and folders. 

So I came up to the decision to name folders like this:

includes-backend

  --admin

         --views

         --scripts

  --client

         --views

         --scripts

includes-frontend

  --views

  --scripts

Template files are named like this:

backendHome.php

backendMyData.php

home.php

homeNormalContent.php

homeLogin.php

Think about naming your page tree, this is maybe the first step in data structure you do.

Why do we have to do all this, I just wanna code and cuddle together my App.

Sure you could start this way, but do you know how large your app possibly could grow before really thought about?

So, do yourself a favour and write down your thoughts. I´m working currently on a App which contains round about 300 Files of Script Logic and Output forms, editing without any logic in naming would definitely be a mess.

Ok, we thought a lot of our App in theory, what now?

We need a custom login!

You find some usefull snippets and logic about login from frontend in this posts:

http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/#entry15919

http://processwire.com/talk/topic/107-custom-login/ (I really could recommend Renobirds login thoughts and his script)

Read carefully through this posts, they contain almost everything you have to consider on frontend user management. 

You are now on a point of using processwire where you definitely receive input from users, so think about security and make yourself familiar with $sanitizer.

Never ever work with user generated data without sanitizing them!

There are two main headlines you always have to remember:

1st DO NOT SAVE PASSWORDS IN PLAIN TEXT IN YOUR APP

2nd DO NOT TRUST INPUT YOU RECEIVE FROM USERS

Ok, we finished our login and could setup a custom dashboard interface, but what next? My users have to generate some content and I don´t want to do this in my normal processwire administration dash. 

Calm down little Ninja. 

Ryan just gave you a strong and powerful tool. 

He gave you Excalibur and named it just API. 

Follow this links:

http://processwire.com/talk/topic/352-creating-pages-via-api/ (creating content via api)

http://processwire.com/talk/topic/296-programmed-page-creation-import-image-from-url/ (image handling)

Thats it.  :ph34r:

  • Like 13
Link to comment
Share on other sites

Thank you for your valuable post. It's quite a bit of information to digest so it will take little more time to get back to you but meanwhile could you please clarify one item. Do I still have to create PW fields to hold the data?

Link to comment
Share on other sites

It depends, have a look at Ryans Blog Profile.

If think he is handling the comments data outside of Pages.

But in almost every case you could store data in Pages and tread them like a smooth Database Application.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...