Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Models for project and user #25

Open
kanlanc opened this issue Apr 24, 2018 · 5 comments
Open

Models for project and user #25

kanlanc opened this issue Apr 24, 2018 · 5 comments
Assignees

Comments

@kanlanc
Copy link

kanlanc commented Apr 24, 2018

Guys for the model for the user and the project submitted, how about

For each project the owner can give in their github project link, its working link , its description. contributors and then we can show it in the frontend. hence the model will be like:-

name, github link, hosted link, description, owner, comments(array), moderators

As for the user
name,password,username,projects(array)

What are your thoughts?

@kanlanc kanlanc changed the title Modal for each project submitted by the user Modals for project and user Apr 24, 2018
@kanlanc
Copy link
Author

kanlanc commented Apr 24, 2018

const RepoSchema=new express.Schema({
name:{
type:String,
requried:true
},
gitlink:{
type:String,
requried:true
},
owner:{
type:String,
required:true
},
contributors:[
{
type:mongoose.Schema.Types.ObjectId,
ref:User,
}
],
comments:[
{
type:mongoose.Schema.Types.ObjectId,
ref:Comment,
}
]
});

@kanlanc
Copy link
Author

kanlanc commented Apr 24, 2018

As for user
var userSchema = new Schema({
name : {type : String,required: true},
username : {type : String, unique: true, required: true},
password : {type : String,required : true},
repos:[{type:mongoose.Schema.Types.ObjectId,ref:Repo}],

});

@blenderskool
Copy link
Contributor

@highskillzz As per the designs, I think we are including all those information, along with more options such as browser support.
Also, there will be different user roles, so we must design it accordingly.

@palnabarun palnabarun changed the title Modals for project and user Models for project and user Apr 25, 2018
@anurag-majumdar
Copy link
Contributor

The main point is are we authenticating the normal user who is going to view the projects only?
I remember the project owner and admin have authentication so far.

Apart from that, the project owner will be having access to the repos he or she built.
I think we should keep the schema as simple as possible for the working part as we have around 10 days in hand now.

What we can do is while designing the model schema, we should remember that the projects are related to the project owner. So a project owner can have the following type of schema:

  1. role (can be a project owner or admin or user if authentication for user is also included)
  2. projects (an array of projects)
    Each project structure can be github link, contributors, owner name etc. as mentioned by @highskillzz earlier.

This is one suggestion for schema.
I am mainly thinking of the "store what we query for" technique instead of applying multiple joins. We are going to be using Firestore and it is a NoSQL db, this way we can eliminate multiple complexities.

If we follow the traditional approach of schema design, we can keep a user schema and a projects schema as shown by @highskillzz . But we need to choose the fields carefully as we need to get them implemented for the 1st draft too. Then later on we can add more such fields and make it even better.

Let me know what you guys think?
@ritikrishu @palnabarun @divyamrastogi @blenderskool @highskillzz

@kanlanc
Copy link
Author

kanlanc commented May 4, 2018

The authentication for the user would be required only under the circumstances that the user will comment on the repo. Else there would be no point in authenticating the user because he will only view the project unless as mentioned he will comment too. Shall I open a pull request as a work in progress for this then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants