Giter VIP home page Giter VIP logo

bit-next's Introduction

Frontend

Running the Frontend

In the proeject directory first install the packages if you never installed them:

npm i 

Next to run the local server, run:

npm run dev

Backend

Running the Backend

In the backend folder, install all the dependacies with:

pip install -r requirements/dev.txt

Run the application with:

flask run --with-threads

Shell

To open the interactive shell, run ::

flask shell

By default, you will have access to the flask app and models.

Running Tests

To run all tests, run ::

flask test

Migrations

Whenever a database migration needs to be made. Run the following commands ::

flask db migrate

This will generate a new migration script. Then run ::

flask db upgrade

To apply the migration.

For a full migration command reference, run flask db --help.

bit-next's People

Contributors

aishwarya-mustoori avatar anuragunni avatar ayushbha avatar bryanwong8 avatar grchng avatar jersinfong avatar lazordiak avatar lazyplatypus avatar mzp0625 avatar reck1ess avatar roma-s-kaul avatar velforce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bit-next's Issues

Anurag and Ayush OKR

Is your feature request related to a problem? Please describe.
We need to implement the followers and comments feature for both backend and frontend

Describe the solution you'd like
Complete the views and routes in the issues below.

List of issues need to be complete

  • #4 - Anurag
  • #7 - Ayush

Admin pannel

Is your feature request related to a problem? Please describe.
We need to add admin panel options

Describe the solution you'd like
A clear and concise description of what you want to happen.

Figma Design

Screenshot (187)

  • Should add an Admin tab under the current vertical tabs.

  • Tag drop down

  • Should display an ant design dropdown, https://ant.design/components/dropdown/ which should display all the tags

  • Should be using the {{APIUrl}}/api/tags route to display all of the dropdown choices

  • Member search

  • Should use the mentions input to get the users with the ant design mention component, https://ant.design/components/mentions/

  • To get all the members from a tag, use the {{APIURL}}/api/tags/{{tagSlug}}/members api call.

  • There should be a submit button to add the users in the mention input with the {{APIURL}}/api/tags/{{tagSlug}}/moderator/{{USERNAME}}, the button should use the ant design button, https://ant.design/components/button/

Article Pages

Is your feature request related to a problem? Please describe.
Need to get Articles pages up and running

Describe the solution you'd like
A clear and concise description of what you want to happen.

Figma Design

  • Article Display

Screen Shot 2020-05-21 at 4 56 32 PM

Explore page

Screen Shot 2020-05-23 at 3 20 37 PM

  • Login/Signup

Screen Shot 2020-05-23 at 2 36 05 PM

  • Should use buttons from ant design to create the button, https://ant.design/components/button/

  • You should not display this if the current user is logged in. you can check if the user is logged in or not with /api/user. If a 401 is returned, then the user is not logged in. When clicked on it should lead to the login page, pages/user/login.tsx

  • Article and ArticleList

Screen Shot 2020-05-23 at 2 55 49 PM

  • You should use the ArticleList component to have a bunch of Article components. Both components are located in the components folder.

  • You should also be using the /api/articles/{{slug}} route, but query articles for all articles

  • Tag and TagList

Screen Shot 2020-05-23 at 2 55 43 PM

  • This is the TagList and Tag component, for each tag you should display the name and the tag's emoji.

  • Call the /api/tags to display the top five tags.

Explore page for tags

Screen Shot 2020-05-23 at 2 12 54 PM

  • UserList and User

Screen Shot 2020-05-23 at 2 54 16 PM

  • Should use the UserList component and the User component to put in the UserList component. Both components are in the component

  • You should call the /api/tags/{{tagSlug}}/members route to get all the members and moderators for the a Tag.

  • To follow the user and unfollow the user, use /api/profiles/{{USERNAME}}/follow (PUT) and /api/profiles/{{USERNAME}}/follow (DEL) respectively. The button should be green if the user is following.

  • Article and ArticleList

Screen Shot 2020-05-23 at 2 55 49 PM

  • You should use the ArticleList component to have a bunch of Article components. Both components are located in the components folder.

  • You should also be using the /api/articles/{{slug}} route, but query articles under a tag

  • Tag and TagList

Screen Shot 2020-05-23 at 2 55 43 PM

  • This is the TagList and Tag component, for each tag you should display the name and the tag's emoji.

  • Call the /api/profiles/{{username}}/tags to display the top five tags.

API Calls Needed

  • /api/user - to get the current user logged in
  • /api/articles/{{slug}} - Can be used to query for all articles or articles under a tag
  • /api/articles/{{slug}}/bookmarks
  • /api/users - to get a user
  • /api/tags/{{tagSlug}}/members

Article, Followers Feature

Is your feature request related to a problem? Please describe.
Adjust the Following system for UserProfile.
Add the isPublished field to Articles and adjust logic for that.

