Skip to content

congdev9x/calendar-event-app-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📆 Calendar Event App – Backend

API backend cho ứng dụng quản lý sự kiện theo lịch Dương và Âm lịch, hỗ trợ người dùng cá nhân hóa và đồng bộ hóa với Google Calendar.


🛠 Công nghệ sử dụng

  • Node.js + Express
  • Prisma + PostgreSQL
  • TypeScript
  • JWT Auth
  • Google OAuth 2.0
  • Zodios API schema

✨ Hướng dẫn khởi chạy

1. Cài đặt

npm install

2. Cấu hình

Tạo file .env và thêm:

DATABASE_URL=postgresql://user:password@localhost:5432/calendar_db
JWT_SECRET=your_jwt_secret
SESSION_SECRET=your_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CALLBACK_URL=http://localhost:3001/api/auth/google/callback

3. Khởi tạo database

npx prisma migrate dev
npx prisma generate

4. Chạy server dev

npm run dev

5. Build + start production

npm run build
npm start

✅ Đã triển khai

  • Đăng ký, đăng nhập (email + password)
  • Đăng nhập bằng Google OAuth
  • Sinh JWT token, xác thực middleware
  • Quản lý User / Event liên kết qua userId
  • API tạo/sửa/xoá/lấy sự kiện cá nhân
  • Chặn sửa/xoá event của người khác
  • Lưu accessToken + refreshToken từ Google
  • Đồng bộ tạo/sửa/xoá sự kiện với Google Calendar
  • Tự động refresh access token khi hết hạn

🧍 Chưa triển khai

  • Webhook để đồng bộ ngược từ Google Calendar về app
  • Nhắc lịch (notification hoặc email trước sự kiện)
  • Tùy chọn chia sẻ lịch với người khác
  • Dashboard admin (thống kê, theo dõi user)
  • Tự chọn timezone + cấu hình giờ nhắc
  • Lịch công việc nhóm (đa người dùng)
  • Rate limit, audit log cho request

📁 Cấu trúc thư mục

src/
├── app.ts               # Entrypoint chính
├── routes/              # Các router Express
├── controllers/         # Xử lý request
├── middlewares/         # Auth, error handling
├── lib/                 # Prisma, JWT, utils
├── services/            # Google Calendar, email...
└── config/              # Passport config

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors