Coin Flip 🪙

Description

This simple web application lets you guess whether an imaginary coin will land on heads or tails. Make your guess, click the "Flip" button, and see if you're a winner!

How to Play

  1. Choose your guess: Select either "Heads" or "Tails" by clicking the corresponding radio button.
  2. Flip the coin: Click the "Flip" button to see the imaginary coin's result.
  3. Find out if you win: The app will reveal whether your guess matches the coin's result, and if you win or lose.

Tech Used

  • Node.js: Powering the server-side functionality.
  • HTML, CSS, JavaScript: Crafting an interactive and visually appealing front-end, including an animated button and modern radio buttons.

Lessons Learned

  • Server-Side Development
    • HTTP Server: Creating a basic HTTP server using Node.js.
    • URL Paths: Using the url module to parse and handle different URL paths.
    • Query Parameters: Utilizing the querystring module to parse and extract parameters from the query string.
  • Front-End Design
    • Interactive JavaScript: Implementing interactive features with JavaScript, such as fetching data from the server and updating the UI dynamically.
  • External Libraries
    • Figlet: Integrating the Figlet library for generating ASCII art, adding a creative touch to error messages.
  • Project Organization
    • File Structure: Organizing files into appropriate directories for efficient code management.
    • Resource Handling: Managing resources like HTML, CSS, and JS files appropriately.
  • Local Deployment
    • Setting up and running the application locally for testing and development purposes.