Describe the solution you'd like

  • Adjust the UserProfile class function follow to append to the followings column.
  • (Hackathon) Add the following columns to the User model in backend/conduit/user/models.py:
    • occupation: Text
    • githubLink: String(100)
    • twitterLink: String(100)
    • linkedInLink: String(100)
    • website: Text
    • The default for all of them should be an empty string
  • Add bookmarkers field to Articles. This should be a relationship between Articles and UserProfiles
  • (Hackathon) Modify the update_user route in backend/conduit/user/views.py to take account of the newly added fields.
  • (Hackathon) Create a route to return the user's followers in backend/conduit/profile/views.py
    • This should return the user's follows column.
  • (Hackathon) Create a route to return the user's followings in backend/conduit/profile/views.py
    • This should return all the users that follow the targeted user but the targeted user does not follow them back
  • Create a route to add an Article to the bookmarks column for UserProfile
    • You should create a class function to add the article to the bookmarks column
  • Add the isPublished column to the Article model in backend/conduit/articles/models.py
    • Add the published field in the get_articles route in backend/conduit/articles/views.py kwargs.
    • If the published field is "true", return published articles only, else return unpublished articles. If it is "false" return unpublished articles only. If it is "all", then return all articles from the author.
  • Adjust the test_get_articles_by_author in backend/tests/test_articles.py to account for the new query changes

Additional context

  • (Hackathon) If the current user that the person is following allows follows the current user, then append the user to the followers column and remove from the following column. Should adjust the UserProfile follow class function
  • If the current user unfollows someone, then removed that user from the followers column to the following column. Should adjust the UserProfile unfollow class function.

Hackathon session 5/20/20

Is your feature request related to a problem? Please describe.

Pairs and goals
NOTE: In your issues, you should complete the issues that have (Hackathon) right next to it
Grace and Aishwarya

  • Complete CRUD route, follow/unfollow organization
  • Complete Organization page, and remove/promote user from organization

Jason

  • complete the layouts and transfer components

Anurag and Ayush

  • Update User model, update update_user route
  • Transfer MD editor to new page, Make user settings page, Make user page

Yuan and Mark

  • Add fields to Tag model, make update and delete routes for tags, implement follow and unfollow tags for users, and modify the
  • Integrate general explore page and tag explore page

Organization feature

Is your feature request related to a problem? Please describe.
We need to create the organization feature.

Describe the solution you'd like:

Models

Organization

  • (Hackathon) Create the Organization model in backend/conduit/organizations/models with the following fields:
    • name: string(100)
    • slug: text (EDIT Make this field unique)
    • description: text
    • createdAt: DateTime
    • moderators: User relationship, use backref to make relationship.
    • members: User relationship, use backref to make relationship.
    • Create a constructor to take in name, slug, and description

Articles

  • Add the following column to the Article model in backend/conduit/articles/views.py
    • needsReview: boolean, false
    • organizations: Article relationship, use backref to make relationship.

Schemas

  • (Hackathon) Create two schemas to return an organization and many organizations.
    • The many organizations schema should inherit the organization schema, but still needs the @post_dump functions
    • You should probably use the ProfileSchema frombackend/conduit/profile/serializers and ArticleSchemas from backend/conduit/articles/serializers for the relationships

API Routes

CRUD Routes

  • (Hackathon) Create CRUD routes for Organizations. You should follow a similar syntax to how the CRUD routes are made in backend/conduit/articles/views.py
    • The person who makes the organization should be added as moderator
Endpoints HTTP Method Description Tested
{{ url }}/api/organizations/{{ slug }} GET Fetch Single Org ✔️
{{ url }}/api/organizations/{{ slug }} PUT Update Org ✔️
{{ url }}/api/organizations/{{ slug }} DEL Delete Org ✔️
     
{{ url }}/api/organizations POST Create Org ✔️

Unfollow / Follow

  • (Hackathon) Create the follow and unfollow routes for organizations.
    • The routes should use add/remove the current user from the organization.
    • Create class functions to follow and unfollow an organization
Endpoints HTTP Method Description Tested
{{ url }}/api/organizations/{{ slug }}/follow POST Follow Org ✔️
{{ url }}/api/organizations/{{ slug }}/follow DEL Unfollow Org ✔️

Moderators

  • Create a route called remove_member for organizations in backend/conduit/organizations/views.py.
  • Only MODERATORS of an organization can do this.
  • The route should remove the targeted user IF the current_user is a member for the organization.
    • The remove member function should be a class function for Organization
  • Create a route called promote_user for organizations in backend/conduit/organizations/views.py.
  • Only MODERATORS of an organization can do this.
  • This route should add the targeted user into the organizations moderators list.
  • Create a route to return all the members and moderators in an organization.
