A full-stack bill payments platform built with the PERN stack (PostgreSQL, Express, React, Node.js). This application enables users to pay bills such as airtime, data subscriptions, electricity, and betting securely and efficiently, with a user-friendly interface and integrated customer support.
The project is organized into two main directories:
| Directory | Description |
|---|---|
backend |
Contains server-side code, including API routes, database models, and payment processing logic. |
frontend |
Contains client-side code, including React components, routing, and UI styling. |
- User Authentication: Secure login and signup functionality using JSON Web Tokens (JWT).
- Bill Payment Processing: Supports payments for airtime, data, electricity, and betting via Paystack.
- Chatbot Integration: Provides customer support through a chatbot powered by
react-chatbot-kit. - Responsive Design: Built with TailwindCSS for a seamless experience across devices.
- Modern Development Tools: Uses Vite for fast frontend builds and Sequelize for database management.
The backend is built with Node.js, Express, and PostgreSQL, using Sequelize as the ORM and Paystack for payment processing.
-
Navigate to the Backend Directory:
cd backend -
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.envfile in the backend directory with the following variables:DATABASE_URL=postgres://user:password@localhost:5432/dbname PAYSTACK_SECRET_KEY=sk_test_your_paystack_secret_key JWT_SECRET=your_jwt_secret -
Initialize the Database: Ensure PostgreSQL is installed and running. Create a database matching the
DATABASE_URL. If the project uses Sequelize migrations, run:npx sequelize-cli db:migrate
-
Production Mode:
npm start
Runs the server using
node server.js. -
Development Mode:
npm run dev
Uses
nodemonfor hot reloading during development.
The backend typically runs on http://localhost:3000 (confirm the port in your server.js).
The frontend is a React application built with Vite, styled with TailwindCSS, and includes features like routing and a chatbot.
-
Navigate to the Frontend Directory:
cd frontend -
Install Dependencies:
npm install
-
Configure Environment Variables (if needed): If the frontend requires a specific backend API URL, configure it in a
.envfile orvite.config.js. Example.env:VITE_API_URL=http://localhost:3000 -
Proxy Setup (optional): To proxy API requests to the backend during development, ensure
vite.config.jsincludes a proxy configuration:server: { proxy: { '/api': 'http://localhost:3000' } }
-
Development Mode:
npm run dev
Starts the Vite development server, typically at
http://localhost:5173. -
Build for Production:
npm run build
-
Preview Production:
npm run preview
To run the full application:
-
Start the Backend: In one terminal:
cd backend npm start -
Start the Frontend: In another terminal:
cd frontend npm run dev
Ensure both servers are running simultaneously. The frontend will connect to the backend for API requests, typically at http://localhost:3000.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m 'Add your feature' - Push to the branch:
git push origin feature/your-feature
- Open a pull request.
For more details, see CONTRIBUTING.md.
This project is licensed under the ISC License. See the LICENSE.md file for details.
Ohine Ivori