Author

Topic: Free open-source Dice Script with Chat Box (Provably Fair) with Admin Panel (Read 539 times)

newbie
Activity: 2
Merit: 0
Thank you very much , i also soon i will share with you what i've done Cheesy
legendary
Activity: 1918
Merit: 1728
I really loved your work , please complete deposit withdrawals for us! please please !:D

Thanks. Ain't free for next couple of months. So, most probably will try to add this in January. However, no commitment.

When I first commented in this thread, I knew javascript and node.js barely. Now I can (almost) understand everything in your code. I think that's called "progress". I still find it fascinating how you put these together in such a short time frame though. It would a week or a month for me probably.

This project also made me switch from python( django) + sql to js/mongodb. Now this stack is my favorite.

Haha, good to know that I made you JS freak. And about completing the script in 4 hours, I re-used major chunk of the code for user authentication from my other project that I built before for learning purpose. However, the game script and other functionalities were written on that very day.
legendary
Activity: 3276
Merit: 2442
This project also made me switch from python( django) + sql to js/mongodb. Now this stack is my favorite.

Once you switch from django, you'll never look back because the way it makes you write HTML, it's like shoving two languages in your project instead of one (Python and JS) because Python can't do anything on the browser side.

So it's like to make use of Django for a production site, and this applies to other python web frameworks, you have to not only know Python but even Javascript [as there will be some logic inside the JS forms, inputs and stuff that requires processing before it's sent to server].

It's a general deficiency of web frameworks in particular, regardless of the language they were written in (except for JS frameworks obviously): Rails, CakePHP, Tomcat, ....

True. I was having problems with understanding Django. Flask was much simpler. Did a couple of basic projects with flask/mysql and had no problems. Django was a mess. Couldn't even finish what I started. Now I find node.js/react/vanilla/mongodb stack better than anything. Javascript is just so good. It is fucked up in its own way and even then I still like it.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
This project also made me switch from python( django) + sql to js/mongodb. Now this stack is my favorite.

Once you switch from django, you'll never look back because the way it makes you write HTML, it's like shoving two languages in your project instead of one (Python and JS) because Python can't do anything on the browser side.

So it's like to make use of Django for a production site, and this applies to other python web frameworks, you have to not only know Python but even Javascript [as there will be some logic inside the JS forms, inputs and stuff that requires processing before it's sent to server].

It's a general deficiency of web frameworks in particular, regardless of the language they were written in (except for JS frameworks obviously): Rails, CakePHP, Tomcat, ....
legendary
Activity: 3276
Merit: 2442
When I first commented in this thread, I knew javascript and node.js barely. Now I can (almost) understand everything in your code. I think that's called "progress". I still find it fascinating how you put these together in such a short time frame though. It would a week or a month for me probably.

This project also made me switch from python( django) + sql to js/mongodb. Now this stack is my favorite.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I really loved your work , please complete deposit withdrawals for us! please please !:D

I think this is just a concept so webtricks is not going to add those features just because someone requested for them (they are very specific features which highly depend on what your cold storage is).

Nevertheless, this code could be useful for me if there's a probably fair RNG inside of it (I just need that).
newbie
Activity: 2
Merit: 0
I really loved your work , please complete deposit withdrawals for us! please please !:D
legendary
Activity: 1918
Merit: 1728
legendary
Activity: 3276
Merit: 2442
I started to learn django 1-2 months ago. Wasted so much time with the basics before that because I had zero programming background. Sometimes I still get confused though. There are still certain parts I don't understand well enough.

I was trying to make something like this by myself but It was a mess.

That'll help me a lot.

And about your database choice, I guess I am pretty new there and like you I only know one and it is, mysql.  Grin I know I have to dump it somewhere in the future but every goddamn tutorial I watched was teaching it so I learned it. :/

I'll look into mongo but trying to learn too much information too fast makes things even more messy.

legendary
Activity: 1918
Merit: 1728
I'd like to ask another question. Any particular reason for using mongodb over sql? (mysql, postgre)

One reason was this:
Hi Dave,
We are getting numerous SQL Injection attacks everyday. Although site is adequately secured against such attacks but everytime someone tries this hack attempt, it alters the content of user.ini file and turn on the error_reporting. I have to manually turn it off.
I am not a big fan of PHP+SQL. That's why we are shifting our assets to node.js based application and now we are building new database in MongoDB.