Endpoints HTTP Method Description Tested
{{ url }}/api/organizations/{{ slug }}/members DEL Remove Member ✔️
{{ url }}/api/organizations/{{ slug }}/members POST Promote Member ✔️
{{ url }}/api/organizations/{{ slug }}/members GET All Members & Mods ✔️

Article

  • Create a route in backend/conduit/organizations/views.py called review_article which allows moderators to make the article public or not. If needsReview is set to true, then remove it from the moderator's list. If it is false leave it alone. Only an Admin can call this route.

    • When a User submits an Article, if an organization slug is specified, then the organization is added to the organizations column, but the needsReview boolean is set to True. Also, you should only be reviewing an Article is needsReview is True
    • Add a relationship to organizations for a column called reviewed_articles which is a list of all articles that need to be reviewed before moving them to the org_article column. All articles in org_article are public for everyone to see.
Endpoints HTTP Method Description Tested
{{ url }}/api/organizations/{{ org_ }}/articles POST Submit Org Article ✔️
{{ url }}/api/organizations/{{ org_slug }}/articles/{{slug}} DEL Delete Review Status on Org Article ✔️

Create/Edit Functions

Articles

  • Edit the get_articles function in backend/conduit/articles/views to implement fetching articles from organizations. There should be call that returns needsReview articles

Tests

  • Create test functions in backend/tests/test_organizations.py to test all the routes in backend/conduit/organizations/views.py. Each route should be its own test function

Additional context

User feed feature and Cloudflare

Is your feature request related to a problem? Please describe.
We need to implement a feature to retrieve the latest posts from the tags that the users are following.

We also need to implement CloudFlare CDN with the staging and production sites for our API. This is to make all of the JSON responses faster.

Describe the solution you'd like:
Create a route to display the latest posts from the tags that the users are following.
Integrate Cloudflare with Heroku staging and production sites.

Models
None

Schemas
None

API Routes

User feed

Endpoints HTTP Method Description Tested
{{APIURL}}/api/user/tags/articles GET User Feed

Create/Edit Functions

User feed

  • Create a route to return the latest 5 tags from the tags that the current user is following
    • I would recommend making a class function to return the latest 5 articles from a tag.
    • Then loop through the function and store the articles in an array then return it.

Additional context

Article Dashboard and Github OAuth

Is your feature request related to a problem? Please describe.
We need to display the articles by sorting by views, most viewed and most recent articles in the user dashboard.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Figma Design

  • ##User Dashboard

Screen Shot 2020-06-05 at 5 52 08 PM

  • Should be editing the pages/dashboard/[pid].tsx

  • Change the most viewed tab to all posts tab. It should display all of the articles written by the current user

  • Change the most liked tab to the published. It should display all of the published articles by the current user

  • Change the most recent tab to the drafts tab. It should display all of the drafted articles written by the current user.

  • Should use the components/global/ArticleList.tsx to display the articles.

  • Should call the {{APIURL}}/profiles/{{USERNAME}}/articles route to display the articles from the current user. You can include different query parameters to sort the articles by likes, most viewed and most recent.

  • ##Github OAuth

  • Should be using the next-auth package to implement Github OAuth, https://github.com/iaincollins/next-auth

  • At first, generate the Github API Key and secret with your account. We will later change the API Keys and Secret to the Bit Project account.

  • You should look at the documentation from this link to implement OAuth, https://next-auth.js.org/getting-started/introduction

  • You can even try the demo with this link, https://next-auth-example.now.sh/

User Organization and Tag tab in dashboard

Is your feature request related to a problem? Please describe.
We need to build out the feature to let moderators of organization edit the organization and control whose in the organization

We need to build out the tags tab if the user is an admin for a tag.

Figma Design

Organization Tabs

Screen Shot 2020-06-19 at 6 01 41 PM

  • Submitted Tab

  • You should be using the ArticleList component, components/global/ArticleList.tsx to display all of the articles that need to be reviewed.

  • You should use the {{APIURL}}/api/organizations/{{organizationSlug}}/articles/{{articleSlug}} call to reject or accept the article for the organization.

Screen Shot 2020-06-19 at 6 01 52 PM

  • Member Tab

  • You should use the UserList component from components/global/UserList.tsx to implement the user list

  • You can use the {{APIURL}}/api/organizations/{{organizationSlug}}/members route to remove a member from an organization

Screen Shot 2020-06-19 at 6 02 01 PM

  • Settings Tab

  • You should be creating a component called GroupSetting. Before this check if the person who has issue #89 if they completed this component. If they have use it. If not then create your own.

  • If mod setting is public, then send 1, if the mod setting is moderated, then send 2, and if the mod setting is private, then send 3.

  • The {{APIURL}}/api/organizations/{{organizationSlug}}(PUT) will be used to update an organization.

Tag Tabs

Screen Shot 2020-06-19 at 3 59 20 PM

  • Submitted Tab

  • You should be using the ArticleList component, components/global/ArticleList.tsx to display all of the articles that need to be reviewed.

  • You should use the {{APIURL}}/api/tags/{{tagSlug}}/articles/{{articleSlug}} call to reject or accept the article for the tag.

Screen Shot 2020-06-19 at 3 59 30 PM

  • Published Tab

  • You should be using the ArticleList component, components/global/ArticleList.tsx to display all of the articles that need to be reviewed.

  • You should use the {{APIURL}}/api/tags/{{tagSlug}}/articles/{{articleSlug}}(PUT) call to reject the article for the tag.

Screen Shot 2020-06-19 at 3 59 36 PM

  • Settings Tab

  • You should probably make a component called GroupSettings since this can be reused for organization settings as well.

  • You should be using the {{APIURL}}/api/tags/{{tagSlug}}(POST) call to update the tag.

  • If mod setting is public, then send 1, if the mod setting is moderated, then send 2, and if the mod setting is private, then send 3.

Integrate algolia search

Is your feature request related to a problem? Please describe.
We need to integrate algolia search to make searching articles faster.

Describe the solution you'd like:

  • Create article index
  • Update article index
  • Remove article index

Models
None

Schemas
None

API Routes

Article CRUD Routes

Endpoints HTTP Method Description Tested
{{APIURL}}/api/articles POST Create Article
{{APIURL}}/api/articles{{slug}} PUT Update Article
{{APIURL}}/api/articles{{slug}} DELETE Delete Article

Create/Edit Functions

Edit Article routes in backend/conduit/articles/views.py

  • Modify the make_article route to create an index when the article is created
  • Modify the update_article route to update an index
  • Modify the delete_article route to delete an index

Additional context

Main Explore, Tag Explore and Organization Page

Is your feature request related to a problem? Please describe.
We need to implement infinite scrolling for the articles in the explore page.

Describe the solution you'd like

Organization Page

Screen Shot 2020-06-05 at 4 55 14 PM

  • Should use the {{APIURL}}/api/organizations/{{organizationSlug}} to get all the information needed to display the data needed.

  • Should look at the Postman Docs to use the correct props in the component

  • Organization Header

Screen Shot 2020-06-05 at 4 55 20 PM

  • Should reuse the header component from components/global/Header.tsx to implement the Organization header part.

  • For the follow and unfollow button you should use the {{APIURL}}/api/organizations/{{organizationSlug}}/follow(POST) and
    {{APIURL}}/api/organizations/{{organizationSlug}}/follow(DELETE) to follow and unfollow an organization

  • Organization Articles

Screen Shot 2020-06-05 at 4 55 25 PM

  • For the tabs part, use ant design tabs, https://ant.design/components/tabs/

  • Should use the Article component from the components/global/ArticleCard.tsx to show the articles.

  • Should use the components/global/UserList.tsx to display all of the followers of an organization and to use the {{APIURL}}/api/organizations/{{organizationSlug}}/members route to display the members

  • Moderators and Members

Screen Shot 2020-06-05 at 4 55 28 PM

  • Use the {{APIURL}}/api/organizations/{{organizationSlug}}/members route to get the data needed to display moderators and members. Should also use the components/global/User.tsx component to display the members and moderators.

  • The follow and unfollow routes should use {{APIURL}}/api/profiles/{{USERNAME}}/follow (POST) and {{APIURL}}/api/profiles/{{USERNAME}}/follow (DELETE)

Configure Layouts

Is your feature request related to a problem? Please describe.
We need to create mobile, tablet, and mobile layout for the Explore, Profile, Organization, Write a Blog, User Dashboard and Setting page.

Describe the solution you'd like
Should implement each page with different layouts.

Figma Design

  • Explore
  • file: pages/index.tsx

Screen Shot 2020-05-17 at 9 27 34 PM

  • UserProfile
  • file pages/profile/[pid].tsx

Screen Shot 2020-05-17 at 9 27 50 PM

  • Organization
  • file: pages/organization/[pid].tsx

Screen Shot 2020-05-17 at 9 27 57 PM

  • Article
  • file: pages/article/[pid].tsx

Screen Shot 2020-05-17 at 9 28 10 PM

  • UserDashboard
  • file: pages/user/[pid].tsx

Screen Shot 2020-05-17 at 9 28 19 PM

  • Settings
  • file: This can be more of a component used within the user dashboard settings

Screen Shot 2020-05-17 at 9 28 35 PM

Component Details

Integrate Algolia search with Articles

Is your feature request related to a problem? Please describe.
We need a search feature so that User's can easily search for Articles

Describe the solution you'd like
Implement Algolia search for all of the Articles in the Database

Figma Design
WILL UPDATE LATER

Component Details

