IT |
気になる、記になる… |
【Kindle本セール】講談社タイトルの複数セール開催中 − 対象タイトルが全て半額の『「ダイエット本」大特集』などが新たにスタート |
https://taisy0.com/2023/05/29/172257.html
|
amazon |
2023-05-29 14:12:34 |
IT |
気になる、記になる… |
Amazon、「Kindle本まとめ買いキャンペーン」を開催中 − 8冊まとめて購入で10%ポイント還元 |
https://taisy0.com/2023/05/29/172254.html
|
amazon |
2023-05-29 14:03:09 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
【python】PAY.JPの導入案と使い方をまとめたよ |
https://qiita.com/takoraisutaro/items/ffa3013c4d800bf7feaa
|
payjp |
2023-05-29 23:29:35 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
OpenSearchのTokenizerとフレーズ検索の挙動について |
https://qiita.com/unitia0323/items/e48e7848ab053b469468
|
opensearch |
2023-05-29 23:38:55 |
技術ブログ |
Developers.IO |
I tried to make a Google Sheets chart about smartphone sales in Japan by making use of Bing AI |
https://dev.classmethod.jp/articles/i-tried-to-make-a-google-sheets-chart-about-smartphone-sales-in-japan-by-making-use-of-bing-ai/
|
I tried to make a Google Sheets chart about smartphone sales in Japan by making use of Bing AIIntroduction Hemanth of Alliance Department here In this blog I tried to create chart in Google sheet about |
2023-05-29 14:06:22 |
海外TECH |
MakeUseOf |
How to Handle Events in Vue |
https://www.makeuseof.com/vue-events-how-handle/
|
events |
2023-05-29 14:30:19 |
海外TECH |
MakeUseOf |
8 Things You Can Do on a Galaxy Watch With Your iPhone |
https://www.makeuseof.com/using-galaxy-watch-with-iphone/
|
galaxy |
2023-05-29 14:30:19 |
海外TECH |
MakeUseOf |
How to Fix the Nvidia Container's High CPU Usage on Windows |
https://www.makeuseof.com/windows-nvidia-container-high-cpu/
|
How to Fix the Nvidia Container x s High CPU Usage on WindowsGaming tools that take up a lot of CPU do more harm than help for your games Here s how to stop the Nvidia Container from soaking up your CPU |
2023-05-29 14:15:17 |
海外TECH |
DEV Community |
Meme Monday |
https://dev.to/ben/meme-monday-34ka
|
Meme MondayMeme Monday Today s cover image comes from last week s thread DEV is an inclusive space Humor in poor taste will be downvoted by mods |
2023-05-29 14:27:36 |
海外TECH |
DEV Community |
Seamless, full-stack authentication in Next.js |
https://dev.to/livecycle/seamless-full-stack-authentication-in-nextjs-11lp
|
Seamless full stack authentication in Next js TL DRIn this tutorial we ll show you how to use add authentication to your full stack application using Clerk We have zero affiliation with Clerk they don t even know we wrote this but we like their tool and we thought this walk through would be helpful to other developers who have asked us about authentication in the context of Next js IntroductionAuthentication has always been one of the major pain points while building full stack applications Especially in the Node js environment where the major libraries and frameworks don t come with auth primitives built in So developers had to step up and built their own authentication solution But building secure authentication from scratch is a tall order You have to hash and salt passwords issue signed tokens to create a session and prevent various kind of malicious attack vectors Then you also have to make sure your front and back end can communicate with each other and share the session Luckily there are libraries such as Passport js for Express and NextAuth for Next js to help you achieve this But they re far from perfect There are still a few steps involved for setting them up And while they work great for Social Authentication with services like Google or GitHub getting password login going is more difficult And while these libraries are undoubtedly a big help at the end of the day passwords are still stored in your database Where you bear the full responsibility Nowadays email verification upon sign in password less login and factor authentication have become very popular And while certainly possible with the previously discussed libraries setting up these features requires additional work Enter Clerk a hosted authentication provider They take all of the pain away from authentication and make it super easy to properly secure your full stack application And compared to other hosted authentication providers we think that Clerk offers a MUCH better developer experience Along with Clerk we ll be using Next js to build a very simple full stack application with their new App Router Can you star our GitHub repo We create content like this because like open source code we believe quality developer content should be open and accessible to everyone who can benefit from it Would you be willing to support our open source efforts in general by starring our GitHub repository We d be thrilled and it would also help us to keep creating content like this Thank you uAnd now with the introductions are out of the way… SetupIn your terminal in a folder of choice run the command npx create next app latest to provision a new Next app Observe the settings we picked below Especially important is that you say both Yes to Tailwind CSS and App Router ➜ Desktop npx create next app latest What is your project named clerk auth Would you like to use TypeScript with this project No Yes Would you like to use ESLint with this project No Yes Would you like to use Tailwind CSS with this project No Yes Would you like to use src directory with this project No Yes Use App Router recommended No Yes Would you like to customize the default import alias No YesNow we change into the clerk auth folder that was just created and install the single depdenency that we need Clerk npm install clerk nextjsNow we need to create a Clerk account and new project in order to obtain our API keys So go to clerk com create an account and once in the dashboard click “Add application Name the application clerk auth demo and select Email Google as sign in methods If you like you can also add other sign in methods It won t make any difference during development since Clerk does it all for you Now Clerk automatically presents you with the API keys we need to add to our Next app So create a env local file with this content copied over from Clerk NEXT PUBLIC CLERK PUBLISHABLE KEY pk test CLERK SECRET KEY sk test One last thing to we need to do to fully configure Clerk auth is adding the authentication provider to the src app layout tsx file If you re used to the old Next js pages paradigm this is like the src app tsx file import ClerkProvider from clerk nextjs import globals css import Inter from next font google const inter Inter subsets latin export const metadata title Create Next App description Generated by create next app export default function RootLayout children children React ReactNode return lt ClerkProvider appearance variables colorPrimary red gt lt html lang en gt lt body className inter className gt children lt body gt lt html gt lt ClerkProvider gt The ClerkProvider has an appearance prop where we can customize the Clerk components to fit our design language Each Clerk component can also be styled individually in more detail And with this we re now ready to use Clerk in our app Adding authentication to the app Sign in and sign up pagesFirst we need to create the pages to sign up and sign in Clerk already provides us with complete components for the forms So all that s left to do is build a very simple page around these components We start off with the sign in page So create a new component at src app sign in sign in page tsx with this content import SignIn from clerk nextjs export default function SignInPage return lt div className flex items center justify center h screen gt lt SignIn gt lt div gt The file path is different than what you might be used to from older Next js applications The page URL is defined by the src app sign in folder So the page will live at sign in The quare brackets are for capturing anythign after sign in which Clerk uses internally And with the new App Router the page itsself always lives in a page tsx file We do the same thing for the sign up page at src app sign up sign up page tsximport SignUp from clerk nextjs export default function SignUpPage return lt div className flex items center justify center h screen gt lt SignUp gt lt div gt If you now go to http localhost sign in you ll see this premade Sign Up component that works with both Email amp Password and whichever social auth providers you selected Account pageCreate an account or log in through Google Just like that you re signed in to the app But we can t do much with it for now So let us create the account page For this change the file at src app page tsx to this import UserButton from clerk nextjs export default function Home return lt div className flex justify center items center h screen gt lt div className bg white p rounded md flex items center gap text gray gt lt p gt Hello User lt p gt lt UserButton afterSignOutUrl gt lt div gt lt div gt Here we are using the Clerk UserButton component When signed in this acts as a drop down to open the integrated User Setting modal where users can change their password email addresses and various other settings That all comes for fee When self rolling auth this would take ours of development time Protecting pages Secret pageWe now want to create a new page at protectet that is only accessible by authenticated users So for this we ll create a new middleware at src middleware ts with this content import authMiddleware from clerk nextjs export default authMiddleware publicRoutes export const config matcher next api trpc Also add these new variables to your env local file in order to tell Clerk how to behave when having to redirect you other settingsNEXT PUBLIC CLERK SIGN IN URL sign inNEXT PUBLIC CLERK SIGN UP URL sign upNEXT PUBLIC CLERK AFTER SIGN IN URL NEXT PUBLIC CLERK AFTER SIGN UP URL This middleware provided by Clerk ensures that only the root page and the sign up and sign in pages are visible bto unauthenticated users So let us now create the page at src app protected page tsxexport default function Protected return lt div className flex justify center items center h screen gt lt div className bg white p rounded md flex items center gap text gray gt lt p gt This is a protected page lt p gt lt div gt lt div gt Try to access this page when signed in and when signed out Notice how you ll be redirected to sign in when not authenticated Sign in link on home pageOn the root page we currently do not show any information when the user is not logged in Now that we have the middleware set up we can change this So modify the src app page tsx file import UserButton currentUser from clerk nextjs import Link from next link export default async function Home const user await currentUser return lt div className flex justify center items center h screen gt lt div className bg white p rounded md flex items center gap text gray gt user lt gt lt p gt Hello User user emailAddresses emailAddress lt p gt lt UserButton afterSignOutUrl gt lt gt lt Link href sign in className text blue gt Sign in lt Link gt lt div gt lt div gt This is a react server component that asynchronously fetches the current user session from Clerk using await Based on wether or not the session is present it then renders either the UserButton along with the user s email address or a link to the sign in page Protecting API routesSo far we have looked at how to protect the front end of your application But a full stack app also needs a backend For this we ll create a backend endpoint at GET api with this file src app api route ts in the new App Router pattern import auth from clerk nextjs import NextResponse from next server export async function GET const userId auth if userId return new Response Unauthorized status const data message Hello User id userId return NextResponse json data The auth function checks if there is a Clerk session present If not we throw a unauthorized error After that we can do whatever we want in the endpoint knowing that the user is authenticated And we have access to the userId which is important when referencing data in the database to a user Wrapping upWith this we have completed the full implementation of Clerk Authentication in a full stack Next js application As you can see we barely have to write any authentication specific code for this to work That s the beauty of using an external provider such as Clerk And even better our small demo application comes with a lot of user management features built in that we didn t have to do any work for Such as verifying and changing email addresses password change and social login Clerk works best in frameworks such as Next js when you have the front and back end in the same application If you have a detatched backend the setup takes a bit more work Clerk can issue JWT tokens that you can send along with API requests to your backend and then verify the user through that But the process won t be as seamless as what we showed here |
2023-05-29 14:26:12 |
海外TECH |
DEV Community |
Crafting Software Architecture artefacts: Transformer Chronicles |
https://dev.to/balagmadhu/crafting-software-architecture-artefacts-transformer-chronicles-2o98
|
Crafting Software Architecture artefacts Transformer ChroniclesIntroduction Software architecture documentation plays a vital role in ensuring effective communication knowledge transfer system understanding maintenance compliance scalability and risk management throughout the software development lifecycle This blog are some tips to harness the LLM generative AI technology to assist with documentation Scenario Consider the task is to create a platform for a BB Lets explore on how we could build documentation if the ask is to create documentation for a BB platform Capturing the capabilities neededcan you create a mindmap diagram in mermaid html code for all the capabilities that is needed to be designed for a BB sales platformthe output is lt DOCTYPE html gt lt html gt lt head gt lt script src gt lt script gt lt script gt mermaid initialize startOnLoad true lt script gt lt head gt lt body gt lt div class mermaid gt graph TB BB BB Sales Platform gt Capabilities Capabilities Capabilities gt CustomerManagement Customer Management Capabilities Capabilities gt ProductCatalog Product Catalog Capabilities Capabilities gt QuotingPricing Quoting and Pricing Capabilities Capabilities gt OrderManagement Order Management Capabilities Capabilities gt InventoryManagement Inventory Management Capabilities Capabilities gt SalesAnalytics Sales Analytics Capabilities Capabilities gt CRMIntegration CRM Integration Capabilities Capabilities gt CollaborationTools Collaboration Tools Capabilities Capabilities gt ReportingDashboards Reporting and Dashboards Capabilities Capabilities gt ERPIntegration Integration with ERP Systems Capabilities Capabilities gt PaymentGateway Payment Gateway Integration lt div gt lt body gt lt html gt generate the data model in detail in tabular format in markdowngenerate data model in detail in tabular format in markdownGenerate the Sequence diagram in detailCan you create a sequence diagram in Mermaid html for order management lt DOCTYPE html gt lt html gt lt head gt lt script src gt lt script gt lt script gt mermaid initialize startOnLoad true lt script gt lt head gt lt body gt lt div class mermaid gt sequenceDiagram participant Customer participant SalesPerson participant Warehouse participant ShippingService participant AccountingSystem Customer gt gt SalesPerson Place Order SalesPerson gt gt Warehouse Check Stock Availability alt Sufficient Stock Warehouse gt gt SalesPerson Confirm Stock Availability SalesPerson gt gt ShippingService Ship Order ShippingService gt gt AccountingSystem Create Invoice AccountingSystem gt gt SalesPerson Invoice Confirmation SalesPerson gt gt Customer Order Confirmation else Insufficient Stock Warehouse gt gt SalesPerson Stock Unavailable SalesPerson gt gt Customer Stock Unavailable Notification end lt div gt lt body gt lt html gt Generate class diagram Can you create a class diagram for a database design for order management process in Mermaid html lt DOCTYPE html gt lt html gt lt head gt lt script src gt lt script gt lt script gt mermaid initialize startOnLoad true lt script gt lt head gt lt body gt lt div class mermaid gt classDiagram class Customer customerId int name string address string email string phone string placeOrder void getOrderHistory Order class Order orderId int customerId int orderDate Date orderTotal decimal orderItems OrderItem getOrderStatus string class OrderItem orderItemId int orderId int productId int quantity int price decimal class Product productId int name string description string price decimal getAvailableStock int class Warehouse warehouseId int name string location string checkStockAvailability productId int quantity int boolean updateStock productId int quantity int void class ShippingService shipOrder order Order string Customer gt Order OrderItem gt Order OrderItem gt Product Warehouse gt Product ShippingService gt Order lt div gt lt body gt lt html gt Entity Relationshipcreate a Entity Reference diagram in mermaid HTML for an order management systemerDiagram Customer o Order places Customer o Address has Order o OrderItem contains Product o OrderItem has Address o Order billing Address o Order shipping Customer string customer id string name string email string phone Order string order id string order date string status OrderItem string item id integer quantity decimal price Product string product id string name decimal price Address string address id string street string city string state string country string postal code Generate the SQLgenerate the SQL DDL statements Create Customer tableCREATE TABLE Customer customer id INT PRIMARY KEY name VARCHAR address VARCHAR email VARCHAR phone VARCHAR Create Order tableCREATE TABLE Order order id INT PRIMARY KEY customer id INT order date DATE order total DECIMAL FOREIGN KEY customer id REFERENCES Customer customer id Create OrderItem tableCREATE TABLE OrderItem order item id INT PRIMARY KEY order id INT product id INT quantity INT price DECIMAL FOREIGN KEY order id REFERENCES Order order id FOREIGN KEY product id REFERENCES Product product id Create Product tableCREATE TABLE Product product id INT PRIMARY KEY name VARCHAR description TEXT price DECIMAL Create Warehouse tableCREATE TABLE Warehouse warehouse id INT PRIMARY KEY name VARCHAR location VARCHAR Create ShippingService tableCREATE TABLE ShippingService shipping service id INT PRIMARY KEY name VARCHAR Swagger for a REST based APIcan you create a rest API for swagger for order statusopenapi info title Order Status API version paths orders orderId status get summary Get order status parameters in path name orderId required true schema type string description ID of the order responses description Successful operation content application json schema ref components schemas OrderStatusResponse description Order not found content application json schema ref components schemas Error components schemas OrderStatusResponse type object properties orderId type string description ID of the order status type string description Current status of the order Error type object properties message type string description Error messageHaving a good architecture documentation provides a clear and comprehensive overview of the system s structure interfaces and design decisions enabling better collaboration among team members and stakeholders With right prompt engineering the LLM can provide us a head start for the documentation |
2023-05-29 14:03:19 |
Apple |
AppleInsider - Frontpage News |
Apple Wallet patent infringement suit heads to settlement conference |
https://appleinsider.com/articles/23/05/29/apple-wallet-patent-infringement-suit-heads-to-settlement-conference?utm_medium=rss
|
Apple Wallet patent infringement suit heads to settlement conferenceApple and Texas firm Fintiv are preparing to hash out a potential settlement on June to try and end a patent infringement lawsuit involving Apple Pay and Apple Wallet Apple Wallet on an iPhoneThe U S District Court for the Western District of Texas has ordered for Fintiv and Apple to meet for a settlement conference on June The conference is meant as the last formal step before the two sides head to a full trial with the intention of arranging a settlement before reaching that point Read more |
2023-05-29 14:41:42 |
Apple |
AppleInsider - Frontpage News |
Memorial Day deals: iPads from $149, $230 off Apple Watch, LG TV & monitor sale, more |
https://appleinsider.com/articles/23/05/29/memorial-day-deals-ipads-from-149-230-off-apple-watch-lg-tv-monitor-sale-more?utm_medium=rss
|
Memorial Day deals iPads from off Apple Watch LG TV amp monitor sale moreToday s top deals include off an LG HDR K Smart OLED Evo TV off an Apple M Mac mini and AppleCare Kit off an LG UltraGear K gaming monitor and up to off Amazon devices Save on an LG HDR K Smart OLED Evo TVThe AppleInsider team combs the web for quality deals at online stores to develop a list of unbeatable bargains on popular tech items including discounts on Apple products TVs accessories and other gadgets We post our top finds daily to help you save money Read more |
2023-05-29 14:04:12 |
海外TECH |
WIRED |
35 Best Memorial Day Sales and Deals: Pizza Ovens, Recycled Bags, and More |
https://www.wired.com/story/best-memorial-day-sales-2023/
|
right |
2023-05-29 14:06:00 |
金融 |
金融庁ホームページ |
「デジタル・分散型金融への対応のあり方等に関する研究会」(第10回)議事次第を公表しました。 |
https://www.fsa.go.jp/singi/digital/siryou/20230529.html
|
Detail Nothing |
2023-05-29 16:00:00 |
ニュース |
BBC News - Home |
Bola Tinubu inauguration: Fuel subsidy removed in Nigeria |
https://www.bbc.co.uk/news/world-africa-65737846?at_medium=RSS&at_campaign=KARANGA
|
address |
2023-05-29 14:42:43 |
コメント
コメントを投稿