投稿時間:2023-05-16 17:19:20 RSSフィード2023-05-16 17:00 分まとめ(21件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Techable(テッカブル) ドコモ、スマホデータから免疫力変化を推定するAIを開発。自治体向けヘルスケアサービスに導入 https://techable.jp/archives/206298 位置情報 2023-05-16 07:00:18
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders ウィズセキュア、富士通Japanを通じて医療機関向けにエンドポイントセキュリティ製品を提供 | IT Leaders https://it.impress.co.jp/articles/-/24830 itleaders 2023-05-16 16:30:00
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders 日本TCS、業務プロセスの清流化と事前アセスメントで構成するS/4HANA移行支援サービス | IT Leaders https://it.impress.co.jp/articles/-/24831 日本TCS、業務プロセスの清流化と事前アセスメントで構成するSHANA移行支援サービスITLeaders日本タタ・コンサルタンシー・サービシズ日本TCSは年月日、SAPSHANA移行支援サービス「TCSConvertCore」を発表した。 2023-05-16 16:19:00
AWS AWS Japan Blog 製造業向けデモダッシュボード開発で、アジャイル開発宣言の原則の重要性を再認識した話 https://aws.amazon.com/jp/blogs/news/manufacturing-quicksight-dashboard-story/ 製造業向けデモダッシュボード開発で、アジャイル開発宣言の原則の重要性を再認識した話年月に行われたAWSSummitTokyoの製造IoTブースで展示させていただき、好評いただいた製造業向けデモダッシュボードの開発において、どのように開発を進められたか、その中で得た学びや気づきを記事にしました。 2023-05-16 07:01:22
js JavaScriptタグが付けられた新着投稿 - Qiita 【メモ】Vue.jsエラー解決:Uncaught TypeError: Cannot read properties of null (reading 'hoge') https://qiita.com/koinunopochi/items/184408d0d0d62f5d0526 hogehogehogehohe 2023-05-16 16:23:22
Ruby Rubyタグが付けられた新着投稿 - Qiita UnloosenでGoogleChromeの拡張機能「Try Ruby Now」を作成 https://qiita.com/NaotoCoding/items/a09e17201d6219770e22 googlechrome 2023-05-16 16:14:32
Docker dockerタグが付けられた新着投稿 - Qiita 今後の開発はDockerと共に!Dockerの魅力について https://qiita.com/uenomoto/items/deb6fbc7c62d8da67529 compose 2023-05-16 16:31:40
技術ブログ Developers.IO How to Solve the CORS Error: Access-Control-Allow-Origin when trying to fetch data from API https://dev.classmethod.jp/articles/how-to-solve-the-cors-error-access-control-allow-origin-when-trying-to-fetch-data-from-api/ How to Solve the CORS Error Access Control Allow Origin when trying to fetch data from APIIntroduction Hemanth of Alliance Department here In this blog I will try to give a solution of CORS error th 2023-05-16 07:04:58
海外TECH DEV Community 📝Why QA for IaC is important https://dev.to/jessica_veit/why-qa-for-iac-is-important-2e91 Why QA for IaC is importantThe world of Clouds ️A seemingly magical place scalable to the prim and the epitome of automation Yet I wouldn t be the code quality advocate that I am if my first question here wouldn t be How do I test it The past months I immersed myself in Terraform an Infrastructure as Code tool and embarked on the quest to find out how different or maybe similar testing IaC is to test our well known general purpose code Yet let us not get ahead of yourself In this post we are looking at what Infrastructure as Code acutally means and how quality assurance comes into play in this field Infrastructure as Code and QA Infrastructure as Code IaC is currently fundamentally changing the processes in IT operation departments It is the practice of provisioning infrastructure with an often declarative approach promoting scalability and automatization in this sector Although it is not a new technology with the first impactful launches of IaC tools by HashiCorp and Azure in its usage picked up significantly in the past years as the cloud computing sector started to grow incessantly Not at least because of the pace infrastructure is to be provisioned in the cloud nowadays IaC is the future of operations Yet even though this practice is seen as the new industry standard testing and general quality assurance as well as maintenance of the implemented code is still a blank spot in research For this reason this blog series aims to give an overview of the state of the art IaC technologies and their potential pitfalls defects and misconfigurations that can impact the final infrastructure deployed as well as point out its similarities to the development and testing of general purpose languages GPLs The information presented are a combination of literature research and practical implementation in form of proof of concepts with Terraform Why QA is important ️We evidence that the field of development and maintenance IaC is in its infancy and deserves further attention Kumara et al In software development code testing agile workflows the practice of continues integration and delivery CI CD and versioning of source code were heavily adopted over recent years not least thanks to pioneers like Robert C Martin and Martin Fowler It was a clear response to the rapid pace of change in demands and expectations of end users as well as the progressing digitalization in virtually every sector imaginable the assurance of code quality In parallel to these developments in the software sector also information technology IT infrastructure has undergone many innovations with one being Infrastructure as Code IaC Infrastructure as code IaC is the DevOps tactic of managing and provisioning infrastructure through machinereadable definition files rather than physical hardware configuration or interactive configuration tools Guerriero et al and it thus paves the way to unite development and operations short DevOps in a way it has not been possible before With IaC network engineers can utilize the aforementioned software development practices that until now were exclusively applicable in the domain of software development Like with general purpose code IaC scripts form a living comprehensible documentation more accurate than any configuration management database CMDB could ever do and enable a new chapter in the QA of infrastructure as a whole This is important due not least to the very high risks of deploying new software be it a software service or an IaC script without rigorous QA have greater implications now than ever before As the IBM Cost of Data Breaches Report showed depending on the effected cloud environment the breaches average cost for companies are enormous Ermetic Team With these cloud based breaches which account for of all data breaches included in the report the seriousness of this issue especially in the prospect of the ever increasing adoption of cloud computing cannot be ignored For this reason it is not just important to lay the focus on generally making infrastructure deployment simpler at its core with IaC but simultaneously define and improve its testing options Because in software engineering untested code is one of the most effective ways to generated legacy code fast as Tests document the intended behaviour of code which is a tremen dous help for future developers to understand it Schweighofer n d Next Steps 🪜After understanding the issue the next logical step is to understand how IaC came to be and what it means in the boarder context of IT operations So get ready for the origin story of IaC in the next post Photo by Pixabay 2023-05-16 07:44:14
海外TECH DEV Community Core Web Vitals, ¿qué son y cómo mejorar tu web? https://dev.to/miasalazar/core-web-vitals-que-son-y-como-mejorar-tu-web-2i5i Core Web Vitals ¿quéson y cómo mejorar tu web ¿Core Web Vitals Las Core Web Vitals son una iniciativa de Google anunciada en que pretende mejorar las experiencias de usuario y los tiempos de carga Establecen una serie de criterios unificados que deben de seguirse y que Google empezóa tener en cuenta a la hora de posicionar nuestra web en su buscador a partir de febrero de Estas Core Web Vitals son fáciles de seguir Solamente son tres y cada una menciona un aspecto importante de la experiencia de usuario Largest Contentful Paint LCP Hace referencia al contenido que ocupa un mayor espacio vídeo imagen texto en la página sin hacer scroll Esta métrica mide cuánto tiempo tarda en verse esta parte desde que la página empieza a cagar En función de la cantidad de segundos que necesite para estar completamente visible existen tres posibles puntuaciones Buena Menos de segundos Mejorable Hasta los segundos Lenta Más de segundos First Input Delay FID Mide la capacidad de respuesta e interactividad que tiene la página es decir cuánto tiempo pasa desde que la persona realiza algo hasta que se responde Relacionada con esta métrica debemos tener en consideración Primer despliegue de contenido FCP Lapso sucedido entre el principio de la carga hasta que cualquier elemento se ve en pantalla Tiempo para interactuar TTI Intervalo entre que empieza la carga hasta que están disponibles los recursos secundarios y se puede contestar adecuadamente Tiempo total de bloqueo TBT Cantidad de tiempo entre el FCP y el TTI Estos son los posibles valores Buena Menos de milisegundos Mejorable Menos de milisegundos Lento Más de milisegundos Cumulative Layout Shift CLS Indica el número de cambios inesperados que suceden en el diseño su estabilidad visual Esta medida nace para evitar las molestas situaciones en las que de repente aparece un elemento provocando que las personas que navegan hagan click por error Estas situaciones se deben a la carga asíncrona de algún dato o a elementos que se añaden de forma dinámica según ciertas circunstancias CLS se diferencia de las demás en que no mide el tiempo sino la magnitud y la frecuencia de los cambios En función de ellos muestra una puntuación Con cada cambio va sumando y al final recoge en una valoración todo lo observado Cuanto mayor es la calificación peor Sus posibles valores Buena Menor de Mejorable Menor de Lento Mayor de ¿Cómo medir nuestras Core Web Vitals Algunas herramientas que podemos usar son Lighthouse Esta herramienta incluye auditorías que nos permite comprobar nuestras CWV y formas de arreglar los problemas diagnosticados Dentro de Lighthouse el peso de cada una de estas métricas queda así FCP LCP SI TTI CLS y TBT Calculadora Lighthouse Con esta herramienta puedes conocer la puntuación que obtendrías en función de los valores que introduzcas Search Console Obtienen sus datos de usuarios reales Si entramos en el detalle podemos ver exactamente quémétrica incumplimos y quépáginas se ven afectadas Web Vitals Extension Nos da los valores principales que hemos cubierto en este artículo Y muchas más 2023-05-16 07:32:13
海外TECH DEV Community Creating a Fun and Engaging Workplace - Exploring the Magic of Together Emojis https://dev.to/jaloplo/creating-a-fun-and-engaging-workplace-exploring-the-magic-of-together-emojis-1i4g Creating a Fun and Engaging Workplace Exploring the Magic of Together EmojisMicrosoft has introduced a feature that can add some fun to your workdays and those of your colleagues It s something small but can bring a lot of joy among employees We re talking about Together emojis emoticons that are meant to be used together In this article you ll read about my experience using them with my coworkers Special thanks to them for allowing me to explore this feature and see how far we can take it so far By the way the original article can be found at Celebrate success using Together Emojis in Microsoft Teams written by Sam Cundall How to use Together EmojisUsing Together emojis is incredibly simple All you have to do is navigate to a chat in Microsoft Teams and select the high five emoji Then without anyone typing anything additional a teammate needs to send the same emoji From that moment on both you and your teammate will see an animation where the two emojis give each other a high five As you can see it s a breeze to use For now it only works with this specific emoji but according to the article more emojis of this kind will be added in the future The effect still works if you send more emojis consecutively after the initial two My Personal Experience Using Together EmojisOver the past week I ve introduced the power of the high five emoji to my colleagues on various occasions and the results have been incredibly satisfying The initial reaction to the emoji is one of amusement serving as a source of playfulness and creating enjoyable moments Soon enough I could see smiles lighting up the faces of my coworkers through their chat messagesーwell at least that s how I interpreted them Once the novelty of the fun wore off we started using the emoji to celebrate successes and achievements regardless of their magnitude The important thing was to congratulate our teammates and share a collective sense of joy for a job well done Lastly I want to emphasize the boost in morale that comes from receiving and in turn sending another emoji in response to a colleague It s vital to reciprocate to foster a sense of camaraderie and this emoji effectively enhances the bond among coworkers The act of acknowledging and celebrating each other s accomplishments using these emojis creates an uplifting atmosphere and strengthens our connection as a team The Benefits of using Together EmojisWhen it comes to using Together emojis employees can reap a multitude of benefits that enhance their overall work experience Firstly these emojis foster a sense of closeness and camaraderie among colleagues By engaging in the shared experience of using these emojis employees can strengthen their bonds even in remote work settings The simple act of sending and receiving the Together emojis creates a feeling of connection breaking down barriers and promoting a more collaborative work environment Secondly these emojis bring joy fun and a positive boost to the workplace In the midst of busy workdays receiving a high five animation or witnessing the playful collision of emojis can instantly lift spirits and lighten the mood The element of surprise and delight that Together emojis bring adds an extra layer of excitement to team interactions It s a small but meaningful way to inject a dose of positivity into everyday conversations and celebrate shared accomplishments Whether it s acknowledging a job well done cheering on a colleague or simply spreading positivity these emojis serve as virtual pats on the back fostering a culture of encouragement and mutual appreciation among coworkers To wrap upIn conclusion Together emojis in Microsoft Teams offer a simple yet powerful way to enhance the employee experience and foster a positive work environment These emojis promote closeness camaraderie and collaboration among colleagues even in remote settings They bring joy fun and a sense of celebration to daily interactions uplifting spirits and injecting positivity into the workplace Whether it s acknowledging achievements cheering on teammates or spreading positivity Together emojis serve as virtual pats on the back fostering a culture of encouragement and appreciation By adding a touch of animation and celebration to chats these small gestures have a significant impact on employee engagement and team bonding So why not give your chats a high five with Together emojis and experience the positive vibes they bring to your workday References Celebrate success using Together Emojis in Microsoft Teams Don t forget to share the article with your friends and colleagues if you find it interesting click on the heart if you like it or click on the comments to share what you think of the article if you would add more or if you want to clarify any of them 2023-05-16 07:17:00
海外TECH DEV Community How I built an event ticketing system with Next.js and Firebase https://dev.to/arshadayvid/how-i-built-an-event-ticketing-system-with-nextjs-and-firebase-50l2 How I built an event ticketing system with Next js and FirebaseAfter excessive procrastination I decided to improve my developer portfolio by building real world projects that stand out from the job hunting pool Then I came up with an idea an event ticketing system In this tutorial I ll walk you through how I built an event ticketing system with Next js and Firebase Upon completion you ll be able to create advanced web applications using Firebase s amazing features like real time database authentication and file storage PS This tutorial assumes you have a basic knowledge of React or Next js Application WorkflowBefore we start coding let me summarise how the application works The application does the following authenticates users via Email and Password with Firebase allows users to create events and generate a registration link to share with friends or the public when someone registers via your invite link they receive the event ticket in their email including a passcode which you can use to verify their event ticket from your dashboard The application also allows you as a user to view the number of people who registered for your event validate an attendee s ticket via the passcode they receive and also disable the registration link when you have enough attendees You can also delete an event after it has occurred Check out the live version of the application The Design processHere I ll walk you through creating the required pages for the web application First of all you need a homepage for the application The home page should have a link where new users can create an account and another for existing users to log into their accounts Next create the sign in and sign up page In this article I ll use the Email and Password authentication method After successful login users can create new events view existing events and log out of the application on a single page called the dashboard page Next you need to allow users to view the attendees for each event disable registration validate the user s ticket at the venue and delete an event Therefore you need to create a route for each event You may adapt my method where I made each event clickable redirecting users to another page containing every detail of the particular event From the image above users can disable the registration link for the event and view and validate the attendees list Finally create the event registration page Before showing this page to a visitor you need to check if the event registration link has not been disabled After validation users should supply their name and email be added to the attendees list and receive an email containing the event details Since you ve learnt how to build the pages of the application Let s code In the upcoming sections you ll learn how to use the various features provided by Firebase What is Firebase Firebase is a Backend as a Service Baas owned by Google that enables developers to build full stack web applications in a few minutes Services like Firebase make it very easy for front end developers to build full stack web applications with little or no backend programming skills Firebase provides various authentication methods a NoSQL database a real time database file storage cloud functions hosting services and many more How to add Firebase to a Next js applicationTo add Firebase to a Next js app follow the steps below Visit the Firebase console and sign in with a Gmail account Create a Firebase project once you are signed in Select the lt gt icon to create a new Firebase web app Provide the name of your app and register the app Install the Firebase SDK by running the code snippet below npm install firebaseCreate a firebase js file at the root of your Next js project and copy the Firebase configuration code for your app into the file import initializeApp from firebase app import getAnalytics from firebase analytics const firebaseConfig apiKey authDomain projectId storageBucket messagingSenderId appId measurementId Initialize Firebaseconst app initializeApp firebaseConfig const analytics getAnalytics app Finally update the firebase js to contain some required modules for Firebase Authentication Storage and Database import initializeApp getApps from firebase app import getFirestore from firebase firestore import EmailAuthProvider from firebase auth import getAuth from firebase auth import getStorage from firebase storage const firebaseConfig lt your config gt Initializing Firebase in Next jslet app getApps length initializeApp firebaseConfig getApps Initializing the Email Password Authconst provider new EmailAuthProvider Firebase File Storageconst storage getStorage app Firebase Data Storageconst db getFirestore app Firebase Authconst auth getAuth app export provider auth storage export default db Congratulations You ve successfully added Firebase to your Next js app Next let s set up the needed Firebase features Setting up Firebase AuthenticationBefore you can add Firebase Authentication to your application you need to set it up on your console Select Build on the left hand panel and click Authentication Click the Get Started button enable the Email Password method and click Save If successful your screen should display this Setting up Firebase FirestoreSelect Firestore Database from the left hand side menu and create a database Create the database in test mode and use the default Cloud Firestore location settings After creating your database select Usage from the top menu bar edit the rules and publish the changes This enables you to make requests to the database for a longer period of time Congratulations Your Firebase Database is ready Setting up Firebase StorageSelect Storage from the left hand side menu and create the storage in test mode using the default location settings Update the timestamp for the Firebase Storage as done in the Firebase Firestore above Finally you ve set up your Firebase console Next I will walk you through how to communicate with Firebase by building the event ticketing system Communicating with Firebase Authenticating usersIn this section I ll walk you through the authentication aspect of the event ticketing system You can create a utils folder containing the functions and import them into the required components Signing up new usersThis function is executed on the SignUp page It accepts the user s email and password and creates an account with the credentials import createUserWithEmailAndPassword from firebase auth import useRouter from next router import auth from firebase const router useRouter export const firebaseCreateUser email password router gt createUserWithEmailAndPassword auth email password then userCredential gt const user userCredential user successMessage Account created router push login catch error gt console error error errorMessage Account creation declined The code snippet above accepts the useRouter hook and the user s email and password then creates an account for the user With the createUserWithEmailAndPassword function Firebase handles the authentication process If successful the user is notified and redirected to the login page otherwise displays an error message Signing in existing usersThis function allows existing users to access the application It accepts the user s email and password and returns a user object containing all the user s information import signInWithEmailAndPassword from firebase auth import useRouter from next router import auth from firebase const router useRouter export const firebaseLoginUser email password router gt signInWithEmailAndPassword auth email password then userCredential gt const user userCredential user successMessage Authentication successful router push dashboard catch error gt console error error errorMessage Incorrect Email Password The code snippet above validates the user s credentials and returns an object containing all the information related to the user If the process is successful it redirects the user to the dashboard page otherwise returns an error Logging users outFirebase also provides a signOut function that enables users to log out of the application Here is how it works import signOut from firebase auth import useRouter from next router import auth from firebase const router useRouter export const firebaseLogOut router gt signOut auth then gt successMessage Logout successful router push catch error gt errorMessage Couldn t sign out The code snippet above logs users out of the application by getting the active user s details and logging them out with the help of the signOut function Protecting pages from unauthenticated usersTo do this you can store the user s information object to a state after logging in or use the Firebase onAuthStateChanged hook Using the onAuthStateChanged hook import onAuthStateChanged from firebase auth import React useEffect useCallback from react import useRouter from next router import auth from firebase const router useRouter const isUserLoggedIn useCallback gt onAuthStateChanged auth user gt if user setUser email user email uid user uid Perform an authenticated request else return router push register useEffect gt isUserLoggedIn isUserLoggedIn The onAuthStateChanged hook checks if the user is active and returns the object containing all the user s details You can execute the function on page load for routes containing protected data Communicating with Firebase Interacting with the database and storageIn this section you ll learn how to interact with the Firestore Database by creating updating and deleting events and uploading images to the Firestore Storage Creating new eventsAfter authenticating the users they should be able to create new events via a link on the dashboard page Create a form field that accepts similar details as shown below export const addEventToFirebase async id title date time venue description note flier router gt console log id title date time venue description note flier The function above accepts all the data related to each event The id attribute in the code snippet above refers to the user s id not the event s id Adding the user s id to each event data enables you to query the events on the database via the id Since the form field in the image above accepts the event s flier via image upload Therefore you need to save the image to Firebase and attach it to the event on the database How do you do this Let s see Create a function handleFileReader within the Create Event component as done below const handleFileReader e gt const reader new FileReader if e target files reader readAsDataURL e target files reader onload readerEvent gt setFlier readerEvent target result The handleFileReader function takes an event parameter uses the FileReader object to read the image in base string format then saves it into the setFlier state Execute the handleFileReader function when the uploaded file changes lt input name flier type file className border px py px rounded md mb accept image onChange handleFileReader gt Since you ve been able to convert the file to a base string next upload the event s data to Firebase when a user clicks the Create Event button import db storage from firebase import addDoc collection doc updateDoc from firebase firestore import getDownloadURL ref uploadString from firebase storage export const addEventToFirebase async id title date time venue description note flier router gt const docRef await addDoc collection db events user id id title date time venue description note slug createSlug title attendees disableRegistration false const imageRef ref storage events docRef id image if flier null User uploaded a file else No flier uploaded From the code snippet above The addDoc function adds the event data to a newly created Firebase collection called events docRef is the event document on Firebase containing the object data I added three more properties slug attendees disableRegistration to the event document The attendees array will contain the list of people who registered for the event The slug enables us to generate a human readable URL for each event The disableRegistration attribute enables us to differentiate events accepting registration from others The imageRef variable creates a reference between the uploaded flier and the event document It establishes a one one relationship between the image and the event document Lastly since users can either choose to upload an event flier or not you need to ensure that both cases are successful Before we proceed create the createSlug function It accepts the event title and creates a human readable URL string format export const createSlug sentence gt let slug sentence toLowerCase trim slug slug replace a z g slug slug replace g return slug Finally update the conditional statement within the addEventToFirebase function Database reference to the imageconst imageRef ref storage events docRef id image if flier null await uploadString imageRef flier data url then async gt Gets the image URL const downloadURL await getDownloadURL imageRef Updates the docRef by adding the flier URL to the document await updateDoc doc db events docRef id flier url downloadURL Alerts the user that the process was successful successMessage Event created router push dashboard else successMessage Event created router push dashboard The conditional statement checks if the user uploaded an image If so it uploads the image to Firebase Storage and updates the event document with a new property called flier url The flier url property contains the image URL hosted on Firebase Storage If there is no image none of this process is required and the user gets notified that the event has been created Getting all the events created by a userOn the Dashboard page you ll need to display all the events created by the current user To do this query the events collection on Firebase and return only events whose user id attribute matches the current user s ID import collection doc onSnapshot query where from firebase firestore import db from firebase export const getEvents id setEvents gt try const q query collection db events where user id id const unsubscribe onSnapshot q querySnapshot gt const firebaseEvents querySnapshot forEach doc gt firebaseEvents push data doc data id doc id setEvents firebaseEvents return gt unsubscribe catch error console error error The code snippet above accepts the user s id filters the events via the id and returns only events whose user id attribute matches the current user Deleting eventsAllowing users to delete an event is one of the application s features The function below shows how you can achieve that import doc deleteDoc from firebase firestore import ref deleteObject from firebase storage import db storage from firebase export const deleteEvent async id gt await deleteDoc doc db events id const imageRef ref storage events id image deleteObject imageRef then gt console log Deleted successfully catch error gt console error Image does not exist The deleteDoc function deletes an event via its ID and the deleteObject deletes the flier attached to the event using the imageRef Disabling new registrationsThe application is incomplete if the user who created an event cannot disable registration for the event when the registration deadline has passed or if they have enough guests attendees import doc updateDoc from firebase firestore import db from firebase export const updateRegLink async id gt const number Math floor Math random Number MAX SAFE INTEGER const eventRef doc db events id updateDoc eventRef disableRegistration true The code snippet above accepts the event s id generates a random number and updates the event document by setting the disableRegistration property to true When users receive the invite to an event with its disableRegistration property set to true the page does not display a registration form instead it shows that registration for that event is closed Handling attendees registrationBefore you add an attendee to an event you have to do three things Fetch the event document via its ID attached to the invite link Validate the attendee s email with the existing array of attendees at the event If the email does not exist on the list add the user to the list Otherwise return an error showing that the user has already registered for the event import getDoc doc updateDoc arrayUnion from firebase firestore generates a unique passcode for the attendeeexport const generatePasscode gt Math random toString substring export const registerAttendee async name email event id gt const passcode generatePasscode const eventRef doc db events event id const eventSnap await getDoc eventRef let firebaseEvent if eventSnap exists firebaseEvent eventSnap data gets the attendees list const attendees firebaseEvent attendees filter the list const result attendees filter item gt item email email if registration is valid if result length amp amp firebaseEvent disableRegistration false adds the attendee to the list await updateDoc eventRef attendees arrayUnion name email passcode sendEventTicketViaEmail successMessage User registered successfully else errorMessage User already registered The arrayUnion function provided by Firebase enables us to push an item to an array attribute on a document The code snippet above fetches an event via its ID gets its attendees list and checks whether the user hasn t registered for the event before adding the user to the list of attendees The generatePasscode function generates a random sequence of unique numbers assigned to every user for validating each user s ticket on the event creator s dashboard On the event details page you can show the attendees list for the event and an input field that searches for attendees via their passcode Creating and sending event tickets to attendeesAfter an attendee has successfully registered for an event you need to send an email containing the event details and their passcode to the event To do this you can use a JavaScript library that supports email notifications such as EmailJS Novu and Sendgrid How to send emails via EmailJSHere I ll guide you through how you can add EmailJS to the application Install EmailJS to the Next js application by running the code below npm install emailjs browserCreate an EmailJS account and add an email service provider to your account Add an email template as done in the image below The words in curly brackets represent variables that can hold dynamic data Dear name We hope this message finds you bursting with excitement because you are about to embark on a journey like no other We are thrilled to present your personal ticket details for the most incredible event of the year Event Name title Event Description description Time time Date date Save the date PS note Please keep your invitation code secret passcode This shows you re part of the attendees DOWNLOAD EVENT FLIER flier url Congratulations You can send the event tickets using the email template above Feel free to beautify yours Sending the event tickets to attendees with EmailJSTo send the event ticket to the newly registered attendee update the if block within the registerAttendee function as done below if result length await updateDoc eventRef attendees arrayUnion name email passcode const flierURL firebaseEvent flier url firebaseEvent flier url No flier for this event sendEmail name email firebaseEvent title firebaseEvent time firebaseEvent date firebaseEvent note firebaseEvent description passcode flierURL setSuccess setLoading else setLoading false errorMessage User already registered The code snippet checks if there is no existing user with the same email before adding the new user to the attendees list If there is no flier attached to the event it takes note of that and passes all the event s information as parameters to the sendEmail function Create the sendEmail function to send the event details to the newly registered attendee s email import emailjs from emailjs browser const sendEmail name email title time date note description passcode flier url setSuccess setLoading gt emailjs send process env NEXT PUBLIC SERVICE ID process env NEXT PUBLIC TEMPLATE ID name email title time date note description passcode flier url process env NEXT PUBLIC API KEY then result gt setSuccess true Email sent error gt alert error text The sendEmail function accepts all the required parameters and sends the email using the EmailJS library ConclusionCongratulations on making it thus far You ve learntwhat Firebase is how to add Firebase to a Next js app how to work with Firebase Auth Storage and Database andhow to build an event ticketing system I ve built a live version of the application check it out The source code is also available hereFirebase is a great tool that provides almost everything you need to build a full stack web application If you want to create a full stack web application without any backend programming experience consider using Firebase Thank you for reading Open to workDid you enjoy this article or need an experienced Technical Writer React Developer for a remote full time or contract based role Feel free to contact me GitHub LinkedIn Twitter 2023-05-16 07:15:18
海外TECH DEV Community Mastering RBAC in Logto: A Comprehensive Real-World Example https://dev.to/logto/mastering-rbac-in-logto-a-comprehensive-real-world-example-43gk Mastering RBAC in Logto A Comprehensive Real World Example IntroductionAccess control and security are essential aspects of modern applications ensuring that users have appropriate access to resources Logto s Role Based Access Control RBAC offers developers an efficient way to manage access control and security in their applications In this article we ll explore the powerful features of Logto s RBAC implementation using a real world example helping you understand and apply these concepts to your projects By examining both front end and back end code snippets you ll gain a comprehensive perspective on integrating Logto s RBAC into your application stack By the end of this article you ll be well equipped to harness Logto s RBAC features to enhance your project s security and access control Try Logto Cloud Preview to implement RBAC Introducing BookHarber An Online Bookstore Use CaseTo effectively demonstrate Logto s RBAC features we ll use a real world example BookHarber an online bookstore BookHarber offers a wide range of features for customers and staff ensuring a seamless and secure shopping experience Key features of BookHarber include Browsing and Purchasing Books Users can easily search for and purchase books from a diverse collection spanning various genres and authors Order Management and Logistics Tracking Registered customers can manage their orders track shipping and receive updates on their purchases Special Offers and Holiday Activities BookHarber provides exclusive discounts and promotions during special events and holidays to engage and reward its customer base Customer Support Customers can open support tickets to address any concerns or issues they may encounter receiving prompt assistance from BookHarber staff Customer Management Staff members with different roles have the ability to manage various aspects of the platform such as customer accounts order processing and issue resolution RolesIn the BookHarber ecosystem we can identify several key user roles such as Guest Unregistered users who can browse the website search for books and view special offers Customer Registered users who can purchase books manage orders track logistics and open support tickets Store Admin Staff members responsible for overseeing the overall management and operations of the platform With full access Books Manager Staff members in charge of book and category management Customer Service Agent Staff members tasked with responding to support tickets Third Party Logistics Provider External partners responsible for managing and tracking the shipping and delivery of orders Marketing Staff Staff members responsible for promoting BookHarber responsible for managing special offers and events Designing Scopes for BookHarber REST APIsTo effectively implement Logto s RBAC system for BookHarber we need to design scopes that correspond to the various REST APIs Scopes are permissions that define the level of access a specific role has for each API endpoint By assigning the appropriate scopes to each user role we can ensure that users only have access to the actions and resources relevant to their role Let s design scopes for the following REST APIs Categories API create categories POST categorieswrite categories PUT categories iddelete categories DELETE categories idlist categories GET categoriesBooks API create books POST bookswrite books PUT books iddelete books DELETE books idlist books GET booksread books GET books idCustomers API list customers GET customerswrite customers PUT customers iddelete customers DELETE customers idread customers GET customers idOrders API create orders POST orderslist orders GET ordersread orders GET orders idwrite orders PUT orders idEvents API create events POST eventswrite events PUT events idlist events GET eventsdelete events DELETE events idOrder Tracks API read orderTracks GET orders id trackscreate orderTracks POST orders id trackswrite orderTracks PUT orders id tracks trackIdTickets API create tickets POST ticketslist tickets GET ticketsread tickets GET tickets idwrite tickets PUT tickets id Assigning Scopes to RolesNow that we have defined the appropriate scopes for each REST API we can assign these scopes to the respective user roles in the BookHarber ecosystem ScopesGuestCustomerStore AdminBooks ManagerCustomer Service AgentThird Party Logistics ProviderMarketing Staffcreate categories✓✓write categories✓✓delete categories✓✓list categories✓✓✓✓✓✓✓create books✓✓write books✓✓delete books✓✓list books✓✓✓✓✓✓✓read books✓✓✓✓✓✓✓list customers✓✓write customers✓delete customers✓read customers✓✓create orders✓✓✓✓✓✓list orders✓read orders✓✓write orders✓create events✓✓write events✓✓list events✓✓✓✓✓✓✓delete events✓✓read orderTracks✓✓✓create orderTracks✓✓write orderTracks✓✓create tickets✓✓✓✓✓✓list tickets✓✓read tickets✓✓write tickets✓✓ Understanding the Differences Between List and Read ScopesTo further illustrate the differences between list and read scopes in the context of REST API design and RBAC let s consider a real world example involving an online bookstore BookHarber Suppose BookHarber has two types of users customers and customer service agents Customers can create orders while customer service agents are responsible for helping customers with their orders Let s take a look at how list and read scopes apply to the orders API resource in this scenario List Scopes A list scope allows the user to access a collection of entities in the system For example the list orders scope permits a user to retrieve a list of all available orders In the context of BookHarber this scope could be useful for store administrators or other staff members who need to have an overview of all orders in the system However customer service agents should not be able to access the entire list of orders as their role is to assist individual customers with their specific orders Read Scopes A read scope grants the user permission to access a single entity with a given ID For instance the read orders scope allows the user to view detailed information about a specific order by its ID In BookHarber s case this scope is ideal for customer service agents who need to access information about a particular customer s order When a customer opens a support ticket the customer service agent can use the order ID provided in the ticket to access and view the details of that specific order Understanding Ownership Why Customers Don t Need Read or List Scopes for Their Own OrdersIn many applications it is common for users to have access to their own resources without explicitly granting them the corresponding read or list scopes This is because users are considered the owners of these resources and should naturally have access to them In the case of our BookHarber example customers can create orders but do not possess the read orders or list orders scopes The concept of ownership plays a crucial role in defining access control for specific resources in a REST API By acknowledging that users can always access their own resources we can implement more efficient and secure access control without granting unnecessary permissions In BookHarber s case this means that customers can still view and manage their orders without needing any additional scopes To demonstrate how this works let s consider the GET orders endpoint If a user has the list orders scope e g store administrators or staff members they will be able to view all orders in the system This provides them with a comprehensive view of the order data necessary for their role If a user does not have the list orders scope e g regular customers the system will only return the orders that belong to the user This ensures that customers can still access their order information without being granted unnecessary permissions By implementing this ownership based access control the API can provide the appropriate level of access to different user roles while maintaining security and a tailored user experience In BookHarber s scenario the ownership model allows customers to access their order information without the need for read orders or list orders scopes simplifying the access control design and enhancing the overall user experience Configuring Settings in Logto Admin ConsoleTo complete the configuration in Logto s Admin Console follow these steps Create a Single Page Application SPA for React Set up an SPA in the Logto Admin Console for your React application Create an API Resource Add a new API Resource with the identifier Define Scopes for the Resource Create the necessary scopes under the newly created API Resource Create Roles and Assign Scopes Define the user roles for your application and assign the appropriate scopes to each role Assign Roles to Users Assign the relevant roles to the users in your application ensuring that each user Especially staff member has the correct permissions based on their role Protect API using scopesIn our example project BookHarber we use Express for the backend service and React for the frontend web page This section will provide a brief overview of how we can integrate Logto s RBAC features into these popular technologies to secure our application The full doc Front endTo initialize Logto in your React application follow the documentation provided here In addition to the basic setup you will need to specify the resource and scopes in the configuration const config LogtoConfig endpoint lt your logto endpoint gt E g http localhost appId lt your application id gt resources For customer user scopes list categories list books read books create orders create tickets list events Here s an example of how to make an API request using Logto const getAccessToken useLogto const getCategories async gt const accessToken await getAccessToken const response await fetch headers Authorization Bearer accessToken const categories await response json return categories Back endTo protect API follow In addition to the example code we ll need to add the scope validation async function parseUserScope req res next const payload await jwtVerify req scopes payload scope split next function verifyScope scope return req res next gt if req scopes includes scope next else return res status json message Forbidden Insufficient scope app get tickets parseUserScope verifyScope list tickets req res gt Fetch all tickets res status json tickets app get orders parseUserScope req res gt if req scopes includes list orders const orders await getAllOrders res status json orders else const orders await getUserOrders req user id res status json orders ConclusionLogto s RBAC system is a powerful tool for managing access control and security in modern applications By leveraging Logto s RBAC features you can ensure that users have appropriate access to resources based on their roles protecting sensitive data and functionality from unauthorized access In this article we explored a real world example of an online bookstore BookHarber and demonstrated how to design scopes assign them to user roles and implement Logto s RBAC features in both the front end and back end of the application By applying these concepts and techniques to your projects you can enhance the security and access control of your applications providing a seamless and secure user experience Whether you re working on an e commerce platform a content management system or any other project requiring role based access control Logto s RBAC system offers a flexible and efficient solution to meet your access control needs Try Logto Cloud Preview to implement RBAC 2023-05-16 07:03:58
金融 日本銀行:RSS 業態別の日銀当座預金残高(4月) http://www.boj.or.jp/statistics/boj/other/cabs/cabs.xlsx 日銀当座預金残高 2023-05-16 17:00:00
ニュース BBC News - Home Ukraine war: Kyiv hit by 'exceptionally dense' missile and drone attack https://www.bbc.co.uk/news/world-europe-65606385?at_medium=RSS&at_campaign=KARANGA russia 2023-05-16 07:15:31
ニュース BBC News - Home Vodafone to cut 11,000 jobs as new boss says firm 'not good enough' https://www.bbc.co.uk/news/business-65607601?at_medium=RSS&at_campaign=KARANGA mobile 2023-05-16 07:34:13
ニュース BBC News - Home Record numbers not working due to ill health https://www.bbc.co.uk/news/business-65596283?at_medium=RSS&at_campaign=KARANGA sickness 2023-05-16 07:40:00
ニュース Newsweek 「ロシア軍は今もNATO軍の深刻な脅威」──米欧州軍司令官 https://www.newsweekjapan.jp/stories/world/2023/05/nato-64.php 2023-05-16 16:17:09
IT 週刊アスキー 新宿線・大江戸線でも運行 都営地下鉄各線が「子育て応援スペース」を設置した車両を運行中 https://weekly.ascii.jp/elem/000/004/136/4136837/ 大江戸線 2023-05-16 16:30:00
IT 週刊アスキー アポカリプスの世界で生存を目指すアプリ『マージサバイバル(Merge Survival)』配信開始 https://weekly.ascii.jp/elem/000/004/136/4136844/ mergesurvival 2023-05-16 16:20:00
IT 週刊アスキー オリックス、ビジネス書類の電子保管サービス「PATPOST」を提供開始 https://weekly.ascii.jp/elem/000/004/136/4136848/ patpost 2023-05-16 16:30:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)