jun4928 / user-management Goto Github PK
View Code? Open in Web Editor NEWbackend system to manage user data in the automotive industry
backend system to manage user data in the automotive industry
type User = {
id: number
name: string // unique
password: string
}
create-user.service
type Input = {
name: string
password: string
}
type Output = Promise<User>
authenticate-user.service
type Input = {
name: string
password: string
}
type Output = Promise<User | null>
export type CreateUserData = Omit<User, "id">
export interface UserDatabase {
create(user: CreateUserData): Promise<User>;
getOne(name: string, password: string): Promise<User | null>;
}
below APIs need user authentication first,
type Vehicle = {
id: number
brand: string
model: string
year: number
}
get-users-vehicles.service
type Input = {
userId: number
vehicleId: number | null // when null retrieve all
}
type Output = Promise<Vehicle[]>
create-users-vehicles.service
type Input = {
userId: number
vehicle: CreateVehicleData
}
type Output = Promise<Vehicle>
update-users-vehicles.service
type Input = {
userId: number
vehicleId: number
vehicle: UpdateVehicleData
}
type Output = Promise<Vehicle>
delete-users-vehicles.service
type Input = {
userId: number
vehicleId: number
}
type Output = Promise<void>
export type UserVehicle = {
userId: number;
vehicle: Vehicle;
};
export type CreateVehicleData = Omit<Vehicle, "id">;
export type UpdateVehicleData = Omit<Vehicle, "id">;
type Result = {
succeed: boolean;
reason: string | null;
};
export interface VehicleDatabase {
getAll(userId: number): Promise<UserVehicle[]>;
getOne(userId: number, vehicleId: number): Promise<UserVehicle | null>;
create(userId: number, vehicle: CreateVehicleData): Promise<UserVehicle>;
updateOne(
userId: number,
vehicleId: number,
vehicle: UpdateVehicleData,
): Promise<UserVehicle | Result>;
deleteOne(userId: number, vehicleId: number): Promise<Result>;
clear(): Promise<void>;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.