This project provides a backend service to calculate credit scores for individuals, particularly those in the informal economy where traditional credit data may be scarce. It is built with Node.js and uses Prisma as the ORM for database interactions.
- Features
- Prerequisites
- Installation
- Environment Variables
- Usage
- Project Structure
- Contributing
- License
- Node.js Backend: A robust and scalable backend built on the Node.js runtime.
- Prisma ORM: Modern, type-safe database access using Prisma.
- RESTful API: Exposes endpoints for credit scoring and data management.
Make sure you have the following installed on your development machine:
- Node.js (v18.18 or higher recommended)
- npm (or yarn/pnpm)
- A running database instance (e.g., PostgreSQL, MySQL, SQLite).
-
Clone the repository:
git clone https://github.com/your-username/Informal-Credit-Score.git cd Informal-Credit-Score -
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
This project uses dotenv to manage environment variables. Create a .env file in the backend directory by copying the .env.example file (if it exists) or by creating a new one.
cp .env.example .envYou'll need to provide the following variables:
# The connection string for your database
DATABASE_URL="postgresql://user:password@localhost:5432/mydatabase"
# Other secrets for your application
# SECRET_KEY="yoursecret"-
Run database migrations: Apply the database schema to your database.
npx prisma migrate dev
-
Generate Prisma Client: This is usually done automatically after
npm install, but you can run it manually if needed.npx prisma generate
-
Start the development server:
npm run dev
The application should now be running on your local machine.
Informal-Credit-Score/
├── backend/
│ ├── prisma/
│ │ └── schema.prisma # Prisma schema file
│ ├── src/ # Application source code
│ ├── .env # Environment variables (ignored by git)
│ ├── package.json
│ └── ...
└── README.md
Guidelines for contributing to the project.
- Fork the repository
- Create a new branch (
git checkout -b feat/your-feature) - Make your changes
- Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feat/your-feature) - Open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.