Skip to content

rlmsinclair/casinr_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Casinr API

A Flask-based API for a casino application that integrates with the Solana blockchain. Because gambling with real money wasn't quite risky enough, we've added cryptocurrency to the mix.

Features

  • User authentication (because we'd rather not have just anyone losing their Solana tokens)
  • Casino management (a digital representation of establishments where hope goes to die)
  • Wallet integration with Solana blockchain (combining the volatility of gambling with the stability of cryptocurrency)
  • Game functionality (currently implementing a sophisticated algorithm known as "random.randint(1, 2)")

Installation

Clone this repository with the enthusiasm of someone who's just hit the jackpot:

git clone https://github.com/yourusername/casinr_api.git
cd casinr_api

Install dependencies with the blind optimism of a first-time gambler:

pip install -r requirements.txt

Configuration

The database configuration is hardcoded in the application with credentials exposed in plain text. We've adopted the "security through obscurity" approach, which is working brilliantly until someone reads this README.

Running the Application

Development

python app.py

Production

gunicorn -c gunicorn_config.py app:app

The application will be available at http://localhost:8080, ready to separate users from their digital currency with the efficiency of a well-oiled roulette wheel.

API Endpoints

Authentication

  • POST /api/register - Register a new user (collect their details before they realize what they're signing up for)
  • POST /api/login - Log in a user (welcome them back to their financial demise)
  • POST /api/logout - Log out a user (give them a chance to reconsider their life choices)

Casino Management

  • GET /api/casinos - Get a list of casinos (a catalogue of opportunities to make poor decisions)
  • GET /api/casinos/<id> - Get details of a specific casino (examine your chosen path to empty pockets)
  • POST /api/create_casino - Create a new casino (because the world needs more places to exchange currency for disappointment)

Wallet Integration

  • POST /api/connect_wallet - Connect a Solana wallet (attach your financial lifeline to our system)
  • POST /api/play_game - Play a game with Solana tokens (watch your cryptocurrency vanish with the elegance of a magician's assistant)

Database

The application uses MySQL, because what's a gambling application without the additional gamble of SQL injection vulnerabilities?

Tables:

  • users - Stores user information and hashed passwords (we're responsible gamblers, after all)
  • casinos - Stores casino information (digital representations of hope extraction facilities)

Security Features

  • Password hashing with pbkdf2_sha256 (because we only want to lose your money through gambling, not identity theft)
  • Email validation with regex (a sophisticated approach that will surely catch all invalid emails, except the ones it doesn't)
  • Session management (we keep track of who's losing what)

Known Issues

  • The application contains a secret key of '12345', which coincidentally is the same combination as my luggage
  • Database credentials are hardcoded and visible to anyone who reads the source code (a bold strategy)
  • The random number generator for the game uses random.randint(1, 2), which is about as sophisticated as flipping a coin but with more electricity involved

Contributing

If you'd like to contribute to this project, please consider whether your time might be better spent elsewhere. If you're still keen, submit a pull request and we'll review it with the same level of scrutiny as a casino floor manager watching a suspiciously lucky player.

License

This project is licensed under the "Do What You Want But Don't Blame Us When You Lose All Your Solana" License.


"The house always wins. If it didn't, it would be called a charity." - Anonymous Casino Developer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors