Skip to content

This api recreates a fictional database where users can register, log post and like post.

Notifications You must be signed in to change notification settings

ariusvi/social_network_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔹 Social Network api 🔹

social_network_img
Welcome to the Social Network's api documentation. This api recreates a fictional database where users can register, log post and like post.

Table of content 📂
  1. Deploy 🚀
  2. Stack ⚓
  3. Diagram Database 🌐
  4. Local installation 💻
  5. Users created 👓
  6. Endpoints ✨
  7. Author ✒️
  8. Acknowledgements 🙏

Deploy 🚀

Stack ⚓

Tecnologies used:

Static Badge
Static Badge Static Badge Static Badge
Static Badge

Diagram Database 🌐

'imagen-db'

Local installation 💻

  1. Clon repository
    $ npm init --yes
  2. Instal express
    $ npm i express
  3. Instal nodemon
    $ npm i nodemon -D $ npm i dotenv -E
  4. Add type module into package.json
{
  "type": "module"
}
  1. Instal mongoose
    $ npm i mongoose
  2. Instal bcrypt
    $ npm i bcrypt
  3. Instal webtoken
    $ npm i jsonwebtoken

Users created 👓

  1. User - role: user
{
  "name": "user",
  "email": "[email protected]",
  "password": "123456"
}
  1. Admin - role: admin
{
  "name": "admin",
  "email": "[email protected]",
  "password": "123456"
}
  1. Superadmin - role: superadmin
{
  "name": "superadmin",
  "email": "[email protected]",
  "password": "123456"
}

Endpoints ✨

Auth
User Registration - Register new user
Registers a new user.

    POST https://social-network-backend-dev-npdx.2.ie-1.fl0.io/api/auth/register

Body:
{
  "name": "user",
  "email": "[email protected]",
  "password": "123456"
}
User Login
{
  "email": "[email protected]",
  "password": "123456"
}
User
Get Users
{
  "email": "[email protected]",
  "password": "123456"
}
Get User's Profile
{
  "email": "[email protected]",
  "password": "123456"
}
Update User's Profile
{
  "email": "[email protected]",
  "password": "123456"
}

Body:

{
  "name": "newname",
}
Delete User
{
  "email": "[email protected]",
  "password": "123456"
}
Get post by User's id
{
  "email": "[email protected]",
  "password": "123456"
}
Post
Create Post
{
  "email": "[email protected]",
  "password": "123456"
}

Body:

{
  "title": "Post's title",
  "text": "Post's text"
}
Update Post
{
  "email": "[email protected]",
  "password": "123456"
}

Body:

{
  "title": "Post's title updated",
  "text": "Post's text updated"
}
Delete Post
{
  "email": "[email protected]",
  "password": "123456"
}
Get Posts
{
  "email": "[email protected]",
  "password": "123456"
}
Get Post by id
{
  "email": "[email protected]",
  "password": "123456"
}
Get Own Posts
{
  "email": "[email protected]",
  "password": "123456"
}
Like/Unlike post
{
  "email": "[email protected]",
  "password": "123456"
}

Author ✒️

  • Ana Rius - student FSD

Acknowledgements 🙏

Special thanks to Daniel Tarazona for his incredible work as a teacher and above all for his infinite patience in helping to resolve any doubts and calm the panic.

Thanks to my classmates:
Pedro for his patience and help, especially to confirm that I understand things.
Marina and Marta for her moral support, with laughter and tears, as well as their help.

About

This api recreates a fictional database where users can register, log post and like post.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published