This project is a web-based payment application built using the MERN stack (MongoDB, Express.js, React, Node.js). It provides basic wallet functionalities, allowing users to sign up, sign in, view their balance, and transfer money to other users securely.
├── backend/ # Contains the Node.js & Express.js server-side code
│ ├── node_modules/
│ ├── config/
│ ├── controllers/
│ ├── package.json
│ ├── middleware/
│ ├── routes/
| ├── server.js
│ └── README.md # Backend-specific documentation
│
├── frontend/ # Contains the React client-side code
│ ├── node_modules/
│ ├── public/
│ ├── src/
│ ├── package.json
│ └── README.md # Frontend-specific documentation
│
├── .gitignore
├── .env
├── Dockerfile
└── README.md # This file (Overall project documentation)
- Backend: Node.js, Express.js
- Frontend: React, Tailwind CSS
- Database: MongoDB (running in a Docker container)
- Authentication: JSON Web Tokens (JWT)
Before you begin, ensure you have the following installed on your system:
-
Clone the repository:
git clone https://github.com/anant-c/basic-paytm.git cd basic-paytm -
Set up MongoDB with Docker:
- Make sure Docker is running on your machine.
- From the root directory, build the Docker image for the MongoDB replica set:
docker build -t my-mongo-repl . - Run the Docker container:
docker run -d -p 27017:27017 --name mongo-repl my-mongo-repl
This will start a MongoDB instance on
localhost:27017that the backend can connect to. The backend is configured to connect to this instance by default. -
Set up the Backend:
- Navigate to the
backenddirectory:cd backend - Create a
.envfile and add the following variables. Replace the placeholder with your own secret.PORT=3000 MONGO_URI="..." JWT_SECRET="your-jwt-secret"
- Install backend dependencies:
cd ..(basic-paytm/) npm install npm run dev - The server will be running on
http://localhost:3000.
- Navigate to the
-
Set up the Frontend:
- Navigate to the
frontenddirectory:cd ../frontend - Install frontend dependencies:
npm install npm run dev
- The application will be accessible at
http://localhost:5173(or another port if 5173 is busy).
- Navigate to the
You can now open your browser and interact with the application.