投稿時間:2023-06-06 17:33:38 RSSフィード2023-06-06 17:00 分まとめ(34件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
ROBOT ロボスタ フェアリーデバイセズ、ダイキン/ヤンマー/NTTテクノクロス等から総額約21億円の資金調達 シリーズB累計調達額は31億円に https://robotstart.info/2023/06/06/fairydevices-fundraising.html フェアリーデバイセズ、ダイキンヤンマーNTTテクノクロス等から総額約億円の資金調達シリーズB累計調達額は億円にシェアツイートはてブフェアリーデバイセズはダイキン工業、ヤンマーベンチャーズ、NTTテクノクロスなどから総額約億円の資金調達を実施した。 2023-06-06 07:20:51
IT ITmedia 総合記事一覧 [ITmedia PC USER] GPD、Ryzen 7 7840Uの搭載に対応した10.1型ポータブルゲーミングPC「GPD WIN Max 2 2023」 https://www.itmedia.co.jp/pcuser/articles/2306/06/news179.html gpdtechnology 2023-06-06 16:29:00
IT ITmedia 総合記事一覧 [ITmedia News] LoRA販売も目指すAI作品投稿サイト、運営元が謝罪 「権利保護の体制が不十分だった」 https://www.itmedia.co.jp/news/articles/2306/06/news175.html itmedianewslora 2023-06-06 16:20:00
TECH Techable(テッカブル) 360度動画×自由視点動画で、生徒の集中を引き出す。映像システム活用実験の成果とは? https://techable.jp/archives/209647 amatelus 2023-06-06 07:00:17
python Pythonタグが付けられた新着投稿 - Qiita poetry update が一生終わらない時の対応方法 https://qiita.com/dokeita/items/d735d864ab9ca2309bc9 poetry 2023-06-06 16:54:02
python Pythonタグが付けられた新着投稿 - Qiita Python言語の「Paho」MQTTクライアントの使用法 https://qiita.com/EMQTech/items/2e7ebfd7d53d3210cf08 通信 2023-06-06 16:32:11
python Pythonタグが付けられた新着投稿 - Qiita 【Paiza問題集】ループメニュー1/a~zまでを表示 https://qiita.com/amron/items/ef85740e759d1beef266 paiza 2023-06-06 16:19:57
js JavaScriptタグが付けられた新着投稿 - Qiita Facebookインスタントゲーム「Fruit Paradise」開発ブログ https://qiita.com/moon_q/items/68e26a3d0bb8816a4608 facebook 2023-06-06 16:12:15
AWS AWSタグが付けられた新着投稿 - Qiita AWS認定ソリューションアーキテクト-プロフェッショナル(SAP-C02)に合格したので共有 https://qiita.com/Akihiro-K/items/c8aac51b775f79ded55c 認定 2023-06-06 16:52:03
技術ブログ Developers.IO [iPhone] 歴代iPhone早見表(2023前期現在版)を更新しました https://dev.classmethod.jp/articles/iphone_simplified_chart-2023-early/ apple 2023-06-06 07:11:32
海外TECH MakeUseOf Apple's Vision Pro AR/VR Headset: Features, Price, Release Date, and More https://www.makeuseof.com/apple-vision-pro-headset-explained/ Apple x s Vision Pro AR VR Headset Features Price Release Date and MoreApple has finally taken the wraps off its much awaited mixed reality headset But is it what we expected And what s the catch 2023-06-06 07:13:40
海外TECH DEV Community Build Custom Authentication Using Appsmith and APISIX https://dev.to/apisix/build-custom-authentication-using-appsmith-and-apisix-ep Build Custom Authentication Using Appsmith and APISIXAuthentication flow is a fundamental part of web applications It ensures the security and privacy of user data while they are using your app While there are many off the shelf authentication solutions available building an authentication system using a low code UI development platform and API management solution allows you to create secure web applications with ease You can create an application without having knowledge of both frontend and backend technologies and tools You do not need to know Python Java HTML CSS or other JavaScript frameworks In this post you ll learn how to build a custom simple login flow and pages on UI to secure your application using Appsmith Apache APISIX and JWT Appsmith is a powerful low code development platform that enables users to easily create web applications and dashboards It provides a visual interface and a comprehensive set of pre built components making it accessible to developers and non developers Learning objectivesYou will learn the following throughout the article Design an authentication process in low code environment Set up the backend authentication API with APISIX Create UI Pages using widgets in Appsmith Enable token based authentication Design the Authentication ArchitectureBefore diving into implementation it is important to first design the architecture of your authentication system for your application Consider the key components such as user registration login password session management and JWT token based authentication Define the flow of information between Appsmith and APISIX ensuring a clear and efficient authentication workflow We are going to build a simple mobile app that has pages Registration Login and Main pages respectively Tasks we do divide into two parts In the first part We will set up the backend API with Apache APISIX API Gateway that will handle authentication requests We use existing API Gateway endpoints to achieve user registration login and token generation flows In the second part we use Appsmith s drag and drop interface with ready UI components to build the Registration Login and Main pages and finally we connect them to API to handle form submissions Let s start with building these components in the following sections Part Set Up the backend authentication APIWe start by setting up the backend API that will handle authentication requests from the mobile app APISIX can be utilized to enforce authentication to protect API endpoints APISIX allows you to validate user credentials issue authentication tokens and control access to your APIs By integrating APISIX into your mobile authentication system you can add an additional layer of security and ensure that only authenticated users can access your protected resources PrerequisitesDocker is used to installing the containerized etcd and APISIX curl is used to send requests to APISIX Admin API You can also use tools such as Postman to interact with the API Step Install Apache APISIXAPISIX can be easily installed and started with the following quickstart script curl sL sh Step Configure the backend service upstream Next we configure our backend service For demo purposes it can be any API service that serves our backend logic You can replace it with your service too I use a mock public server that randomly generates responses For simplicity we will have a single endpoint that returns the public IP address of our machine in this endpoint To route requests to the backend service for the mock API you ll need to configure it by adding an upstream server in Apache APISIX via the Admin API curl apisix admin upstreams X PUT d name Mock API upstream desc Register Mock API as the upstream nodes httpbin org Step Create a new plugin configThis step involves configuring a plugin using the Plugin Config object for a route we create in the next step So APISIX enables the JWT plugin to secure our endpoints Each time we request the endpoint it checks JWT credentials in the request header curl apisix admin plugin configs X PUT d plugins jwt auth Step Create a Route for the backend APIWe create a new Route object in APISIX that intercepts all GET requests to ip URI and uses the existing upstream and plugin configurations to enable the routing mechanism and authentication policies It checks for the JWT plugin in the header and if it exists and valid forwards the request to our mock server Otherwise it returns an unauthorized error immediately and the request will not reach the actual service curl i apisix admin routes X PUT d name Mock API server route desc Create a new route in APISIX for the mock server endpoint methods GET uri ip upstream id plugin config id Step Create a Route for signing the JWT tokenWe implemented token based authentication for our API APISIX can also act as an identity provider to generate and validate tokens To do so you need to set up a Route for a new API endpoint that signs the token using the public api plugin curl apisix admin routes login X PUT d uri login plugins public api uri apisix plugin jwt sign By executing the above curl command we registered a new route called login with the URI path login that signs a new token whenever an existing user attempts to log in from the Login page on the mobile app using their emails Part Create User Registration and Login Forms in AppsmithUsing Appsmith s low code interface we can create user registration and login forms Appsmith provides a wide range of pre built widgets that can be easily customized Design the forms with input fields for username password and any additional information you require in the dashboard Before you beginI am going to miss the installation part of Appsmith on your machine You can learn how to install Appsmith using Docker on the Appsmith website Make sure that you installed Appsmith and you can access it at http localhost When you deploy and run Appsmith an application titled My first application is added by default You can use this application to build your first app Step Create a Registration pageIn our case a new user first registers on a mobile app from the Registration page Start by creating a new page called RegistrationPage in your application Add Input widgets for email named EmailInput username named UsernameInput and password PasswordInput Also add Register named RegisterButton and Login named LoginButton Button widgets to the drawing board The final result looks like below When a user presses the Register button with provided input details you ll need a query to handle communication with the APISIX Admin API endpoint to register a new API consumer in the API Gateway Create an API query  named APISIX Admin Add Consumer API with APISIX consumers endpoint URI apisix admin consumers Place the Input widgets text into your query body Accessing the Input widgets should look something like this Note that we use the address of host docker internal instead of localhost because APISIX is running inside its own container on a different docker network than Appsmith After the query is sent to APISIX it registers the new consumer and the consumer object will use jwt authplugin with key and secret You can test if the consumer is registered in the system successfully but fetching the specified consumer by username appsmithuser Run this curl command curl apisix admin consumers appsmithuserWhile existing users can go directly to the Login page See in the next section Step Create a Login pageBack on the application canvas add a new page called Login page and set up the Login form s with Input for entering the user s email and Button for login widgets Then create an API query  named login api for for APISIX login route URI path login and set key param to EmailInput text If you test the query and push the run button on a successful response our authentication API Gateway endpoint should return a valid access token In the example below the jwt key is a token that indicates that the user has been authenticated on the APISIX side To run the login api query via the Login button you need to set the query onClick property It is also possible to store the JWT token in the Appsmith store and then take the user to the MainPage To do so insert the below code to the login api action of Login page in the onClick property login api run gt const jwt login api data if jwt storeValue jwt jwt navigateTo MainPage else showAlert Login failed error If the user fails to authenticate with APISIX show an alert message as a callback to tell the user that there was an error Step Create a Main pageFinally now it s time to configure the MainPage of the mobile app to allow access to logged in users and show some data You can use the same canvas to build your UI from widgets Once the user successfully logged in our logic navigates to MainPage and on the first page load it makes an API call automatically to the route ip in APISIX using the query you add named main page data api and retrieves the IP address from the upstream server we created in Part and at step You may notice in the Authorization header the value appsmith store jwt the jwt value that we saved in the Appsmith store in the previous step which is used to prove to your application that the user is recognized If the jwt value does not exist in the Appsmith store we show an unauthorized error to the user In my case I added two Text widgets to the MainPage and set the text field value of the second to main page data api data which is simply output data from main page data apicall See the result Next stepsYou can also add one Unauthorized page for redirecting unauthorized users to that page show the error and suggest they log in or register to create a new account Provide your users with the ability to log out of your app with a button widget when they re finished which can help increase the security of your data ConclusionBy following the above steps we created the personalized authentication system using Appsmith and APISIX Appsmith is suitable for a wide range of use cases from building internal tools and admin dashboards to prototyping and developing full fledged applications With APISIX you can not only enforce authentication for your users but also introduce additional security measures such as rate limiting IP blocking and consumer restriction to maintain the security of our custom authentication solution Related resourcesAPI Gateway Authentication Apache APISIX Authorization Policy Protect Your APIs Deep Dive into Authentication in Microservices Community Join the Apache APISIX Community Follow us on Twitter Find us on Slack How to contribute page About the authorFollow me on Twitter BoburUmurzokovVisit my blog  www iambobur com 2023-06-06 07:39:55
海外TECH DEV Community Testing IaC Scripts 🧪 https://dev.to/jessica_veit/testing-iac-scripts-41cl Testing IaC Scripts Lack of testing can introduce defects in IaC scripts which in turn can have serious conse quences A synthesis of IaC testing practices can be helpful for practitioners to mitigate defects in IaC scripts Hasan et al Although IaC is more and more adopted by various companies in their operation process and integrated in many cloud providers using APIs the quality assurance and maintenance of the scripts created still has to undergo further research and development to achieve a certain level of quality in form of system security and resilience Because of the undeniable importance of this topic IaC providers like Terraform and Pulumi external companies like Snyk and Gruntwork as well as cloud providers like Azure and AWS are currently working on improving the development conditions with IaC Testing Guidelines Provided by IaC ProvidersStarting with the most well known IaC provider HashiCorp Terraform provides documentations and guidelines describing how to implemented unit and snapshot testing capabilities in their developer documentation Other than that there is an experimental feature related to module testing and community content for integration tests such as shown by the Github User Ansgarm As for Pulumi documentations for unit property and integration tests are available Testing in Terraform Testing in Terraform heavily depends on the language that was used to write the Terraform code itself When using HCL for example the testing framework to favour is Jest by Facebook which provides testing capabilities to JavaScript and TypeScript yet is still compatible with Terraform It was included in version for snapshot tests and assertions An important factor is the existence of the so called cdktf Cloud Development Kit for Terraform package for the testing framework at use This package provides an interface for interacting with the Terraform framework itself When writing common unit test assertion statements in TypeScript a so called synthScope is used to test part of the application It returns a JSON string representing the synthesized HCL JSON on which assertions can then by applied This way important assertions such as toHa veResource whether a resource of a certain type exists and toHaveResourceWithProperties can applied Testing in Pulumi To get a broader view on common or experimental testing techniques for IaC tools in general Pulumi will also be considered in this series It provides the same base functionality as Terraform however in addition to unit and integration tests Pulumi provides the concept of so called Property Test which are used to assert properties on a resource level while infrastructure is being deployed The key difference between the three testing techniques documented are illustrated below Key differences of testing styles documented by PulumiWith each of the techniques a specific point in time of the infrastructure can be tested The unit tests are mostly mock based implemented meaning the engine normally used for the deployment of Pulumi is replaced by a mock thus removing the need for out of process calls and increasing isolation Property testing can be seen as a form of policy as code to ensure that the deployed infrastructure complies with desired policies Finally the integration tests are labelled as deploy check destroy tests by Pulumi as they deploy cloud resources and validate their actual behav ior Next Steps 🪜After discussing the testing approaches suggested by the two IaC providers Terraform and Pulumi in the next post we will take a look at the dedicated IaC testing providers takes on this topic Here we will have a look at Gruntwork and Snyk So stay tuned if you are interessted Cover Image by Martin Lopez 2023-06-06 07:18:52
海外TECH DEV Community Building an event ticketing application with Next.js and Appwrite https://dev.to/arshadayvid/building-an-event-ticketing-application-with-nextjs-and-appwrite-7m Building an event ticketing application with Next js and AppwriteRecently I built this application using Next js and Firebase Then after learning about Appwrite Cloud and the ongoing hackathon on Hashnode I thought to myself why not give it a shot In this article I ll walk you through how I built an event ticketing application with Next js and Appwrite Cloud If this is your first time using Appwrite don t worry you are in good hands Upon completion you ll be able to create advanced web applications using some of the features provided by Appwrite like authentication database and file storage PS This tutorial assumes you have a basic knowledge of React or Next js How the application worksBefore we start coding let me summarise how the application works The application does the following authenticates users via Email and Password with Appwrite 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 UI 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 Appwrite What is Appwrite Cloud Appwrite is a powerful open source backend platform that enables you to create secured and scalable web and mobile applications With Appwrite you don t need to worry about the backend resources of your application because with Appwrite you Build Fast Scale Big All in One Place Instead of setting up your backend server on your computer  Appwrite Cloud enables you to focus on developing your applications while it manages crucial backend functionalities such as user authentication database management file storage and more How to add Appwrite to a Next js appTo add Appwrite to a Next js app follow the steps below First of all create a Next js project by running the code below npx create next app event ticketing appVisit Appwrite s website and create a new account Create a new organisation and project Each project contains all the resources you need to build a fully functional application with Appwrite Next you need to choose where and how you want to use Appwrite either as a web or mobile SDK or you need to integrate it with your existing server Since we are building a Next js app with Appwrite Cloud select Web App from the SDK Platform menu and register a new app under the project From the image below I provided a name for the application and used an asterisk as the hostname After deploying the application on Vercel you can change the hostname to the URL provided by Vercel Install the Appwrite Node js SDK into your Next js project as done below npm install appwriteCreate a env local and appwrite js file at the root of your project touch appwrite js env localCopy the code below into the appwrite js file import Client Account Databases Storage from appwrite const client new Client client setEndpoint setProject process env NEXT PUBLIC PROJECT ID export const account new Account client export const db new Databases client export const storage new Storage client The code snippet above enables us to access and interact with the authentication database and file storage features provided by Appwrite Copy the code below into the env local file NEXT PUBLIC PROJECT ID lt your project id gt NEXT PUBLIC DB ID lt your database id gt NEXT PUBLIC EVENTS COLLECTION ID lt your events collection id gt NEXT PUBLIC BUCKET ID lt your file storage bucket id gt The code snippet above contains environment variables containing all the private keys needed for interacting with Appwrite Cloud On your project dashboard click the Project ID button to copy your project s id and paste it into the env local variable Setting up Authentication with Appwrite CloudSince you are using the Email and Password authentication method you don t need to add any configurations on Appwrite Cloud before using the service because it has been configured by default However let s add an extra layer of security to our project by updating the default Session length Select Auth from the sidebar menu and switch to the Security tab Scroll down to the Session Length section and change it from days to hour Users will need to be re authenticated after an hour of using the application and in case a user doesn t log out of our application they are logged out automatically after an hour Click Update to add the new setting and you re ready to go Setting up the Appwrite DatabaseHere you ll learn how to set up the database on Appwrite Cloud Select Database from the sidebar menu to create a new database Copy the database ID and paste it into the env local file then create a new collection called events A database collection contains documents that is items with the same attributes or column properties A database collection is similar to a table in relational databases Setting up file storage with Appwrite Cloud StorageSelect Storage from the sidebar menu and create a new bucket for the event fliers Users will be able to upload their event fliers when creating an event Copy the bucket ID and paste it into the env local file Congratulations you ve set up the required backend features Next I will walk you through how to communicate with Appwrite by building the event ticketing system Authenticating users with Appwrite CloudIn 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 mkdir utilscd utilstouch functions jsAdd the following imports into the file to enable us to interact with the backend features We ll make use of them in the upcoming sections import account db storage from appwrite import ID Query from appwrite Signing up new usersThis function is executed on the SignUp page It accepts the user s name email and password and creates an account with the credentials export const signUp async name email password router gt try await account create ID unique email password name successMessage Account created router push login catch err errorMessage Check your network User already exists router push login The code snippet above accepts the useRouter hook and the user s credentials then create an account for the user The account create method is the keyword provided by Appwrite to handle the account creation 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 export const logIn async email password router gt try await account createEmailSession email password successMessage Welcome back router push dashboard catch err console error err errorMessage Invalid credentials The code snippet above validates the user s credentials and creates an active session for the user If the process is successful it redirects the user to the dashboard page otherwise returns an error Logging users outAppwrite also provides an account deleteSession method that enables users to log out of an ongoing session export const logOut async router gt try await account deleteSession current router push successMessage See ya later catch err console error err errorMessage Encountered an error The code snippet above deletes the user s current session and redirects the user to the application s home page Protecting pages from unauthenticated usersTo do this you can store the user s information object to a state after logging in or use Appwrite s account get method Using the account get method export const checkAuthStatus async setUser setLoading router gt try const request await account get setUser request setLoading false catch err router push The code snippet above gets all the information related to the currently signed in users It 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 such as the Dashboard View Event Details and Create Event routes Communicating with Appwrite Cloud Interacting with the database and storageIn this section you ll learn how to interact with the Appwrite Database by creating updating and deleting events and also uploading images to File Storage Creating new eventsAfter authenticating the users they will be able to create new events via the New link on the dashboard page Therefore create a route containing a form that accepts the following details as shown below export const createTicket 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 us to query events created by a particular user Also since the form field in the image above accepts the event s flier via image upload you need to save the image to Cloud Storage and attach it to the event s document on the database How do you do this ‍ ️First add the event s attribute to the event document on Appwrite Cloud Select the events collection and click on the Attributes tab Add all the event s attributes as shown below Next click on the Settings tab and update the permissions The image above shows that anyone can read and update the event document but only authenticated users can create and delete an event because an event s attendee does not need to be a user before registering for an event Therefore this enables us to add each attendee s information to the attendees array and also allows them to read the details about the event Finally update the Permissions for the bucket storage From the image above anyone can view the flier for each event and only users can create read and delete the fliers from the bucket The Codeexport const createEvent async id title date time venue description note flier router gt const createDocument async flier url gt try const response await db createDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID ID unique user id id title date time venue description note slug createSlug title attendees disableRegistration false flier url successMessage Ticket created router push dashboard catch error console error DB ERROR gt gt error errorMessage Encountered an error if flier null try upload image and ticket details else await createDocument From the code snippet above The nested function createDocument accepts all the event s attributes and creates a new document on the Appwrite Cloud Since uploading a flier is optional the flier url attribute has a default URL value 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 Lastly since users can either choose to upload an event flier or not you need to ensure that both cases are successful Hence the createDocument function is executed when a user does not upload any image In this case it will use the default flier URL 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 createEvent function if flier null try const response await storage createFile process env NEXT PUBLIC BUCKET ID ID unique flier const flier url process env NEXT PUBLIC BUCKET ID files response id view project process env NEXT PUBLIC PROJECT ID amp mode admin calls createDocument function await createDocument flier url catch error console error STORAGE ERR gt gt gt error errorMessage Encountered an error saving the flier else await createDocument The code snippet above checks if the user uploaded a flier for the event If yes the function adds the file to the bucket on the Cloud Storage then passes the file s URL on the Cloud into the createDocument function This ensures that each document has a link to its flier Getting all the events created by a userOn the Dashboard page you need to display all the events created by the current user To do this query the events collection and return only events whose user id attribute matches the current user s ID Select the Indexes tab under the Database section and create a new index using the user id attribute Now we can make a function call to request the tickets created by a particular user as shown below const getTickets async id setEvents setLoading gt try const request await db listDocuments process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID Query equal user id id setEvents request documents setLoading false catch err console error err The code snippet above queries the list of events on the Appwrite Cloud and returns only events whose id matches the current user The events are then displayed on the Dashboard page Deleting eventsAllowing users to delete an event is one of the key features of the application The function below shows how you can achieve that export const deleteTicket async id gt try get s the event s document const getDoc await db getDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID id if getDoc flier url deletes event s document await db deleteDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID id else extracts image ID from flier URL const fileID extractIdFromUrl getDoc flier url deletes event s image from the bucket storage await storage deleteFile process env NEXT PUBLIC BUCKET ID fileID deletes event s document await db deleteDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID id successMessage Ticket deleted catch err console error err Failure errorMessage Action declined From the code snippet above The function gets the document to be deleted via its ID Then checks if the flier url is set to the default value meaning if the event does not have a flier image If it doesn t have a flier it deletes the entire document If the event document has a flier url different from the default value It extracts its flier from Cloud Storage and deletes both the event document and its image the event s flier The extractIdFromUrl function extracts the flier s ID from the flier s URL attribute to enable us to delete both the event s image and document from Appwrite Cloud const extractIdFromUrl url gt const regex files const match url match regex return match match null Disabling new registrationsThe application is incomplete if a user cannot disable the registration for an event when its deadline has passed or if they have enough guests attendees export const disableRegistration async documentId gt try await db updateDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID documentId disableRegistration true successMessage New registration disabled catch err console error err Failure errorMessage Encountered an error The code snippet above accepts the event s id and updates the event document by setting the disableRegistration property to true When users receive an event invite with its disableRegistration attribute set to true the page does not display a registration form instead it shows that the 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 export const registerAttendee async name email documentId gt generates random string as ID const attendeeID Math random toString substring try const doc await db getDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID documentId const JSONattendees doc attendees const attendees JSONattendees map parseJSON const result attendees filter item gt item email email if result length await db updateDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID documentId attendees doc attendees JSON stringify name email id attendeeID sendEventTicketViaEmail else errorMessage User already registered catch err console error err Failure errorMessage Encountered an error converts JSON attendee string to an array of JavaScript objectsexport const parseJSON jsonString gt try return JSON parse jsonString catch error console error Error parsing JSON error return null The code snippet above fetches an event via its ID gets its attendees list and converts it from a JSON string to JavaScript Then checks whether the user hasn t registered for the event before adding the user to the attendees list Each attendee is assigned an ID The attendee s id name and email are added to the attendees attribute of the event as a JSON string On the event details page you can show the attendees list for the event and an input field that search for attendees via their id 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  Sendgrid etc 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 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 db updateDocument process env NEXT PUBLIC DB ID process env NEXT PUBLIC EVENTS COLLECTION ID documentId attendees doc attendees JSON stringify name email id attendeeID const flierURL doc flier url doc flier url No flier for this event sendEmail name email doc title doc time doc date doc note doc description attendeeID flierURL setSuccess setLoading else 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 send email via EmailJSconst sendEmail name email title time date note description passcode flier url setSuccess setLoading gt emailjs send process env NEXT PUBLIC EMAIL SERVICE ID process env NEXT PUBLIC EMAIL TEMPLATE ID name email title time date formatDate date note description passcode flier url process env NEXT PUBLIC EMAIL API KEY then result gt setLoading false setSuccess true error gt errorMessage 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 Appwrite is how to add Appwrite to a Next js app how to work with Appwrite Cloud Authentication 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 hereAppwrite 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 Appwrite Cloud 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-06-06 07:12:24
海外TECH Engadget Microsoft will pay the FTC $20 million to settle charges over collecting children's data https://www.engadget.com/microsoft-will-pay-the-ftc-20-million-to-settle-charges-over-collecting-childrens-data-074602067.html?src=rss Microsoft will pay the FTC million to settle charges over collecting children x s dataMicrosoft will have to pay million to settle charges brought by the Federal Trade Commission FTC that the company violated the Children s Online Privacy Protection Act COPPA In the complaint filed by the DOJ on behalf of the FTC the department accused the tech giant of collecting its underage Xbox users information and retaining their data even without their parents consent To be able to play Xbox games and use services like Xbox Live users have to sign up for an account and provide their personal information including their full name email address and place of birth Until users were also asked for their phone number and to agree to Microsoft s advertising policy The FTC found that Microsoft only asked users under to get their parents to complete their account creation after they had already provided their personal information And apparently from until Microsoft collected and retained data from underage users even if their parents didn t complete the registration process Under COPPA online services and websites must obtain verifiable parental consent before using any personal information from children The FTC also explained that Microsoft combines a user s gamertag with a unique persistent identifier that it could share with third party developers even for accounts owned by underage users In a blog post Dave McCarthy the CVP Xbox Player Services said Microsoft didn t intentionally keep child accounts that weren t completed by their parents The company found a technical glitch that caused data retention during its investigation he said and its engineering team deleted affected children s data after fixing the issue quot The data was never used shared or monetized quot he added In addition to paying million to settle the FTC s charges Microsoft will also be required under the DOJ s proposed order to change its account creation process for underage users The tech giant has already updated the process so that it asks somebody s date of birth first and if needed ask for parental consent before it requires users to key in any other identifiable information It will also ask users under the age of who created an account before May to have their parent reverify their account over the coming months nbsp The FTC requires Microsoft to establish a system that would delete all the personal information it collects from kids within two weeks if their parents don t complete their account creation as well Plus it wants the company to notify video game publishers if the personal information shared is from a child so that it can protected by COPPA While Microsoft has already implemented changes to its sign up process the proposed order must still be approved by a federal court before it can go into effect nbsp This article originally appeared on Engadget at 2023-06-06 07:46:02
海外科学 NYT > Science Seven Underappreciated Birding Spots in New York https://www.nytimes.com/2023/06/06/science/new-york-city-birding.html locations 2023-06-06 07:00:35
医療系 医療介護 CBnews 分子標的治療薬耐性化の原因と克服方法を示す-愛知県がんセンターが研究グループの成果発表 https://www.cbnews.jp/news/entry/20230606161651 分子標的治療 2023-06-06 16:45:00
医療系 医療介護 CBnews ワクチン副反応やマスク外すことへの不安も-厚労省が精神保健福祉センターの対応状況を公表 https://www.cbnews.jp/news/entry/20230606155829 電話相談 2023-06-06 16:15:00
ニュース BBC News - Home Children's doctors call for ban on disposable vapes https://www.bbc.co.uk/news/health-65809924?at_medium=RSS&at_campaign=KARANGA disposable 2023-06-06 07:23:46
ニュース BBC News - Home Sue Gray could start work for Labour in autumn https://www.bbc.co.uk/news/uk-politics-65819057?at_medium=RSS&at_campaign=KARANGA starmer 2023-06-06 07:48:54
ニュース BBC News - Home CBI: Business group giant faces crunch vote to survive https://www.bbc.co.uk/news/business-65809060?at_medium=RSS&at_campaign=KARANGA lobby 2023-06-06 07:29:12
ニュース BBC News - Home Ukraine war: What we know about Khakovka dam attack https://www.bbc.co.uk/news/world-europe-65818705?at_medium=RSS&at_campaign=KARANGA kherson 2023-06-06 07:19:41
ビジネス ダイヤモンド・オンライン - 新着記事 アップルの「Vsion Pro」 WSJ記者が試してみた - WSJ発 https://diamond.jp/articles/-/324085 vsionpro 2023-06-06 16:13:00
ビジネス プレジデントオンライン 櫻井翔にコメントさせて、藤島ジュリー景子社長は隠れたまま…「ジャニーズ帝国」が野放しのままでいいのか - テレビ局がジャニーズ事務所に忖度する本当の理由 https://president.jp/articles/-/70375 藤島ジュリー景子 2023-06-06 17:00:00
ビジネス プレジデントオンライン 櫻井翔にコメントさせて、藤島ジュリー景子社長は隠れたまま…「ジャニーズ帝国」が野放しのままでいいのか - テレビ局がジャニーズ事務所に忖度する本当の理由 https://president.jp/articles/-/70293 藤島ジュリー景子 2023-06-06 17:00:00
ビジネス プレジデントオンライン 「最悪の職場」でもすぐ辞めてはダメ…ひろゆきが「新卒1年目の若者」にどうしても伝えたいこと - 日本において「新卒カード」は非常に強い https://president.jp/articles/-/70222 若者 2023-06-06 17:00:00
IT 週刊アスキー かわいいパッケージでギフトにもおすすめ ヒトツブカンロ「ピュレショコラティエパーティBOX」販売中 https://weekly.ascii.jp/elem/000/004/139/4139783/ 商品 2023-06-06 16:45:00
IT 週刊アスキー TVアニメ「お隣の天使様にいつの間にか駄目人間にされていた件」初となるイベント、ベルサール新宿グランドにて開催 https://weekly.ascii.jp/elem/000/004/139/4139793/ 駄目 2023-06-06 16:40:00
IT 週刊アスキー 日本各地の絶品スイーツが並ぶ 京王百貨店 新宿店「デパ地下スイーツマルシェ」6月14日まで開催中 https://weekly.ascii.jp/elem/000/004/139/4139779/ 京王百貨店 2023-06-06 16:30:00
IT 週刊アスキー ケムコの『ゾンビ・オブ・ザ・ドット』が家庭用機やSteamで配信決定! https://weekly.ascii.jp/elem/000/004/139/4139811/ nintendo 2023-06-06 16:20:00
IT 週刊アスキー 『PSO2 NGS』開発の裏側を紹介するショート動画が公開中! https://weekly.ascii.jp/elem/000/004/139/4139805/ makingof 2023-06-06 16:15:00
IT 週刊アスキー タヒチをイメージしたパンが主役 ヒルトン東京にてアフタヌーンティー「ティアレ・タヒチ」開催 https://weekly.ascii.jp/elem/000/004/139/4139765/ zatta 2023-06-06 16:10:00
マーケティング AdverTimes ChatGPT活用しサントリーがWebCM制作 AI部長が修正案を提案 https://www.advertimes.com/20230606/article422238/ chatgpt 2023-06-06 07:56:00
海外TECH reddit ask for the number of the waitress/ barista https://www.reddit.com/r/japanlife/comments/1427d0w/ask_for_the_number_of_the_waitress_barista/ ask for the number of the waitress baristaI ve been living here and I m going to a cafe that I like and when I order I sometimes talk a bit with the barista quick exchanges with smiles etc I wanted to know if it s bad perceived to give ask number to an employee in these cases This question isn t especially about living in Japan but more about the perception of this in comparison to the US Europe so I don t seem rude Thanks submitted by u Nefarx to r japanlife link comments 2023-06-06 07:18:20

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

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

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