A social media API RESTful using SQL as database .
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
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.
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.
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
-
Read API at https://documenter.getpostman.com/view/24460683/2s93CNMsiJ
-
Clone the repo
git clone https://github.com/Afmjuniors/Labook.git
-
Install NPM packages
npm install
-
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
-
Run ther server
npm run dev
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"
}
- User endpoints
- Signup users
- Login
- Edit user
- Delet User
- Post endpoints
- Get posts
- Create new post
- Edit post
- Delete post
- React to a post
https://documenter.getpostman.com/view/24460683/2s93CNMsiJ
Diagram URL
https://dbdiagram.io/d/63f7e93e296d97641d835a97
Alexandre Machado - afmjuniors@gmail.com