api design – Is it a bad practice to have one API route that can serve both private and public resources conditionally with an optional authorization?

Let’s say I’m making a platform like Linkedin. The platform let you upload your business detail.

All public visitors can go to your business page and view public information such as name and description.
But, if you are the owner, you can also see additional private information such as your Sales figure, Invitations, etc on that same page

To do that, I make a route which gets the detail of a particular business (GET /businesses/:id)

This API has a authorization middleware that, for example, check whether you have a valid JWT to prove your identity.

If the JWT is incorrect or absent, the API only fetches and returns public information of that business.
However, if the JWT is correct, it fetches additional information including all public and private detail of that business.

So, my question is, how serious are the disadvantages of using the same API route with conditional authorization? (maintainability/testability/security?)

Do I need to separate this into two different routes?

What are some existing design methodology for safety-critical software systems?

For example, software systems used in surgical equipment, space systems, vehicle embedded systems, these systems involve human lives. I know about TDD and used it sometimes. TDD is just part of the implementation process that couples testing with development. And there’s MISRA in automotive industry, but it’s also just a tool that’s part of the development. What are some existing design methodology for safety-critical software systems, starting from requirements to implementation and testing?

database design – MySQL: Is it best practice to check whether some column is NULL by `NOT ISNULL(column_name)`?

Given the following schema, my question is that since I have already added the NOT NULL to IsBanned, would I have to check whether it is not null using the syntax NOT ISNULL(IsBanned)? And what’s the best practice to do the same if I didn’t add NOT NULL?

CREATE TABLE Viewer (
    AccountID varchar(25),
    IsBanned boolean                NOT NULL
                                    DEFAULT 0,
    ...
    CHECK                           (NOT ISNULL(isBanned)),
);

As you can see I

database design – MySQL: Should I add NOT NULL UNIQUE to the field for primary key?

Hi I’m completely new to MySQL, I’m creating a database and my question is that:

Should I add NOT NULL UNIQUE to the field for primary key?

For example I have:

CREATE TABLE Account (
    AccountID varchar(25) NOT NULL,
    ...
    PRIMARY KEY(AccountID)           // <------- (*)

I’m thinking about whether the (*) would implicitly mark the field as UNIQUE NOT NULL.

Btw, could anyone provide good resources about best practices of MySQL(I’m currently interested about creating table) so I won’t add redundant restriction(s) in any schema.

interaction design – ‘Add to Favorites’ state change immediately or wait for backend confirmation?

Optimistic updates can go wrong too, what if the network request takes time, and use closes the browser or leaves the site and thinks the interaction was successful because of the visual feedback he received?
In my opinion the best practice, for important interactions, is to use some transition that gives feedback on click, but does not hide the pending state in case it takes more than a second or two.
For low-importance interactions, like rating something or clicking ‘like’, the impact of errors is smaller, so optimistic updates are more ok.

mongodb – DB Design: Tutor booking system

Overview

The system should allow users (tutors in this case) to add their own availability time slots. For example, a tutor says that s/he is available this specific week on Thursday from 5.30pm to 6.30pm, then from 8pm to 9pm. For simplicity, the duration of the availability == the duration of the session that may or may not be booked by a tutee.

Each tutor is assigned to specific courses and the tutor’s availability should show for all the classes s/he is assigned to.

Tutors also have access to their calendars where they see all the availability they have added for a specific week, and can either delete or modify some, and of course add new ones.

The application is small to medium.

Scenario

When a tutee navigates to a course page, s/he looks at all available tutors and their corresponding time slots, chooses the suitable timeslot, provides some details about the session (specific chapter, etc.), then submit his/her request. On server-side, a session is created according to the timeslot, and the timeslot is flagged as booked.

Models

I am using MongoDB + mongoose. This is what I have so far:

const course = new mongoose.Schema({
  tutors: ({ type: mongoose.Schema.Types.ObjectId, ref: 'User' }),
  title: String,
  description: String,
})

const availability = new mongoose.Schema({
  user: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
  booked: Boolean,
  startTime: Date,
  endTime: Date
})

There are some corner cases that made me wonder whether I’m on the right track or not. For example, if a tutee books a session based on a specific availability, that availability is flagged as booked. All it takes for the tutor to appear available again is for him/her to delete the availability, then add a new one again at the same time. We would end up with 2 sessions taking place at the same time, which is not accepted. Of course I can add a unique index on the start and end times, but overlapping sessions/availability are also a problem.

What do you think about this design? Do you see any potential limitations/problems with this design? Is there anything you would do differently? Do those corner cases stem from a bad design, or there isn’t much that can be done for that other than application level checking?

I tried looking for similar problems but couldn’t really make strong correlations between my case and the generic hotel/room/booking reservation systems.

Thank you.

sharepoint online – Site Design that can run Apply-PnPProvisioningTemplate?

Trying to setup easy process for client to rollout Sharepoint sites using GUI ‘Site Designs’ feature. General task I am trying to accomplish is this: Want to make custom Site Design where sitescripts can apply branding, HUB association, Theme, etc. Then want the custom site design to apply a PnP Provisioning Template (which would be an already uploaded .pnp file), which would build out the footer links, create a templated home page, and even upload some image assets.

I have created a ton of custom site designs and also have a good process for creating and then applying the .pnp file. Separately, these work fine. The issue, however, is to create the ‘content’ side of this ‘2 part’ rollout site. The site design portion is very user friendly and would give the client an easy (infallible) way to quickly make a new communications site with everything they want. In order to include the pre-configured home page or the footer links they want standardized, though, I need to run a PowerShell command to ‘apply-pnpprovisioningtemplate’, and I would like to be able to ‘run this command’ automatically with the site design.

I am not a PowerShell expert, but have some ideas that I am literally pulling out of thin air that I wanted to see if had any merit?

Through an additional sitescript in the site design, is there a way to run PnP cmdlets (similar to a .ps1 file) where it could run the ‘Connect-PnPOnline’ cmd & ‘Apply-PnPProvisioningTemplate’?

We have no Azure hosting plan so can’t use that, but could something be done with PowerAutomate?

I will modern Powerpoint presentation template design ppt slides for $3

I will modern Powerpoint presentation template design ppt slides

Hello! I will make unique professional PowerPoint presentation modern template ppt slides design.

*** UNDER 15 HOURS express delivery available ***

Features of my gig:

  • I will provide custom Powerpoint design.
  • You will get high quality images & animations for free.
  • You will get fully editable PPT file with PDF & High-Quality Image.

What should you know about my work?

  • I am a professional presentation creator.
  • I have more than 5 years’ experience.
  • I also try to deliver my work as soon as possible.

❤ Please contact me before placing your order ❤

thanks

.

Are design patterns built upon design principles?

Are the following statements correct?

  1. Design patterns are some techniques that follow design principles.
  2. Design principles are the underlying principles of design patterns.
  3. They are different things, totally unrelated.

I think at least the state pattern is somehow related to the open-closed principle.

game design – Why Beat ’em Ups don’t allow players to face toward or away from the screen

Most Beat ’em Ups don’t allow players to face away or towards the screen: example, in Streets of Rage, when you press up, the character moves up but still facing either left or right and same goes when you press down. Even in modern Beat ’em Ups, this is the case. What is the reason for this? I used to think this is because the graphics are 2D so its harder or more work to get characters to face towards or away from the screen. But even in Beat ’em Ups that uses 3D graphics, this is still the case, like Double Dragon Neon.