Sunday, July 27, 2025

Cara Menambahkan Tombol Login/Register dengan Google (OAuth) ke Proyek Website

Cara menambahkan tombol Login/Register dengan Google (OAuth) ke proyek backend Flask dan frontend React Anda, berikut langkah-langkah lengkapnya:


๐Ÿ› ️ Bagian 1: Daftar dan Konfigurasi Google OAuth

1. Masuk ke Google Developer Console

๐Ÿ”— https://console.developers.google.com/

2. Buat Project Baru

  • Klik Select a project > New Project

  • Isi nama proyek, klik Create

3. Aktifkan Google OAuth API

  • Di sidebar: APIs & Services > Library

  • Cari "Google Identity Services" atau "OAuth 2.0" dan klik Enable

4. Buat OAuth 2.0 Client ID

  • Menu: APIs & Services > Credentials

  • Klik + CREATE CREDENTIALS > OAuth client ID

  • Pilih:

    • Application type: Web Application

    • Name: Web Client for E-Book Store

    • Authorized JavaScript origins:

      • http://localhost:3000 (React frontend)

    • Authorized redirect URIs:

      • http://localhost:5000/auth/google/callback (Flask backend route)

  • Simpan client_id dan client_secret


⚙️ Bagian 2: Backend Flask Setup (Google OAuth)

1. Install dependency

pip install flask-dance

2. Tambahkan ke Flask App

from flask import Flask, redirect, url_for, session, jsonify
from flask_dance.contrib.google import make_google_blueprint, google from flask_jwt_extended import create_access_token from models import User # sesuaikan dengan model user Anda from extensions import db app = Flask(__name__) app.secret_key = "secret" app.config["GOOGLE_OAUTH_CLIENT_ID"] = "YOUR_GOOGLE_CLIENT_ID" app.config["GOOGLE_OAUTH_CLIENT_SECRET"] = "YOUR_GOOGLE_CLIENT_SECRET" google_bp = make_google_blueprint(scope=["profile", "email"]) app.register_blueprint(google_bp, url_prefix="/auth/google")

3. Buat Callback Route

@app.route("/auth/google/callback") def google_login_callback(): if not google.authorized: return redirect(url_for("google.login")) resp = google.get("/oauth2/v2/userinfo") user_info = resp.json() email = user_info["email"] name = user_info.get("name", "") user = User.query.filter_by(email=email).first() if not user: user = User(email=email, name=name) db.session.add(user) db.session.commit() access_token = create_access_token(identity=user.id) return jsonify({"access_token": access_token, "email": email})

๐Ÿ’ป Bagian 3: React Frontend Setup

1. Install Library

npm install @react-oauth/google

2. Setup Google OAuth Provider di index.jsx

import { GoogleOAuthProvider } from '@react-oauth/google'; import App from './App'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( <GoogleOAuthProvider clientId="YOUR_GOOGLE_CLIENT_ID"> <App /> </GoogleOAuthProvider> );

3. Buat Tombol Login

