Bitcoin Forum

Bitcoin => Project Development => Topic started by: brendanjhwu on June 18, 2015, 08:21:53 PM



Title: Any faucets created with AngularJS?
Post by: brendanjhwu on June 18, 2015, 08:21:53 PM
Do you guys know of any faucets created with Angular?
The majority of them are all PHP, and well... PHP is getting old.

I'm thinking of creating a faucet with Angular so people can see their stats live from the db and automatically updates.
Also thinking of increased faucet payouts, for more frequent users.

Want some inspiration but haven't found any?


Title: Re: Any faucets created with AngularJS?
Post by: kenw2 on June 18, 2015, 10:04:07 PM
This is weird, I just stumbled upon AngularJS yesterday and thought it'd be good to create some kind of bitcoin app/website.


Title: Re: Any faucets created with AngularJS?
Post by: brendanjhwu on June 18, 2015, 10:10:45 PM
This is weird, I just stumbled upon AngularJS yesterday and thought it'd be good to create some kind of bitcoin app/website.

Haha yeah. I've actually been with it since the beggining, and now it's grown so big.
Really wanna create something related to bitcoin with it.


Title: Re: Any faucets created with AngularJS?
Post by: coinableS on June 19, 2015, 12:09:53 AM
As far as I understand you will still need a server side script (php) in order to access your database.

 http://www.w3schools.com/angular/angular_sql.asp
http://stackoverflow.com/questions/25422821/is-it-possible-to-write-mysql-queries-in-angular-js


Title: Re: Any faucets created with AngularJS?
Post by: tyz on June 19, 2015, 07:44:20 PM
Yeap, you are right. You can not directly access database with angularjs. You can only perform REST commands. But there are SAAS providers which provide the ready-to-use backend for you. So, you can fully focus on frontend development.

As far as I understand you will still need a server side script (php) in order to access your database.

 http://www.w3schools.com/angular/angular_sql.asp
http://stackoverflow.com/questions/25422821/is-it-possible-to-write-mysql-queries-in-angular-js



Title: Re: Any faucets created with AngularJS?
Post by: bitnanigans on June 20, 2015, 04:51:16 PM
You would still require a server-side language to be able to access a database. AngularJS is a frontend library. I don't understand the "PHP is old" complaint. Obviously, you should use the best tool for the job. Other server-side options available include Ruby, Python or Node.js. Node.js is relatively new so that may be right up your alley.


Title: Re: Any faucets created with AngularJS?
Post by: frankenmint on June 20, 2015, 05:51:49 PM
Ask why use angular? -> you would probably want to create a new age sort of faucet - one with a game attached that gives away satoshis based on the high score...turn it around and deliver ad content within the frame on the same window.  That's a method to use Angular in a different way that acts as a faucet.

Probably use Node.js in conjunction with angular so you can have an end to end js solution.  I've not built a faucet myself but I have enough of an idea of how everything together works:

User sets aside a budget  that they can earn/give away through ads vs satoshis donated.

Set up a page with the ad content as well as a captcha and an input field -

Using your DB (php would have likely used mysql, you could probably get away with a flat file implementation using redis) you would run a stored procedure to a) check if account exists based on wallet address - then depending on your method - you either run a tallied balance on the users wallet balance - probably through instantiating a session cookie which saves the entered wallet address - so that each time your user clicks - pay, their balance increases incrementally on your end, but you're not actually paying anything, just accumulating a payout balance.  When the user clicks withdraw, your implementation has a 2nd stored procedure that checks the balance available on the users account, the available balance via bitcoind rpc call and then fires the payout transaction, 1 time, to the address stored on the account record in the db.  If you're using the manual quick and dirty method - you just payout 0 fee transactions, immediately, on pay.  I say quick/dirty, because those are dust transactions and if a users accumulates several of these transactions, they may be unable to spend the earned BTC due to trx size (larger than 1.2 KB)

Angular is definitely a Front End Framework and would be great for presenting realtime data or perhaps for working w/ websockets to give realtime info on the network and perhaps integrate that into an entertainment form factor. 


Title: Re: Any faucets created with AngularJS?
Post by: esotericizm on June 21, 2015, 02:56:11 AM
I just started working with angular for another project of mine.

As others have said you would need to create the backend first which would be far more complicated than the angular.js frontend, Node.js would be the best bet if you wanted to avoid PHP and already know javascript. I remember seeing a couple of open source Javascript faucets that you could probably audit and convert to a Node.js backend with some work.

As far as a database is concerned being that you are handeling currency my suggestion for a nosql db would be Redis or CouchDB, Avoid MongoDB for something like this.


Title: Re: Any faucets created with AngularJS?
Post by: brendanjhwu on June 21, 2015, 03:57:42 AM
You would still require a server-side language to be able to access a database. AngularJS is a frontend library. I don't understand the "PHP is old" complaint. Obviously, you should use the best tool for the job. Other server-side options available include Ruby, Python or Node.js. Node.js is relatively new so that may be right up your alley.

Haha yeah, I'm focusing on learning Node.js. I'm not complaining about PHP, i just want to invest more time learning something that will be solid in the future. I already know a bit about PHP but it feels old now haha. :D

Cheers!


Title: Re: Any faucets created with AngularJS?
Post by: brendanjhwu on June 21, 2015, 03:58:45 AM
I just started working with angular for another project of mine.

As others have said you would need to create the backend first which would be far more complicated than the angular.js frontend, Node.js would be the best bet if you wanted to avoid PHP and already know javascript. I remember seeing a couple of open source Javascript faucets that you could probably audit and convert to a Node.js backend with some work.

As far as a database is concerned being that you are handeling currency my suggestion for a nosql db would be Redis or CouchDB, Avoid MongoDB for something like this.

Thinking about going with Redis. Thanks for the help, really appreciate it! To you, and to everyone.