Implement Ant Design Components for Figma Design

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Figma Design

  • User Component

Screen Shot 2020-05-17 at 7 19 51 PM

  • User List

Screen Shot 2020-05-17 at 7 31 54 PM

  • ArticleCard

Screen Shot 2020-05-17 at 9 47 11 PM

  • Header

Screen Shot 2020-05-17 at 9 53 35 PM

Screen Shot 2020-05-17 at 9 53 42 PM

  • Followers

Screen Shot 2020-05-17 at 9 59 52 PM

Screen Shot 2020-05-17 at 9 59 44 PM

Screen Shot 2020-05-17 at 10 00 47 PM

Screen Shot 2020-05-17 at 10 00 39 PM

  • Settings

Screen Shot 2020-05-17 at 10 04 07 PM

Screen Shot 2020-05-17 at 10 04 29 PM

Screen Shot 2020-05-17 at 10 04 33 PM

Component Details

  • Create a file called User.js in src/components/global and create the User component. Use the List.Item and List.Item.Meta object from ant design to implement it, https://codesandbox.io/s/5d8fk.
  • Create a file called UserList.js in src/components/global and create the User List component. Use the List object from ant design https://codesandbox.io/s/5d8fk.
  • We need to create an ArticleCard component to display information for a particular Article. The component be able to adjust to the all the Figma designs. Should take Use the Card component from ant design, https://ant.design/components/card/
  • Implement the Header component to display data about Users or Organizations
  • Implement Followers component with the List component from Ant Design, https://ant.design/components/list/
  • Implement Setting components to adjust for User, Organization, and Tag settings. I would recommend looking at some of Ant design's components to see if you can use them. If not create your own.

Comment Likes and Views count

Is your feature request related to a problem? Please describe.
We need to build a feature to like a comment. We also need a way to keep track of the number of times an article is viewed.

Models

Article

  • Add a views column. It should be an integer with the default of 0.

Comment

  • Add a liking system to comments. It should be very similar to Article likes.
  • Should be creating a many to many association with Comments and Profiles

Schemas

  • Edit the Comment schema to include the likes
  • Edit the Article schema to include the views

API Routes

Endpoints | HTTP Method | Description | Tested
/api/articles/{{slug}} | Get | The view count should increase each time this is called |
/api/comments/{{commentId}}/favorite | POST | Add the user to the comment's favorites relationship |

Create/Edit Functions

get_article

  • Each time function is called, add 1 to the view count.

favorite_a_comment

  • Should query for the comment and profile. If they both exist then add the profile to the comment's favorite

Additional context

  • Adjust the article tests in the backend/tests/test_articles.py file. Some of them don't currently pass. So adjust the routes or tests accordingly to make sure that they work.

Grace and Aishwarya OKR

Is your feature request related to a problem? Please describe.
We need to implement the Organization features and views so that people can start creating organizations and publish Articles to them

Describe the solution you'd like
Complete the views and routes in the issues below.

List of issues need to be complete

  • #3 - Grace
  • #6 - Aishwarya

User Profile Pages

Is your feature request related to a problem? Please describe.
Need to create the User Dashboard page to display information about the user.

Describe the solution you'd like
Complete the following components and transfer existing MD editor to new repo. The editor should be replaced with the one in pages/editor/new.tsx

Figma Design

  • Getting the markdown editor is the number 1 priority right now. It should be placed in the pages/editor/new.tsx file.
    • It connect to the Cloudinary for hosting images
    • When creating the article, it should be created with the /api/articles route
    • When updating the article, you should use /api/articles/{{slug}} to update it

UserDashboard

Screen Shot 2020-05-23 at 3 14 23 PM

  • User Articles

  • You should be using the Article and ArticleList component in the components folder to implement this out.

  • You should be calling /api/articles to get all the articles from the current user.

Screen Shot 2020-05-23 at 3 24 39 PM

  • User

Screen Shot 2020-05-23 at 3 24 53 PM

  • You should use the existing User component in the components folder

  • You should also be using the /api/user to get information about the current user

  • Tabs

Screen Shot 2020-05-23 at 3 24 57 PM

  • You should be using the Tab component to build this component out.

Followers page

Screen Shot 2020-05-21 at 4 18 34 PM

  • User followers

Screen Shot 2020-05-23 at 3 24 53 PM

  • You should use the existing User component in the components folder

  • You should also be using the /api/user to get information about the current user

  • Tabs

Screen Shot 2020-05-23 at 3 24 57 PM

  • You should be using the Tab component to build this component out.

  • User Component

Screen Shot 2020-05-23 at 4 22 01 PM

  • You should use /api/profiles/{{USERNAME}}/followers to get the user's followers and /api/profiles/{{USERNAME}}/followings to get the user's followings

Following page

Screen Shot 2020-05-21 at 4 18 39 PM

  • User followings