import { GoogleLogin } from '@react-oauth/google'; const GoogleLoginButton = () => { const handleLogin = async (credentialResponse) => { const response = await fetch("http://localhost:5000/auth/google/callback", { method: "GET", credentials: "include", }); const data = await response.json(); localStorage.setItem("token", data.access_token); // redirect or update UI }; return ( <GoogleLogin onSuccess={handleLogin} onError={() => console.log("Login Failed")} /> ); };

๐Ÿงช Testing

  1. Jalankan Flask backend (localhost:5000)

  2. Jalankan React frontend (localhost:3000)

  3. Klik tombol Google login → pastikan akun Anda muncul di database → token tersimpan di localStorage

Saturday, July 26, 2025

PETUALANGAN MATEMATIKA Menjelajah Dunia Bidang Datar & Volume dengan Mudah dan Menyenangkan!

๐Ÿ“˜ Petualangan Matematika: Belajar Jadi Menyenangkan!

Buku "Petualangan Matematika" adalah teman belajar yang seru dan ramah anak untuk menjelajahi dunia bidang datar dan volume! ๐Ÿ“š✨ Dirancang khusus untuk anak-anak usia 8–12 tahun, buku ini mengajak pembaca cilik belajar matematika dengan cara yang asyik dan tidak menakutkan.


Melalui cerita petualangan, karakter-karakter lucu seperti Miki, Lala, Bu Lingkaran dan Koko Kubus, serta contoh nyata dari kehidupan sehari-hari, anak-anak akan belajar:
  • ๐Ÿ“ Bagaimana bentuk bidang datar ada di sekitar kita (misalnya jendela persegi, pizza berbentuk lingkaran).
  • ๐ŸŽฒ Cara menghitung luas & keliling sambil bermain.
  • ๐Ÿงช Konsep volume lewat eksperimen seru seperti mengukur kapasitas kotak bekal.
Setiap bab dilengkapi dengan:
  • ๐ŸŽจ Ilustrasi penuh warna yang bikin matematika jadi menyenangkan.
  • ๐Ÿ” Contoh soal langkah demi langkah untuk melatih logika.
  • ๐Ÿ’ก Aplikasi praktis, misalnya: "Jika kamu ingin membuat bingkai foto, berapa panjang kayu yang dibutuhkan?"
  • ๐ŸŽฏ Permainan dan tantangan seru untuk menguji pemahaman!
Dengan pendekatan belajar sambil bermain, buku ini membantu anak-anak mengatasi rasa takut terhadap angka dan membangun percaya diri dalam memecahkan masalah matematika. ๐Ÿš€

Siapa bilang matematika itu sulit? Di sini, matematika adalah petualangan penuh kejutan!

Thursday, July 24, 2025

Why Traditional Stock Analysis Fails You—And How AI Can Unlock NVIDIA’s True Potential

 

Why Traditional Stock Analysis Fails You—And How AI Can Unlock NVIDIA’s True Potential



If you’ve ever felt overwhelmed analyzing fast-moving stocks like NVIDIA, you’re not alone.

Between outdated metrics, conflicting advice, and emotional decision-making, traditional investment strategies simply can’t keep up with today’s AI-driven market shifts.

And here’s the hard truth:

๐Ÿ”ด Relying on generic tools and expensive advisors might actually cost you more—in money, time, and missed opportunities.

The New Way to Invest in AI Market Leaders Like NVIDIA

DeepSeek AI is not another short-term trading gimmick or overpriced advisory subscription. It’s a comprehensive, 167-page PDF guide that introduces battle-tested, AI-enhanced investment strategies specifically for NVIDIA and other AI innovators.

What you’ll learn isn’t just theory—it’s a full investment framework grounded in technical, fundamental, and sentiment analysis, combined with risk management tactics that work even in volatile markets.

Inside the guide, you’ll discover how to:

✅ Use cutting-edge AI insights to evaluate NVIDIA’s stock with confidence
✅ Build a research routine that fits your lifestyle
✅ Avoid emotional trading and stay strategic
✅ Set clear risk boundaries—and respect them
✅ Escape the trap of outdated financial models

This isn’t about hype—it’s about clarity and control.

Stop Chasing Trends. Start Investing with Insight.

The AI revolution isn’t coming—it’s already here. And NVIDIA is leading it.

Whether you’re a cautious investor or a growth seeker, understanding how to evaluate NVIDIA with modern tools could be the difference between stagnation and serious portfolio growth.

๐Ÿš€ Don’t let traditional stock analysis hold you back.
๐Ÿ‘‰ Download the FREE guide now and start mastering NVIDIA’s stock with DeepSeek AI


For Serious Investors Seeking AI Market Mastery...

Best-Selling Market Analyst Reveals a NEW Data-Driven Approach to Analyze NVIDIA's AI Market Position and Capture Unprecedented Growth Opportunities.

Discover how to evaluate NVIDIA's true market potential, identify key entry points, make confident investment decisions, and build significant long-term wealth – WITHOUT expensive advisory services, complex trading algorithms, or high-risk options strategies.

Perfect for both retail and institutional investors.

Marcus Chen
AI Investment Strategist & Wall Street Veteran
+87,403 portfolio success stories

DeepSeek AI: Unlocking NVIDIA's Stock Potential

⭐ 4.9/5 based on 912 verified reviews
๐Ÿง  100 AI-Powered Market Analysis Strategies
๐Ÿ“Š Technical frameworks to turn uncertainty into confidence
๐Ÿ” Independent research system for clear due diligence
๐Ÿง˜ Risk & Position Sizing strategies to protect returns
๐Ÿ“‚ Templates, spreadsheets & tools included
♾️ Lifetime access

๐ŸŽ‰ AI Summit Special Offer

TODAY ONLY: $10-14 $133
Lock in your >89% discount now!

๐Ÿ”’ Secure Checkout | ๐Ÿš€ Instant Delivery

Consider this: While other investors struggle to understand NVIDIA's true potential in the AI revolution, you'll have a complete analytical framework at your fingertips within the next 2 minutes.

Don't wait until after the next big market move. Every day you delay is another opportunity missed in the fastest-growing tech sector.

Your Investment is Protected.