Giter Site home page Giter Site logo

heticiens.news's Introduction

heticiens.news 2.0

Ce dépôt git contient le code source de la web app d'HETIC Newsroom, heticiens.news.

heticiens.news's People

Contributors

arnaudmg avatar dependabot[bot] avatar gitsquared avatar satwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

heticiens.news's Issues

Fallback pour bouton partager

Sur les navigateurs qui ne supportent pas Navigator.share(), il n'y a pas de fallback pour partager articles ou auteurs.

UI back-office 1.0

Tasklist 🚀

  • Réactiver la page de login
  • Page de publication basique avec CKeditor, qui envoie les données à l'endpoint de publication
  • Page où l'on peut éditer son profil, son mot de passe
  • Modération:
    • Changer la page d'édition pour enregistrer en draft, plutôt que publier directement,
    • Donner aux modérateurs l'accès à une page spéciale qui list les articles en draft et permet de les valider

Documentation APIs à utiliser

Voir #20

No categ on about page

Hi guys,

I think may be an error with the filter function because on the /about page, I don't see the categories inside the menu.

pageProps: {
categories: [],
...pageProps
}

At first, I thought about L47-49, but SSR is working well on this page.

It's maybe a bug elsewhere, but I didn't try to make tests in local, I didn't find the install readme 😛

Have fun!

Screenshot
Capture d’écran 2021-03-01 à 15 20 19

Add warning on article previews

Currently you can directly access an unpublished article using the /article/[id] route.

It would be great to display a small warning message at the top indicating that it is a preview of unpublished material.

API Back-office 1.0

Needed API endpoints

  • Authentication
  • Account edition
  • Draft proposal
  • Draft validation by moderators
    • Publish right away if enough votes
      • Add data to Contributors and Articles tables using a DynamoDB all-or-nothing transaction
    • Send an email to the newsletter
  • Edition/removal of published material

Documentation

/api/auth:

  • GET: Validate token
    • Query: URL params ?token=[token]
    • Response:
      • 200 OK => {token: newtoken}
      • 400 BAD INPUT
      • 404 NOT FOUND
      • 410 EXPIRED
  • POST: Create token
    • Query: JSON body
      {
      	"email": "email address",
      	"password": "cleartext password"
      }
    • Response:
      • 201 CREATED => {token: newToken}
      • 400 BAD INPUT => {error: 'Bad email format' || 'Bad password format'}
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/contributor/[id]:

  • GET: Get contributor object. If token is provided, get full object (including email and moderator status).
    • Query: URL params ?token=[token]
    • Response:
      • 200 OK => Contributor
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/contributor/[id]/articles:

  • GET: Get published articles of contributor [id]
    • Query: URL params (optional: ?count=[number])
    • Response:
      • 200 OK => {articles: article[]}
      • 404 NOT FOUND

/api/contributor/[id]/drafts:

  • GET: Get drafts of contributor [id]
    • Query: URL params ?token=[token] (optional: &count=[number])
    • Response:
      • 200 OK => {drafts: article[]}
      • 404 NOT FOUND

/api/contributor/[id]/drafts/new:

  • POST: Submit new article proposal (see Article type)
    • Query: JSON body
      {
      	"token": "token",
      	"draft": {
      		authors: Array<authorId | email>,
      		title: string,
      		category: string,
      		intro: string,
      		content: HTMLstring,
      		image: "base64-encoded image"
      	}
      }
    • Response:
      • 201 CREATED => {draft: 'articleId'}
      • 400 BAD INPUT =>
         {
         	error:  'Missing or incorrect fields' |
         			'Could not find contributor [id | email]' |
         			'Bad image format'
         }
        
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/contributor/[id]/edit:

  • POST: Edit contributor information
    • Query: JSON body
      {
      	"token": "token",
                  
      	"new": {
      		"name": string?,
      		"email": string?,
      		"picture": base64?,
      		"bio": string?,
      		"password": string?,
                          "social": Object<Name, URL>
      	}
      }
    • Response:
      • 200 OK
      • 400 BAD INPUT => {error: 'error message'}
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/article/[id]/edit:

  • POST: Edit an article (draft or published)
    • Query: JSON body
      {
      	"token": "token",
      	"article": {
      		authors: Array<authorId | email>,
      		title: string,
      		category: string,
      		intro: string,
      		content: HTMLstring,
      		image: "base64-encoded image | url"
      	}
      }
    • Response:
      • 200 OK
      • 400 BAD INPUT => {error: 'error message'}
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/article/latest:

  • GET: Get latest published articles
    • Query: URL params (optional: ?count=[number])
    • Response:
      • 200 OK => {articles: article[]}
      • 404 NOT FOUND

/api/article/latest/[category]:

  • GET: Get latest published articles in category
    • Query: URL params (optional: ?count=[number])
    • Response:
      • 200 OK => {articles: article[]}
      • 404 NOT FOUND

/api/article/drafts:

  • GET: Get all unpublished articles
    • Query: URL params ?token=[token] (optional: &count=[number])
    • Response:
      • 200 OK => {drafts: article[]}

/api/article/[id]/approve:

  • GET: Approve article, as a moderator
    • Query: URL params ?token=[token]
    • Response:
      • 200 OK
      • 201 CREATED - this was the last approval needed, article has been published
      • 400 BAD INPUT => {error: 'Not a draft'}
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/article/[id]/edit:

  • POST: Edit published article, as a moderator
    • Query: JSON body
      {
      	"token": "token",
      	"article": Partial<Article>
      }
    • Response:
      • 200 OK
      • 400 BAD INPUT
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

/api/article/[id]/remove:

  • GET: Delete published or draft article, as a moderator. Will require email confirmation
    • Query: URL params ?token=[token]
    • Response:
      • 200 OK
      • 404 NOT FOUND
      • 403 UNAUTHORIZED

Allow contributor creation by moderators

Provide an endpoint to create new contributors (eg. api/contributor/new) accessible to moderators with level 2.
Provide an UI.

Probable refactor: some if statement compares if moderator status level strictly equals 1 (instead of >=).

Optimize SEO

Add JSON-LD Schema tags to improve ranking.
Suggested tags: Article, Organization

Look at schema.org

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.