Skip to content

DQuoc31/Banking_NMCNPM

Repository files navigation

Quản Lý Sổ Tiết Kiệm

Hệ thống quản lý sổ tiết kiệm cho nhân viên ngân hàng với tích hợp Google OAuth authentication và PostgreSQL database.

🚀 Quick Start

1. Cài đặt Dependencies

# Frontend
npm install

# Backend
cd backend
npm install
cd ..

2. Cấu hình Environment

Backend (backend/.env):

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
DATABASE_URL=postgresql://postgres:password@db.project.supabase.co:5432/postgres
PORT=3001
NODE_ENV=development
FRONTEND_URL=http://localhost:3000

Frontend (.env):

VITE_BACKEND_API_URL=http://localhost:3001/api

3. Setup Database

  1. Mở Supabase Dashboard → SQL Editor
  2. Chạy SQL script từ backend/db/schema.sql

4. Chạy Project

Cách 1: Sử dụng VS Code Tasks (Khuyên dùng)

  • Mở VS Code
  • Ctrl+Shift+P → "Tasks: Run Task" → Start All (Frontend + Backend)

Cách 2: Chạy thủ công

Terminal 1 - Backend:

cd backend
npm run dev

Terminal 2 - Frontend:

npm run dev

5. Mở Browser

Truy cập: http://localhost:3000

📚 Tài Liệu

🏗️ Cấu Trúc Project

banking/
├── backend/              # Backend API (Node.js/Express)
│   ├── db/              # Database schema
│   ├── routes/          # API routes
│   └── index.js         # Main server
├── src/                 # Frontend (React + Vite)
│   ├── components/      # React components
│   ├── lib/            # Utilities & API clients
│   └── App.tsx         # Main app
└── .vscode/            # VS Code configurations

✨ Tính Năng

  • ✅ Google OAuth Authentication
  • ✅ PostgreSQL Database (Supabase)
  • ✅ User Profile Management
  • ✅ Savings Account Management
  • ✅ Customer Management
  • ✅ Withdrawal Management
  • ✅ Reports & Statistics

🔧 Yêu Cầu Hệ Thống

  • Node.js v18+
  • npm hoặc yarn
  • Supabase account (free tier OK)
  • Google Cloud account (cho OAuth)

📖 Luồng Google OAuth

  • Lần đầu đăng nhập: User đăng nhập Google → Form đăng ký → Hoàn thành profile → Vào app
  • Lần sau: User đăng nhập Google → Tự động đăng nhập → Vào app

🛠️ Tech Stack

Frontend:

  • React 18
  • Vite
  • TypeScript
  • Tailwind CSS
  • Supabase Client

Backend:

  • Node.js
  • Express
  • PostgreSQL (Supabase)
  • Supabase Admin API

📝 Scripts

Frontend

  • npm run dev - Start development server
  • npm run build - Build for production

Backend

  • npm run dev - Start development server (with watch)
  • npm start - Start production server

🐛 Troubleshooting

Xem HUONG_DAN_CHAY_PROJECT.md để biết cách xử lý các lỗi thường gặp.

📄 License

Private project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors