se701team2 / updog Goto Github PK
View Code? Open in Web Editor NEWUpdog is an open-source social media webapp intended to allow everyday people to share their thoughts in a welcoming community.
License: MIT License
Updog is an open-source social media webapp intended to allow everyday people to share their thoughts in a welcoming community.
License: MIT License
Is your feature request related to a problem? Please describe.
Proposed feature to add a pre-commit check for code linting using Husky and lint-staged
Describe the solution you'd like
Integrating Husky and lint-staged into the repo's workflow to automate verification of code linting
Describe alternatives you've considered
No alternatives have been considered currently
Additional context
Describe the bug
The YAML at the top of the PR template shows up when you make a new PR. I believe front yaml is only supported for issues.
To Reproduce
Create a new PR, you will see this at the top
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a page where the user can see posts from their followers and make new posts themselves. The page should be at the route “/feed” (until auth router is added, then it will be at /)
Describe the solution you'd like
The feed needs:
Inside the post composer:
In the future, if a user tries to visit /feed without being logged in they will be sent to the landing page.
The post composer component may be used elsewhere so make sure it is reusable. The functionality for sending the post to the backend does not need to be made yet.
Here is some sample mock data for 3 feed posts:
const sampleFeed = [
{
id: 1,
content: "Post 1",
author: {
id: 1,
username: "poster1",
nickname: "Poster 1",
profilePic: "https://i.imgur.com/qZImY9j.jpg",
},
parent: null,
children: [5],
usersLiked: 1,
usersShared: 2,
timestamp: 1646627469012
},
{
id: 2,
content: "Post 2",
author: {
id: 2,
username: "poster2",
nickname: "Poster 2",
profilePic: "https://i.imgur.com/PiJAoqO.jpeg",
},
parent: null,
children: [],
usersLiked: 50,
usersShared: 33,
timestamp: 1646627527764
},
{
id: 3,
content: "Post 3",
author: {
id: 1,
username: "poster1",
nickname: "Poster 1",
profilePic: "https://i.imgur.com/qZImY9j.jpg",
},
parent: null,
children: [],
usersLiked: 10,
usersShared: 20,
timestamp: 1646627527764
},
]
export default sampleFeed
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
We do not have any tools to enforce code style and formatting.
Describe the solution you'd like
We should integrate ESLint and Prettier into our workflow.
Describe alternatives you've considered
Other linters etc. exist but some members of the group have experience with ESLint and Prettier, so they are the best solution for us.
Additional context
N/A
Is your feature request related to a problem? Please describe.
We do not have an established place for developers to put their tests.
Describe the solution you'd like
We should add basic testing functionality so that developers can test their contributions, and the testing should be integrated into our CI/CD pipeline.
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Currently our post model needs some tweaking, also we don't have a DTO class to filter the post object before sending it back to FE (FE needs the response body in a specific way)
Describe the solution you'd like
-Edit model/posts.js and migrations/create-posts.js to match the following:
Post
-- Create a DTO class to tweak the object before sending it to FE, and implement it in endpoints that return Post objects so that they return the DTO you created (class could be in a directory called dto/posts.js)
Is your feature request related to a problem? Please describe.
We do not have a pipeline to conduct automated testing of our webapp.
Describe the solution you'd like
A GitHub Action should be set up to run our test suite when a pull request is created or updated.
Describe alternatives you've considered
N/A
Describe the bug
Github does not allow workflows triggered on PRs from forked repos to access secrets.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Error saying at least one superuser is required
Desktop (please complete the following information):
Additional context
N/A
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
(This is WIP, so we haven't decided on the full details yet)
The user should be able search some term and see the results for every user and post that matches
Describe the solution you'd like
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a page where users can sign up for the app and one where they can sign in. These are grouped together in this issue because they are very similar. The pages should be at the routes “/signUp” and “/signIn”.
Describe the solution you'd like
The sign-up page needs:
The sign-in page needs:
Functionality for auth is not needed until the backend for auth is done
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a main header component showing the apps logo and user profile picture.
Describe the solution you'd like
This header will only be visible on pages where the user has logged in (if a user tries to access one of these pages and isn't authenticated, they will be kicked back to the landing page where there is no header).
Should share the same theme and height as the customizable header component
If you need user mock data you can use this (you should only need the username and profile pic):
// mock-data.js
export const userData = {
username: "testuser",
profilePic: "https://i.imgur.com/PiJAoqO.jpeg"
}
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
We need front end boilerplate before we get started on development.
Describe the solution you'd like
So far in discussions, we have decided on using:
We will also need a routing solution, probably just react-router.
We should setup the front end to a workable directory structure, for example:
And also:
Describe the bug
Test case "test/posts.test.js" is failing.
Test Suites: 1 failed, 1 total
Tests: 2 failed, 11 passed, 13 total
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should pass all test.
(to be specific, should return the correct response code)
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
We should add a issue template to make it easier to format tickets. There should be one for issues and bug reports
Describe the solution you'd like
Add issue template files to the repo
Describe alternatives you've considered
N/A
Additional context
Is your feature request related to a problem? Please describe.
Currently, it will be pretty unclear to devs how they can add pages or components to our application. By adding a (mostly) fully implemented post page (minus business logic and theme), a dev will be able to reference the component structure, styles, and conventions used when making their own components.
Describe the solution you'd like
Add a sample page: /post/:id which will use mock data to display a post and its replies, along with a sample header and footer.
Describe alternatives you've considered
N/A
Additional context
N/A
Currently blocked by #14 as authentication would need to be applied to the existing endpoints
Is your feature request related to a problem? Please describe.
Currently, the boilerplate contains endpoints for adding users and getting users by ID. However, the controllers for these endpoints are incomplete and do not have tests. We also need to check if we forgot to remove any unneeded code or dependencies.
Describe the solution you'd like
Describe the bug
When a change is made to a markdown file and is trying to be committed, eslint throws a parsing error for no reason.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected behaviour is the md file passing through eslint
Screenshots
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a page where the user can change their profile details. The route can be “/settings”
Describe the solution you'd like
There is an example for adding a button as a child of customizable header on the issue #40
Here is mock data for a user if needed
// mock-data.js
const sampleUser = {
id: 1,
username: "username",
nickname: "nickname",
profileBanner: "https://i.imgur.com/PcEvuMw.png",
profilePic: "https://i.imgur.com/qZImY9j.jpg",
followers: 11,
following: 22,
joinedDate: 1646627469012
}
export default sampleUser
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Our models are still incomplete
Describe the solution you'd like
-Model and db migrations should match this:
User
-- DTO class should match this:
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a landing page so that people can see what the app is about and then sign in or sign up. The page should be at the route “/”.
Describe the solution you'd like
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Now that we have finalised the user and post models, we need to implement an endpoint for retrieving user activity
Describe the solution you'd like
GET /users/:username/activity
, endpoint should return the following array output:[
{
"postID": 1,
"timestamp": 1646627469012,
"activity": SHARED
},
{
...
}
]
models.[model_name].create()
or models.[model_name].delete()
or by editing the db directly for manual testingIs your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a customizable header component to use at the top of pages where a back button is needed and where we can't assume that a user is logged in while viewing (e.g. profile and search pages)
Describe the solution you'd like
A customizable navigation header:
Should share the same theme and height as the main header component
Some pages will also need some action on the right, e.g. user settings need a save button. You should accept an optional “children” prop it should be rendered on the right side of the header
So the full props should be ({ title, children = null }). Any dev who needs a custom component there will have to pass it in like this:
// UserSettingsView.jsx
<CustomizableHeaderController title=”User Settings”>
<button onClick={doSomething}>Save</button> // this is a child of the element, so it is implicitly passed into the children prop of the customizable header component
</CustomizableHeaderController>
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Currently, POST /users returns a userDTO object, we would like it to return an authToken instead
Describe the solution you'd like
Modify the addUser function to generate an auth token using authentication.js and return the auth token if creation was successful instead of the userDTO
Is your feature request related to a problem? Please describe.
We created a table for shared posts, we just need to implement endpoints for sharing posts
Describe the solution you'd like
Implement two endpoints: POST /posts/:id/share for sharing a post (does not require a body) and DELETE /posts/:id/share for deleting a shared post. Those endpoints should automatically add/remove entries from the shared-posts table
Is your feature request related to a problem? Please describe.
Common API requests will be repeated throughout the codebase, so we can add some utility functions for convenience.
Describe the solution you'd like
Add helper functions for post, get and patch which handle authentication
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a page where a user can see all the interactions people have had with their posts
Describe the solution you'd like
There are 3 types of notifications:
"like"
"share"
"reply"
If you have other ideas for these notifications e.g. showing user name or profile pic you should talk to the backend team to add more data to the response body.
You can use the following data as a mock:
const sampleNotifications = [
{
type: "reply", // possible = like, share, reply
from: 2, // user who interacted with the post
post: 1, // post that was interacted on
timestamp: 1646627469012, // unix timestamp when the interaction happened
content: "cool" // if type reply, this will be the content of the reply, else null
},
{
type: "share",
from: 2,
post: 1,
timestamp: 1646627527764,
content: null
},
{
type: "like",
from: 2,
post: 1,
timestamp: 1646627527764,
content: null
},
{
type: "like",
from: 3,
post: 1,
timestamp: 1646627527764,
content: null
}
]
export default sampleNotifications
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Once we have decided on a colour palette and font to use on the front end, these colours should be added to a centralized style file so that they can be imported into any style sheet. This should ensure consistent colouring on all components and will also make it easy to change theme in the future.
Describe the solution you'd like
Example file using default Material UI colours:
Example usage:
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
The quick-start guides of the readmes in the frontend and backend folders lack detail and are outdated.
Describe the solution you'd like
The readme.md files in both frontend and backend folders should be rewritten such that someone totally new to the project would be able to clone and run the project on their personal computer.
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
We want posts to be able to include attachments, such as photos and videos
Describe the solution you'd like
Tests need to implemented as a part of this ticket
Is your feature request related to a problem? Please describe.
We need authentication for almost all of our endpoints.
Describe the solution you'd like
A directory called Middlewares should be created, and in that directory, authentication.js should be created.
The file should contain two main functionalities:
Afterwards, unit tests should be implemented in the test folder for this new functionality
Is your feature request related to a problem? Please describe.
Currently, the user class accepts any type of string as email
Describe the solution you'd like
Unit tests need to be implemented to test this functionality
Is your feature request related to a problem? Please describe.
We do not currently have Contribution Guidelines, a Code of Conduct, or a framework for creating further documentation as the project advances.
Describe the solution you'd like
Contribution guidelines, a code of conduct, a readme, and an informative wiki homepage should be created.
Describe alternatives you've considered
N/A
Additional context
Contribution Guidelines and Code of Conduct should match and extend the requirements given in the assignment specification.
Is your feature request related to a problem? Please describe.
The /users/authenticate
endpoint is implemented, but we still need to call the password validation method implemented in #25 and tweak a few things
Describe the solution you'd like
The endpoint should have the following logic:
{
"email": "[email protected]",
"password": "password"
}
Is your feature request related to a problem? Please describe.
Currently we do not have endpoints for liking or unliking posts
Describe the solution you'd like
Add tests for the two endpoints
Is your feature request related to a problem? Please describe.
We don't have endpoints for editing or deleting a user
Describe the solution you'd like
-Create two endpoints: PUT /users/:username
(Some fields can't be edited, eg. joinedDate, followers, followed users, etc..) and DELETE /users/:username
Authentication.extractUser()
, we need to add a line to ensure the user encoded in the auth token is still in the DB, otherwise an error needs to be thrown and a status code of 401 needs to be returned, this is so that if the user is deleted they can't be authorized to call our endpoints anymoreIs your feature request related to a problem? Please describe.
Currently, the backend's test folder is named test
, a name that isn't detected by Jest as a default location for tests (which necessitates including "test" in the filenames of the files within it). It also differs from the frontend section's test folder, which is already named __tests__
Describe the solution you'd like
We should rename the backend test folder to tests to match frontend and the Jest standard.
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a user page to show a user’s details and post history. The page should be at the route “/user/:username”
Describe the solution you'd like
User details section:
User history section:
Here is some mock data for a user and a feed
// mock-data.js
export const sampleUser = {
id: 1,
username: "username",
nickname: "nickname",
bio: "a biography",
profileBanner: "https://i.imgur.com/PcEvuMw.png",
profilePic: "https://i.imgur.com/qZImY9j.jpg",
followers: 11,
following: 22,
joinedDate: 1646627469012
}
export const sampleFeed = [
{
id: 1,
content: "Post 1",
author: sampleUser,
parent: null,
children: [5],
usersLiked: 1,
usersShared: 2,
timestamp: 1646627469012
},
{
id: 2,
content: "Post 2",
author: sampleUser,
parent: null,
children: [],
usersLiked: 50,
usersShared: 33,
timestamp: 1646627527764
},
{
id: 3,
content: "Post 3",
author: sampleUser,
parent: null,
children: [],
usersLiked: 10,
usersShared: 20,
timestamp: 1646627527764
},
]
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a footer that has navigation controls so a user can get to each of our main pages
Describe the solution you'd like
The footer needs:
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
We need to implement CRUD endpoints for the posts
Describe the solution you'd like
Endpoints that should be implemented:
POST /posts/:id
For creating a new post
GET /posts/:id
For retrieving a particular post
PUT /posts/:id
For editing a post
DELETE /posts/:id
For deleting a post
No need to set up authentication for now as it is being set up in a separate ticket. Unit tests also need to be implemented
Is your feature request related to a problem? Please describe.
We need backend boilerplate.
Describe the solution you'd like
So far in discussions, we have decided on using:
The directory structure should be the following:
Ideally the two main models (user and posts) should be implemented when implementing the boilerplate so we can delegate tasks as soon as we can
Basic template for PR's for contributors to check basic requirements have been met
Is your feature request related to a problem? Please describe.
This is a front end component, please refer to the Figma on the wiki for the current design. If there is no design, feel free to add your own to fit the criteria.
We need a page where you can see the list of people a person follows and their followers. This can be a public route at /user/:username/follows
Describe the solution you'd like
You can use this mock data (for both follows and followers, unless you make your own separate data for that)
const follows = [
{
id: 1,
username: 'follow1',
nickname: 'Follow 1',
profilePic: 'https://i.imgur.com/qZImY9j.jpg',
},
{
id: 2,
username: 'follow2',
nickname: 'Follow 2',
profilePic: 'https://i.imgur.com/PiJAoqO.jpeg',
}
]
export default follows
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
We don't have an explicit coding style guide.
Describe the solution you'd like
The stub style section at the bottom of CONTRIBUTING.md should be expanded, and possibly put into its own document.
Describe alternatives you've considered
N/A
Additional context
Partially blocked by #12 as linter and formatter rules need to be finalised.
Is your feature request related to a problem? Please describe.
Currently we do not have a follow feature implemented. It should enable an authenticated user to follow or unfollow another user.
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
We do not have a method of generating API documentation. This would be useful for future groups to understand our API design and to be able to test it
Describe the solution you'd like
Investigate a way to automatically generate an API documentation from our codebase
Is your feature request related to a problem? Please describe.
Right now, posts are only fetched by the post object using an id passed in. We need an option to pass in a post object which will be rendered
Describe the solution you'd like
Change the post props from { id } to { id = 0, post = null }
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
To let people know how to contribute, we should add/change the following files:
Is your feature request related to a problem? Please describe.
Currently the footer and headers are using the secondary colour as a background because MUI was being a pain. We should change these to use the primary as a base.
Describe the solution you'd like
The background colour should be primary, the active icon should be secondary, and the inactive icon should be white.
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Currently, the user model does not have a password field
Describe the solution you'd like
Unit tests should be implemented as part of the ticket
Describe the bug
Some user fields require a value when they should not be required, this is causing test failures
To Reproduce
Run tests in users.test.js
Expected behavior
existing tests should pass and if there are any fields that are required, those tests should be modified to adapt to new changes
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.