Full‑stack monorepo for managing bank customers and payment records.
- Backend: ASP.NET Core 8 (Web API), Entity Framework Core (SQL Server), Swagger.
- Frontend: React 18 + Vite 5 + TypeScript, Tailwind CSS, shadcn/ui, TanStack Query.
This README covers local setup, configuration, how to run, and key API endpoints.
backend/
BankaAPI/ # ASP.NET Core 8 Web API
BankaAPI.sln
frontend/ # React + Vite app (port 8080)
database/
script.sql # SQL Server DB schema + stored procedures
LICENSE
- .NET SDK 8.0+
- SQL Server (Express or Developer) + SQL Server Management Studio (optional)
- Node.js 18+ and npm (or bun/pnpm if you prefer)
- Connection string name used by the API:
BankaDb.- Set it in
backend/BankaAPI/appsettings.Development.json(recommended for local dev). - Example:
Replace the connection string with your own.
{ "ConnectionStrings": { "BankaDb": "Server=localhost\\SQLEXPRESS;Database=BankaDB;Trusted_Connection=True;TrustServerCertificate=True;" } }
- Set it in
- HTTPS/HTTP ports (from
launchSettings.json):- HTTPS:
https://localhost:7205 - HTTP:
http://localhost:5172
- HTTPS:
- CORS (in
Program.cs) allows the frontend athttp://localhost:8080. If you change frontend port/origin, update the CORS policy and rebuild. - Frontend API base URL (in
frontend/src/lib/api.ts):- Default:
https://localhost:7205/api - If your API runs on a different port/origin, update this constant.
- Default:
Follow these steps in order.
- Create the database schema
- Option A – Run the ready script (easiest)
- Open
database/script.sqlin SSMS and execute it. It creates theBankaDBdatabase, tables, FKs, defaults, and stored procedures.
- Open
- Option B – Use EF Core migrations
- Ensure your
BankaDbconnection string points to an existing SQL Server instance. - Then run (PowerShell):
dotnet tool install --global dotnet-ef cd backend/BankaAPI dotnet restore dotnet ef database update
- Ensure your
- Run the backend API
cd backend/BankaAPI
# Trust the local HTTPS dev certificate on Windows if prompted
dotnet dev-certs https --trust
# Run the HTTPS profile (serves Swagger at /swagger)
dotnet run --launch-profile httpsThe API will be available at https://localhost:7205 (Swagger at https://localhost:7205/swagger).
- Run the frontend
cd frontend
npm install
npm run devThe app will start at http://localhost:8080 and call the API at https://localhost:7205/api.
Base URL (local): https://localhost:7205/api
-
Customers (
/Musteriler)- GET
/Musteriler→ list customers (MusteriOkuDto) - GET
/Musteriler/{musteriNo}→ single customer (MusteriOkuDto) - GET
/Musteriler/sube/{subeAdi}→ customers by branch (uses stored procedureMusteriGetirBySube) - POST
/Musteriler→ create customer (body:MusteriGuncelleDto) - PUT
/Musteriler/{musteriNo}→ update customer (body:MusteriGuncelleDto) - DELETE
/Musteriler/{musteriNo}→ delete customer
Example create/update payload:
{ "Ad": "Ayşe", "Soyad": "Yılmaz", "Telefon": "+90 5xx xxx xx xx", "Sube": "Kadıköy", "KrediNotu": 780, "Cinsiyet": "Kadın", "DogumTarihi": "1995-02-10T00:00:00", "KayitTarihi": "2025-08-10T00:00:00", "KrediTutari": 125000.00 } - GET
-
Payments (
/Odemeler)- GET
/Odemeler→ list payments - GET
/Odemeler/{id}→ payment by id - POST
/Odemeler→ create payment (body:OdemeDto) - PUT
/Odemeler/{id}→ update payment (body:OdemeDto) - DELETE
/Odemeler/{id}→ delete payment
Notes for
OdemeDto:SonOdemeTarihiis a date (the API expects a value convertible to a date; ISOYYYY-MM-DDis safe).- Decimal fields use precision (18,2) in the database.
Example payload:
{ "OdemeId": 0, "MusteriNo": 1, "GuncelOdemeTutari": 2500.00, "GuncelBorcTutari": 72500.00, "SonOdemeTarihi": "2025-08-31", "GecikmisBorcTutari": 0.00, "OdenmisBorcTutari": 27500.00 } - GET
Explore the full schema and try endpoints via Swagger UI at /swagger.
database/script.sql creates:
- Tables:
Musteriler,Odemeler,OdemeLog(with FKs and defaults) - Procedures (examples):
MusteriGetirBySube,sp_MusteriDetayGetir,sp_MusteriEkle,sp_MusteriGuncelle,sp_MusteriSil,sp_OdemeAl,sp_OdemeDetayGetir,sp_OdemeIadeEt,sp_OdemesiGecikenleriGetir - EF decimal precisions are enforced via migrations in
backend/BankaAPI/Migrations
- If the frontend can’t reach the API:
- Ensure the API runs on
https://localhost:7205(or updatefrontend/src/lib/api.ts). - If you change the frontend origin, update CORS in
Program.cs(policyAllowReactApp).
- Ensure the API runs on
- If SQL connection fails:
- Verify the
BankaDbconnection string points to a valid SQL Server instance and database. - For local dev,
Trusted_Connection=True;TrustServerCertificate=True;is convenient.
- Verify the
- Trust the HTTPS dev cert once on Windows:
dotnet dev-certs https --trust.
- Backend: ASP.NET Core 8, EF Core 9 (SqlServer), Swagger
- Frontend: React 18, Vite 5, TypeScript, Tailwind CSS, shadcn/ui, Radix UI, TanStack Query, Axios
This project is licensed under the terms of the license in Apache 2.0.
Follow these steps to validate a fresh setup on a different environment:
- Prereqs: Install .NET 8 SDK, SQL Server (Express/Developer), Node.js 18+.
- Clone and open this repo.
- Database:
- Prefer the EF route: set
ConnectionStrings:BankaDband rundotnet ef database updateinbackend/BankaAPI. - Or use
database/script.sql. If it fails due to MDF/LDF paths, either update the paths or simplify toCREATE DATABASE [BankaDB];and run the rest underUSE [BankaDB].
- Backend:
- Ensure
appsettings.Development.jsonorappsettings.jsoncontains a validBankaDbconnection string. - Trust dev cert once:
dotnet dev-certs https --trust. - Run:
dotnet run --launch-profile httpsinbackend/BankaAPI.
- Frontend:
cd frontend && npm install && npm run dev.- If API origin differs, update
frontend/src/lib/api.tsbaseURL.
- CORS:
- If your frontend runs on a different origin/port, add it to the CORS policy
AllowReactAppinProgram.cs.
Report back with any errors, unclear steps, or missing details.