/Labook

Primary LanguageTypeScript

Labook

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Labook

A social media API RESTful using SQL as database .
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Features
  5. Documentation
  6. Contact

About The Project

The application provides a social media API that is RESTful, where users can sign up, log in, and edit or delete their profile. By default, all users have the "NORMAL" role, and they can only edit or delete their own profile. Only an "ADMIN" can edit the roles of other users, and only an "ADMIN" can delete the profile of other users.

Users can create, edit, view, and delete their own posts. Only the creator of a post can change the content of the post. An "ADMIN" can delete any post, including their own.

All users can view all posts or filter them by a specific user. Users must be logged in to like or dislike a post.

(back to top)

Built With

  • SQLite
  • Express
  • Node.js
  • Postman

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

  1. Read API at https://documenter.getpostman.com/view/24460683/2s93CNMsiJ

  2. Clone the repo

    git clone https://github.com/Afmjuniors/Labook.git
  3. Install NPM packages

    npm install
  4. Create tables in your own server

    src/database/database.sql
    
    Execute CREATE TABLE users
    Execute CREATE TABLE posts
    Execute CREATE TABLE likes_dislikes
    
    Execute INSERT INTO users 
    Execute INSERT INTO posts
  5. Run ther server

    npm run dev

(back to top)

Usage

Possible to simulate a simple social media plataform with users reactions. An API using CRUD methods.

For test purposes, here is an ADMIN user

{
    "email":"alexandre@email.com",
    "password":"123456@Aa"
}

(back to top)

Feats

  • User endpoints
    • Signup users
    • Login
    • Edit user
    • Delet User
  • Post endpoints
    • Get posts
    • Create new post
    • Edit post
    • Delete post
    • React to a post

(back to top)

Documentation

https://documenter.getpostman.com/view/24460683/2s93CNMsiJ

Diagram

Product Name Screen Shot

Diagram URL
https://dbdiagram.io/d/63f7e93e296d97641d835a97

Contact

Alexandre Machado - afmjuniors@gmail.com

(back to top)