Bitcoin Forum
May 04, 2024, 12:48:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Any faucets created with AngularJS?  (Read 978 times)
brendanjhwu (OP)
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2015, 08:21:53 PM
 #1

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?
1714826922
Hero Member
*
Offline Offline

Posts: 1714826922

View Profile Personal Message (Offline)

Ignore
1714826922
Reply with quote  #2

1714826922
Report to moderator
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714826922
Hero Member
*
Offline Offline

Posts: 1714826922

View Profile Personal Message (Offline)

Ignore
1714826922
Reply with quote  #2

1714826922
Report to moderator
kenw2
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


Feed me btc ^


View Profile
June 18, 2015, 10:04:07 PM
 #2

This is weird, I just stumbled upon AngularJS yesterday and thought it'd be good to create some kind of bitcoin app/website.
brendanjhwu (OP)
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2015, 10:10:45 PM
 #3

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.
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
June 19, 2015, 12:09:53 AM
 #4

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

tyz
Legendary
*
Offline Offline

Activity: 3360
Merit: 1530



View Profile
June 19, 2015, 07:44:20 PM
 #5

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

bitnanigans
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250


View Profile
June 20, 2015, 04:51:16 PM
 #6

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.
frankenmint
Legendary
*
Offline Offline

Activity: 1456
Merit: 1018


HoneybadgerOfMoney.com Weed4bitcoin.com


View Profile WWW
June 20, 2015, 05:51:49 PM
 #7

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. 

esotericizm
Hero Member
*****
Offline Offline

Activity: 750
Merit: 500



View Profile
June 21, 2015, 02:56:11 AM
 #8

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.
brendanjhwu (OP)
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 21, 2015, 03:57:42 AM
 #9

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. Cheesy

Cheers!
brendanjhwu (OP)
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 21, 2015, 03:58:45 AM
 #10

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!