But the most important reason is that I only know MongoDB because that is what I learnt with Node.js. Cheesy I know some basics of SQL but not sure if I can manage it on my own in production. I have to be dependent on someone. While with MongoDB, I can completely assure maxima security of database. Not to ignore the fact that MongoDB is really cool db system and comes with amazing GUI software - MongoDB Compass which is completely free.

What I am going to do with this, is I am first going to understand it in js then I'll try to port it to python. May never succeed but I'll try. (invested so much time in python, can't just dump it away like a shitcoin)

Actually I made a bitcoin related tool following this method too. Just the process was reverse, I coded thing in JS taking help from Python code.
legendary
Activity: 3276
Merit: 2442
Fair enough. I give you credits.  Cool

I'd like to ask another question. Any particular reason for using mongodb over sql? (mysql, postgre)

What I am going to do with this, is I am first going to understand it in js then I'll try to port it to python. May never succeed but I'll try. (invested so much time in python, can't just dump it away like a shitcoin)
legendary
Activity: 1918
Merit: 1728
So currently me with support from 2 developers are trying to create unique  casino games that aren't available on any other gambling site right now. I can't disclose everything right now but if everything goes as we planned, we will launch something big soon.

I already have my game ready and now shifting its backend from PHP to node.js. Let's see how it goes.

LoL you didn't code this in 4 hours. You didn't do it by yourself neither. It took you months and you took help from 2 devs.

Damn I was too impressed much too quickly.

You still deserved the merits for sharing the code though. It will serve me great while learning js.

You also said:
we will launch something big soon.
I guess that something big isn't coming.

You really think I will need the help of 2 devs and 2 months to code a single page dice game and call it what 'unique'? What you have read was written by me in reference to DogeDraw. I was part of the project which was started as a dogecoin lottery but didn't work out. Then we bent on to work on something big and better. So we have created a platform with 8 multiplayer games and one unique table mode which none other crypto gambling site provide at the moment. However, due to some differences I left the project last month and I am no longer the part of the team. They are planning to launch the site next month and most probably I will be the one who will create ANN and Signature campaign for them on Bitcointalk. But it will just be a paid job and I won't officially be the team member.

As far as this script is concerned. This is truly and purely my work. I written the whole script in just 4 hours - models, routers, controllers, views, everything I typed manually man! Give me some credit.  Cheesy


legendary
Activity: 3276
Merit: 2442
So currently me with support from 2 developers are trying to create unique  casino games that aren't available on any other gambling site right now. I can't disclose everything right now but if everything goes as we planned, we will launch something big soon.

I already have my game ready and now shifting its backend from PHP to node.js. Let's see how it goes.

LoL you didn't code this in 4 hours. You didn't do it by yourself neither. It took you months and you took help from 2 devs.

Damn I was too impressed much too quickly.

You still deserved the merits for sharing the code though. It will serve me great while learning js.

You also said:

we will launch something big soon.

I guess that something big isn't coming.
legendary
Activity: 3276
Merit: 2442
What I mean is when you gonna make your ANN thread and start a signature camp for your casino? Cheesy

Kidding,

What I really meant was when will you enable to deposit real coins?

Maybe make it available for shitty doge first then move to btc.

You already come this far don't you want to make it a real casino?

*like I guessed, gotta jump to js asap. Nothing else is needed.
legendary
Activity: 1918
Merit: 1728
Did you have any background as a software developer before this* or you learned all these after DS suggested it? If you managed to learn all these by yourself in 8 months I'd say that's impressive af.

*I understand that's your hobby but what I wonder is, did you know anything (js, html, css etc) at all before August 2019 or you started from zero?

I am learning python maybe a bit longer than that but I feel like I am wasting time with it while javascript is already there and ready, you know. Probably shoulda switch to js asap.

I know HTML and CSS since I was 14 years old but I never learnt any programming language before DS's suggestion. It was only after he suggested about JS and Node.js that I took courses for both separately. First I took Node.js course and watched quick YouTube video to understand basics of JS before starting but it didn't help much. So I paused the course and took detailed JS course. Once I finished that, I resumed Node.js course and perfected both.

Quote
When do we deposit? Smiley

I am sorry but I didn't understand this. What are you saying?
legendary
Activity: 3276
Merit: 2442
Did you have any background as a software developer before this* or you learned all these after DS suggested it? If you managed to learn all these by yourself in 8 months I'd say that's impressive af.

When do we deposit? Smiley

*I understand that's your hobby but what I wonder is, did you know anything (js, html, css etc) at all before August 2019 or you started from zero?

I am learning python maybe a bit longer than that but I feel like I am wasting time with it while javascript is already there and ready, you know. Probably shoulda switch to js asap.
legendary
Activity: 1918
Merit: 1728
Well done @webtricks, am really impressed!
Since the script is mainly for testing purposes, it would be better if you make it accessible without registration just to make things easier.
Also, why not using a nonce instead of changing the server sees for each roll!
Are you going to add auto-bets?
I would suggest to add an address for donations if anyone wants to help with server costs.

Thanks Khaled.

I have made server seeds unique to each account so it is not possible to set up that system without logging in.

I agree it's better to keep changing nonce rather than server seed if player doesn't change the client seed but the system I implemented generates server seed synchronously so the new seed is shown to player almost instantly hence it doesn't affect site performance in any way. So it is better to let player have new set of seeds for every game if I can make that happen without affecting performance.

Auto-bets can be done. Not much difficult and maybe half an hour work. Will add to the script in free time.

Also, I don't care about server costs tbh, lol. I do web development as a sheer hobby. Professionally, I am employed in financial field. But tech attracts me so I learn things online. Do you know where it all started? Here:
https://bitcointalksearch.org/topic/m.52315553

Darstar_ suggested me to learn Javascript and Node.js to go on with gambling site development and took the suggestion really serious, lol.

I have big hosting plan and it can sustain all of my sites with even 100 times the traffic I am receiving right now. So no problem.
legendary
Activity: 2702
Merit: 3045
Top Crypto Casino
Well done @webtricks, am really impressed!
Since the script is mainly for testing purposes, it would be better if you make it accessible without registration just to make things easier.
Also, why not using a nonce instead of changing the server sees for each roll!
Are you going to add auto-bets?
I would suggest to add an address for donations if anyone wants to help with server costs.
hero member
Activity: 2352
Merit: 905
Metawin.com - Truly the best casino ever
Well, nice but there are a lot of dice script and I guess that's a waste of time? But testing of your web skills at some point.
I think dice is very connected to bitcoin because first btc dice website was created in 2013 (after 4 years from bitcoin) and a lot of crypto casinos started with it, dice become like bitcoin's exclusive game.
I think it won't be bad if bitcointalk community work on developing of dice script and have a dedicated thread like epochtalk to gain attention of people.
It's just an idea, not something necessary so don't quote with insignificant answers.
legendary
Activity: 1918
Merit: 1728
Installation Guide for Windows

Setting Up the Database - MongoDB Setup

Step 1: Download the MongoDB Community Server from here: https://www.mongodb.com/download-center/community. Select 'ZIP' from 'Package' option.

Step 2: Once downloaded, extract the folder to somewhere permanent, for example in Local Disk (C:).

Step 3: The name of the folder will be something like this: 'mongodb-win32-x86_64-2012plus-4.2.6'. Rename it to something similar like 'mongodb'.

Step 4: Now create a new folder in the same location where you have extracted folder in previous step (Not inside previous folder but in the exact location i.e. Local Disk (C:). This folder will be used to save database so name it something like 'mongodb-data'.

Step 5: Now head over to your command prompt. Run this command:

Code:
C:/mongodb/bin/mongod.exe --dbpath=/mongodb-data

Note that the command starts with the location of your folder followed by folder name and then /bin/mongod.exe command. Then provide space for --dbpath flag. Don't provide space after '=' and your database path should start immediately after equals to. You don't have to mention root folder i.e. C:\ in dbpath. So if your database folder is in Users folder which is located in C:\ then your dbpath shall be: --dbpath=/Users/mongodb-data.

Step 6: Console will output lots of data once you but somewhere 8-9 lines from bottom, you will see this output:



If you see this command then your database has been setup accurately and you are ready to run your dice script now.



Dice Script Setup

Step 1: Open new command prompt window. Don't stop the function in first window or close the first window else mongodb running on your system will stop.

Step 2: If git is installed on your system then run this command in second window:

Code:
git clone https://github.com/web-tricks/dice

Else head to https://github.com/web-tricks/dice and download the code in ZIP format and extract where ever you want.

Step 3: Once github is done cloning or you have extracted folder on your computer, open folder in your command prompt. If you clone using command above, you simply have to write 'cd dice' to enter dice folder.

Step 4: Once you enter the dice folder, run 'npm install' command to install all packages needed for the script to run.

Step 5: Once all packages have been installed (it will take 1-2 minutes max), run 'npm run dev' command to run the script locally on your system.

Step 4: If you see the message 'Listening on 3000', it means you have correctly set up the script. The message will be something like this:



Now head to your browser and open: localhost:3000 and you will see the local implementation of your script. Any other doubt, do ask in this thread. Thanks!

legendary
Activity: 1918
Merit: 1728
As promised, Admin Panel has been added to the script. It can be accessed at site.com/admin.

Sneak Peek:

Features added to Admin Panel at this moment:
  • View Total Number of users registered on site.
  • View list containing usernames of all registered users on site.
  • Edit email, balance and password of any registered user
  • Modify the role of any user to 'admin' from 'member'
  • View bets made by a particular user


I thought it would be bad idea to open admin panel for everyone on main implementation so I created side-implementation of the script on http://dummy.webtricks.website. Use these login details to access admin panel:

website: http://dummy.webtricks.website
username: admin
password: admin123
after login visit: http://dummy.webtricks.website/admin or click 'Admin Panel' from top

Do tell me if anyone wanna see anything else on script, I will add more features in coming days.



I would need a little detailed installation guide, i really want to run the dice on the web and im having trouble, thanks

No Problem! I will create detailed guide on how to run this script on local machine in this thead after few hours. Stay tuned!
member
Activity: 120
Merit: 63
I would need a little detailed installation guide, i really want to run the dice on the web and im having trouble, thanks

BTW, can't wait to see the admin panel!
member
Activity: 120
Merit: 63
I really like the fact that you made it open source and everything! will be monitoring the thread for news, keep up the good work!
legendary
Activity: 1918
Merit: 1728
Nice, job, I would like to run it, but I would need info on where is the admin pannel (if there is one) and

I haven't made admin panel but can add one with some decent features. It will take me around 2 hours to code one I think. Done! I will add admin panel functionality tomorrow, let's make this the most complete free Crypto Gambling Script available online!

if its possible to configure on windows and run on web server. thanks!

Yes! You can surely configure it on windows. Just make sure you have node.js installed on your system. Follow the guide written in README file and it will work just fine on your system. You can make those command with Windows' Command Prompt too.



(I am giving away 500 BTC to everyone just for signing up so go on give it a try).  Cheesy
I'm getting a hint that the 500 BTC is virtual for testing purposes and can't be withdrawn, so maybe you should clarify that in your post.

If someone thinks I am going to give $4.5M to every person who signs up then such person deserves to be misled. Not to forget the big laughing face at the end of the line. 
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
(I am giving away 500 BTC to everyone just for signing up so go on give it a try).  Cheesy

I'm getting a hint that the 500 BTC is virtual for testing purposes and can't be withdrawn, so maybe you should clarify that in your post.

Anyway it's a nice way to experiment with dice games without risking actual money.
member
Activity: 120
Merit: 63
Nice, job, I would like to run it, but I would need info on where is the admin pannel (if there is one) and if its possible to configure on windows and run on web server. thanks!
legendary
Activity: 1918
Merit: 1728
Hello Guys,
So day before yesterday (halving day), I was enjoying chatting with other Bitcointalk members on Discord server created by Cyrus and was looking to do something else on my parallel screen. At first I started playing poker but lost first couple of bets and soon realized it wasn't my day. Then it stuck to my mind why not create a Dice Script! For next 4 hours, I created a complete dice-game with provably fair add-on and a chat box from scratch. Yesterday, I had office meeting so finally got the time today to deploy it and created GitHub Repository too.

So people, presenting you my Dice Game Script:

GitHub Repository: https://github.com/web-tricks/dice

Online Implementation of Script: https://casino.webtricks.website/
(I am giving away 500 BTC to everyone just for signing up so go on give it a try).  Cheesy

If you wanna test admin panel, check out this implementation: http://dummy.webtricks.website
Username for admin account is: 'admin' and password is 'admin123'

I have created the game on single-page application model. There is only single page on the site: login, register, game, provably fair verification, chatting, everything can be done from home page itself. The site isn't optimized for mobile display so if you open it on mobile, don't get scared.

Note: I have written the whole script in just over 4 hours and haven't tested any code except some basic validation so make sure to test each and every line of code if you plan to use any part of this script for PRODUCTION PURPOSE.

More guide can be found in README.md file in GitHub Repository.

If you like the script and want me to add more games and deposit/withdraw functionality to the script, write down below to let me know.  Wink
Jump to: