Skip to content

obayomi96/xxykx-api

Repository files navigation

xxykx-api

This project creates a backend REST APIs and a UI using Node.js with Express as a framework, React.js and Redux for state management and PostgreSQL with sequelize for data persistence.

Backend:

  • A simple comments API that exposes endpoints for CRUD operations.
  • Comments should be able to have replies and all endpoints should be protected (require authentication) except the read comments endpoint.
  • Host app on Heroku.

Frontend:

  • A simple UI to consume the endpoints.
  • Host app on Netlify.

Features

API

  • POST /login
  • POST /register
  • GET /me/:user_id - (Returns the logged in user's full profile and it's comments)
  • GET /users/:user_id - (Returns another user's profile)
  • PATCH /me/:user_id
  • POST /comments
  • GET /comments - (Should return with all replies)
  • GET /comments/comment_id - (Should return a single comment, it's author and replies)
  • PATCH /comments/comment_id
  • DELETE /comments/comment_id
  • POST /comments/:comment_id/replies - (should reply to a comment)

UI

  • Sign up page.
  • Sign in page.
  • Comments page with replies. It shouldn’t require authentication to view the comments, but creating, updating and deleting should require authentication.

Getting Started

Installation

  • Clone the repository
  • run npm install
  • run npm run start to run the app in development mode
  • run migrations npm run migrate
  • run seed npm run seed
  • Navigate to localhost:xxxx on POSTMAN
  • install POSTMAN app to test API Endpoints (https://www.getpostman.com/apps)

Author

  • Martins Obayomi

About

Simple comment/reply API with authentication - for https://github.com/obayomi96/xxykx-ui

Resources

Stars

Watchers

Forks