Welcome to the Hangman Game Application! This project consists of a Flutter application and an Express.js server that communicates using Socket.io and MongoDB.
Before you begin, ensure you have the following installed on your machine:
-
Clone the Repository
git clone https://github.com/Vansh-Bh/hangman.git cd server
-
Install Dependencies using
npm install
-
Set Up MongoDB Atlas
You can create a free tier MongoDB deployment on MongoDB Atlas to store and manage your data.-
Create a MongoDB Atlas Account
Go to MongoDB Atlas and create a free account. -
Create a Cluster
After creating your account, follow the instructions to create a new cluster. This will be your MongoDB database in the cloud. -
Get Your Connection String
Once your cluster is created, click on "Connect", select "Connect your application", and copy the connection string. -
Configure MongoDB Connection
Ensure your MongoDB connection string is correctly set up in the server code. Modify the DB variable inserver.js
with your connection string:const DB = "mongodb+srv://<username>:<password>@<cluster-url>/hangman?retryWrites=true&w=majority";
-
-
Run
npm start
to start the server
-
Make sure your shell is in this directory
-
Install flutter dependencies using
flutter pub get
-
Run the flutter app with
flutter run
Make sure to update the http://localhost:3000
with your local ip on which the server is running on in this File