SwatiMalik25 / CRM-app

0 stars 0 forks source link

Integration with the backend (Auth) #1

Open dhruvmalik007 opened 1 month ago

dhruvmalik007 commented 1 month ago
dhruvmalik007 commented 1 month ago

@SwatiMalik25 so I think you have created the success page right .

Now the second step Is to create the user database at the backend . as our application will allow the users to register the user new blogpost .

you need to create the tables to store the user information and its blogs.

**Read the tutorial and concept in the following links :

Here are the specification for developing the model

1. for generating the actual datasets

The data model corresponding to the Users

Image

and for the blogs

Image

and here the blogs_id is the foreign key to the users database.

you have the following commands to run in the SQL command table :


CREATE TABLE users (
    id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
    user_email TEXT UNIQUE NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    blogs_created TEXT[]
);

CREATE TABLE blogs (
    id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
    user_id UUID NOT NULL REFERENCES users(id),
    title TEXT NOT NULL,
    content TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

2. now once the tables are generated, you will have to then fetch the datatypes using the second tutorial that is mentioned above.