This repository contains the CreditX loan approval prediction service. It's built with Node.js and Express, serving as an interface to a Flask-based machine learning backend.
The CreditX frontend provides a user-friendly web interface for submitting loan application details and receiving credit prediction results (approval status and confidence score) from a backend machine learning service. It handles form data, communicates with the Flask backend, and renders the results using EJS templates.
- Express.js Server: A robust web server for handling requests.
- EJS Templating: Dynamic rendering of web pages.
- Backend Integration: Seamlessly communicates with a Flask ML service for predictions.
- Form Handling: Processes user input from a web form.
- Error Handling: Provides user-friendly messages for backend service unavailability.
- ML Service Warm-up: Attempts to wake up the Flask backend on application start.
Before you begin, ensure you have the following installed:
- Node.js (LTS version recommended)
- npm (comes with Node.js) or Yarn
- A running Flask backend for the credit prediction service (e.g., on
http://localhost:5000).
- Clone the repository:
git clone <repository-url> cd creditX/frontend
- Install dependencies:
npm install # or yarn install
The application can be configured using environment variables:
FLASK_URL: The URL of your Flask backend service. Defaults tohttp://localhost:5000. Example:FLASK_URL=http://your-flask-backend.com:5000PORT: The port on which the Express frontend server will run. Defaults to3000. Example:PORT=8080
To start the frontend server:
npm start
# or
node app.jsThe application will typically be accessible at http://localhost:3000 (or the port you configured).
- Ensure your Flask backend service is running and accessible at the configured
FLASK_URL. - Start the frontend application as described above.
- Open your web browser and navigate to
http://localhost:3000. - Fill out the loan application form with the required details.
- Submit the form to get a credit prediction (approved/not approved) and a confidence score.
Contributions are welcome! Please feel free to open issues or submit pull requests.
This project is open-sourced under the MIT License.