Screen Shot 2020-05-23 at 3 24 53 PM

  • You should use the existing User component in the components folder

  • You should also be using the /api/user to get information about the current user

  • Tabs

Screen Shot 2020-05-23 at 3 24 57 PM

  • You should be using the Tab component to build this component out.

  • User Component

Screen Shot 2020-05-23 at 4 22 01 PM

  • You should use /api/profiles/{{USERNAME}}/followers to get the user's followers and /api/profiles/{{USERNAME}}/followings to get the user's followings

Nested Comments

Is your feature request related to a problem? Please describe.
We need a way to make comments on other comments

Describe the solution you'd like
Implement the nested comment reply feature with ant design's reply box (more info below).

Figma Design

Nested Comments

Screen Shot 2020-06-19 at 8 35 22 PM

  • Comment Reply

  • You should be editing in the pages/article/[pid].tsx file

  • When the reply to word is clicked, it should open an input box from ant design, https://ant.design/components/comment/. It's the last component on the page.

  • When the enter key or the submit button is clicked then use the {{APIURL}}/api/articles/{{slug}}/comments(POST) call to make a comment under the comment.

  • If the user is not logged in, then do not open the input box. Alert the user that they are not logged in with the ant design message component, https://ant.design/components/message/

Editor and Settings edit

Is your feature request related to a problem? Please describe.
We need to edit some small features for the article editor and settings.

Figma Design

Article Editor

  • We need a way for the cover image to be previewed in the editor.

  • Should use ant design message component, https://ant.design/components/message/ to display that the user's article has been saved. This is when the Article is autosaved.

  • We should double check for the editor to only accept images and not other file formats (.png, etc.)

  • The cover image does not get saved to the database when an image is submitted. Double check that it does get sent. Check if it gets displayed correctly in pages/article/[pid].tsx file.

User Dashboard Settings

  • Add hover effect on reupload image word

  • Add the name, occupation and location field for the dashboard

  • Incorporate image resizing when uploading an article editor and user profile image upload through cloudinary

Bryan OKR

Is your feature request related to a problem? Please describe.
Deploy both frontend on Zeit and backend on Heroku.
Update Thinkster Postman Collection.

Describe the solution you'd like

  • Deploy Frontend on Zeit and backend on Heroku
  • Update Postman collection and make mock server
  • Make sure that we have a shippable product by Wednesday

Yuan OKR

Is your feature request related to a problem? Please describe.
Need to implement Github OAuth to allow an easy way for Users to logged in. Need to implement the Explore views too, but most of the components have already been implemented. Need to give more features for the Tag model like followers, updating and deleting Tags.

Describe the solution you'd like
Complete the views and routes in the issues below.

List of issues need to be complete

  • #5 - Yuan

Update Tag feature

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

  • (Hackathon) Add the following fields for the Tag model in backend/conduit/tags/models.py:
    • description: text
    • slug: string(100)
    • icon: string(50)
    • modSetting: int
    • tagFollowers: relationship with UserProfile model
    • moderators: relationship with UserProfile model
  • (Hackathon) Create a schema to update a Tag.
    • The schema should include description, slug, icon, and mod setting. Follow the example on how the schemas are made in backend/conduit/articles/serializers.py and apply them to backend/conduit/tags/serializers.py
  • (Hackathon) Create the Update and Delete routes in backend/conduit/tags/views.py. You should follow a similar syntax to how the CRUD routes are made in backend/conduit/articles/views.py
  • (Hackathon) Create a follow and unfollow tag route in backend/conduit/tags/views.py. The route should add the current user to the Tag's followers list. For unfollow, remove the user from the Tag's followers list.
  • (Hackathon) Create a route that returns all of the followers and moderators for a Tag called get_members_from_tag
  • Create a route to return all of a user's tags called, profile_tags in backend/conduit/profile/views.py
  • Create a claim_tag route where an Admin (a User with the isAdmin boolean == True) adds themself to the moderatos column.
    • Should also create a route called invite_moderator to invite users as moderators for the targeted tag.
  • Add a needsReview boolean column to the Article model in backend/conduit/articles/models.py. The default should be false.
    • Modify the get_articles backend/conduit/articles/views.py to fetch only articles where needsReview is false.
  • Modify the make_article in backend/conduit/articles/views.py. If the tag's modSetting is 3, then check if the user is an admin first before posting else dont post it and remove the tag from the article. If the tags's modSetting is 2 then send the variable needsReview to true when creating the tag.
  • Add an isAdmin field to the User model in backend/conduit/users/models.py. By default this value should be false.
    • Create a decorator in backend/conduit/utils.py to check if the user is an admin. It would help to make a class function in the User model to return the isAdmin boolean.
  • Create a route in backend/conduit/articles/views.py called review_article which allows moderators to make the article public or not. If needsReview is set to true, then remove it from the moderator's list. If it is false leave it alone. Only moderators can call this route.
    • You should create a class function called review to change the variable from true to false
  • Create test functions in backend/tests/test_tags.py to test all the routes in backend/conduit/tags/views.py. Each route should be its own test function

Additional context

  • If modSetting is 1, then anyone can write an Article to the Tag without it review. If the modSetting is 2, the every Article needs to be reviewed before it is published. If modSetting is 3, then only Admins can post articles to the Tag.
  • You should create a class function to add users to the tag's moderator list

Update Article Editor and Dashboard Settings

Is your feature request related to a problem? Please describe.
Move the fields from the settings page to the dashboard setting component.

Figma Design

Editor page**(#1 PRIORITY)**

  • The cover image filed should be placed above the title field

  • Fix any bugs when editing the article body. Make sure that the request body matches the request body in {{APIURL}}/api/articles for creating a new article and updating the article with {{APIURL}}/api/articles/{{slug}}

  • Final design of editor

Screen Shot 2020-06-09 at 3 50 00 PM

Screen Shot 2020-06-09 at 3 50 07 PM

Screen Shot 2020-06-09 at 3 50 09 PM

  • Published button

Screen Shot 2020-06-09 at 3 50 14 PM

Screen Shot 2020-06-09 at 3 50 17 PM

Screen Shot 2020-06-09 at 3 50 20 PM

Dashboard Setting

Screen Shot 2020-06-05 at 5 34 30 PM

  • Should take the username, email and password field from components/profile/SettingsForm.tsx and transfer them to the dashboard settings component, components/profile/AccountSettings.tsx

  • The logic to update the username, email, and password and transfer it over to the components/profile/AccountSettings.tsx component. The fields should look like the component above but without the black verified tab.

  • When updating the user, make sure that the request body matches the {{APIURL}}/api/user request body

Finish organization testing routes

Is your feature request related to a problem? Please describe.
We need to finish the testing routes for organizations

Describe the solution you'd like:
Create the testing routes for:

  • update_organization
  • delete_organization
  • follow_organization
  • unfollow_organization
  • show_all_members_mods
  • promote_member
  • remove_member
  • submit_article_for_review
  • reviewed_article

Models
None

Schemas
None

API Routes
None

Endpoints HTTP Method Description Tested

Create/Edit Functions

Edit the backend/tests/test_organizations.py file to make the test cases

  • In the backend/conduit/organizations/views.py file make test functions for the following routes:
  • You should reference the examples in backend/tests/test_articles.py, backend/tests/test_tags.py and other test files to help you create the test functions
  • update_organization
  • delete_organization
  • show_all_members_mods

In the backend/tests/test_models.py file make the following test the Organization class functions:

  • You should be creating a new class called OrganizationTest and should reference the other testing functions to help you create the test functions.
  • add_moderator
  • add_member
  • remove_member
  • update_slug
  • is_member
  • moderator
  • promote
  • request_review
  • remove_review_status

Additional context

Explore pages and Article Viewing

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Figma Design

Article Display

Screen Shot 2020-05-21 at 4 56 32 PM

User Info Card

Screen Shot 2020-05-28 at 4 14 33 PM

  • This component already exists. This is the components/global/UserInfoCard.tsx file.
  • You should use the {{APIURL}}/api/profiles/{{USERNAME}} route to get information regarding the user for the user info card.

User Articles

Screen Shot 2020-05-28 at 4 14 39 PM

  • This component also already exists (It just needs to be merged into staging). EDIT It has been merged. It is called UserArticleCard in components/article/UserArticleCard.tsx
  • You should call the {{APIURL}}/api/articles?author={{USERNAME}} route to get articles based on the author
  • This should display 5 articles from the user if they have any

Like and bookmark

Screen Shot 2020-05-28 at 4 25 37 PM

  • Both of the emojis should be on the left sidebar of the article. You should be using twitter's emoji library and twitter's emoji. https://www.npmjs.com/package/react-twemoji and https://emojipedia.org/twitter/.
  • When the heart is clicked on, it should be calling the Article favorite route, {{APIURL}}/api/articles/{{slug}}/favorite if the heart is not pressed. Else call the unfavorite route, {{APIURL}}/api/articles/{{slug}}/favorite.
  • Should invert the colors as well
  • When the tag emoji is clicked on, it should call the Article Bookmark route, {{APIURL}}/api/articles/{{slug}}/bookmark and invert the color.
  • This logic already exists in the components/article/ArticlePreview.tsx file for likes. I would recommend copy the logic and alter it for bookmarks as well

Article Body

Screen Shot 2020-05-28 at 4 15 02 PM

  • In the file, there is this variable, const { article }: Article = fetchedArticle || initialArticle; which you can use to get information regarding the article. I would recommend using Postman to visualize the data you are using.

Article Features and Nested comments

Is your feature request related to a problem? Please describe.
We need to make sure that users can bookmark articles

Figma Design

Tag Explore Page

Screen Shot 2020-06-19 at 8 48 02 PM

  • Fix the tag follow button. When its clicked, it does not turn into the green button.

  • You should be editing the pages/tag/[pid].tsx

Bookmark

Screen Shot 2020-06-19 at 8 26 45 PM

  • Bookmark button

  • When the button is clicked it should call the {{APIURL}}/api/articles/{{slug}}/bookmark(POST) route to save the article to the user's bookmark list

  • This should ONLY be allowed to be clicked if the user is logged in. If not then use the ant design message component, https://ant.design/components/message/ to alert the user to log in

Nested Comments

Screen Shot 2020-06-19 at 8 35 22 PM

  • Comment Reply

  • When the reply to word is clicked, it should open an input box from ant design, https://ant.design/components/comment/. It's the last component on the page.

  • When the enter key or the submit button is clicked then use the {{APIURL}}/api/articles/{{slug}}/comments(POST) call to make a comment under the comment.

  • If the user is not logged in, then do not open the input box. Alert the user that they are not logged in with the ant design message component, https://ant.design/components/message/

Likes

Screen Shot 2020-06-20 at 6 14 19 PM

Tags tab in User dashboard

Is your feature request related to a problem? Please describe.
We need to build out the tags tab if the user is an admin for a tag.

Describe the solution you'd like
Add in the user tag settings

Figma Design

Screen Shot 2020-06-19 at 3 59 20 PM

  • Submitted Tab
  • You should be using the ArticleList component, components/global/ArticleList.tsx to display all of the articles that need to be reviewed.
  • You should use the {{APIURL}}/api/tags/{{tagSlug}}/articles/{{articleSlug}} call to reject or accept the article for the tag.

Screen Shot 2020-06-19 at 3 59 30 PM

  • Published Tab
  • You should be using the ArticleList component, components/global/ArticleList.tsx to display all of the articles that need to be reviewed.
  • You should use the {{APIURL}}/api/tags/{{tagSlug}}/articles/{{articleSlug}}(PUT) call to reject the article for the tag.

Screen Shot 2020-06-19 at 3 59 36 PM

  • Settings Tab
  • You should probably make a component called GroupSettings since this can be reused for organization settings as well.
  • Before this check if the person who has issue #90 if they completed this component. If they have use it. If not then create your own.
  • You should be using the {{APIURL}}/api/tags/{{tagSlug}}(POST) call to update the tag.
  • If mod setting is public, then send 1, if the mod setting is moderated, then send 2, and if the mod setting is private, then send 3.

Nested Comment Feauture

Is your feature request related to a problem? Please describe.
We need to have a feature where commments have nested comments.

Describe the solution you'd like

  • Add the following columns to the Comment model in backend/conduit/articles/models.py with the following fields:

    • comment_id: foreign key to a Comment. This can be nullable
    • parentComment: one to many relationship with Comment. Use backref.
  • Modify the make_comment_on_article route in backend/conduit/articles/views.py. It should now accept an optional comment_id. If the comment_id exists then make the comment_id the parent_id.

  • You need to update the comment schema to return nested comments in backend/conduit/articles/serializers.py. That way in the get_comments route in backend/conduit/articles/views.py can return nested comments

Replace review article route for organizations and tags

Is your feature request related to a problem? Please describe.
We need to make a more clear way to reject/accept articles for organization and tag moderators

Models

None

Schemas
None

API Routes

Organization Routes

  • Reject Article
  • Accept Article

Tag Routes

  • Reject Article
  • Accept Article

Endpoints | HTTP Method | Description | Tested
/api/organizations/<org_slug>/articles/<slug> | DELETE| Route to remove an article from an organization| :--:
/api/organizations/<org_slug>/articles/<slug> | PUT| Route to add an article to an organization| :--:
/api/tags/<tag_slug>/articles/<articleSlug> | DELETE| Route to remove an article from a tag | :--:
/api/tags/<tag_slug>/articles/<articleSlug> | PUT| Route to add an article to a tag | :--:

Create/Edit Functions

Remove Article from tag

  • If this route is called it should remove the targeted article from the tags needsReview column and remove it from the tag's articles column as well

Accept Article from tag

  • If this route is called it should remove the article from the needsReview column and add it to the tag's articles column.

Remove Article from organization

  • If this route is called it should remove the targeted article from the organization's pending_articles list and remove it from the organization's articles column as well

Accept Article from organization

  • If this route is called it should remove the article from the organization's pending_articles column and add it to the organization's articles column.

Additional Context

  • After implementing the above routes, remove review_article route from backend/conduit/tags/views.py and remove reviewed_article route from backend/conduit/organizations/views.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.