Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdelrahman0122/postsapp
Social media App using NodeJs For Documentation: https://documenter.getpostman.com/view/27173297/2s9YJgULVf
https://github.com/abdelrahman0122/postsapp
bcrypt cloudinary express joi jsonwebtoken mongoose multer nodemailer
Last synced: 1 day ago
JSON representation
Social media App using NodeJs For Documentation: https://documenter.getpostman.com/view/27173297/2s9YJgULVf
- Host: GitHub
- URL: https://github.com/abdelrahman0122/postsapp
- Owner: Abdelrahman0122
- Created: 2023-10-06T23:12:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-08T11:52:43.000Z (6 months ago)
- Last Synced: 2024-10-12T18:26:15.856Z (about 1 month ago)
- Topics: bcrypt, cloudinary, express, joi, jsonwebtoken, mongoose, multer, nodemailer
- Language: JavaScript
- Homepage:
- Size: 373 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostsApp
PostsApp is a social media application built using Node.js.
## Table of Contents
- [Features](#features)
- [Technologies Used](#technologies-used)
- [Getting Started](#getting-started)
- [Installation](#install-the-dependencies)
- [Setting Up Environment Variables](#set-up-the-environment-variables)
- [API Documentation](#api-endpoints)
- [Post Routes](#post-routes)
- [Comment Routes](#comment-routes)
- [Auth Routes](#auth-routes)## Features
- User registration and authentication
- Create, edit, and delete posts
- Like and comment on posts
- Profile management
- Upload and manage profile pictures
- Email notifications
- Detect online users## Technologies Used
- Node.js
- Express.js
- MongoDB
- Mongoose
- Joi (for input validation)
- Bcrypt (for password hashing)
- Cloudinary (for image upload and management)
- JSON Web Tokens (JWT) (for authentication)
- Multer (for file uploading)
- Nodemailer (for sending email notifications)## Getting Started
To get started with the PostsApp application, follow these steps:
1. Clone the repository:
```
git clone https://github.com/Abdelrahman0122/PostsApp.git
```
2. Navigate to the project directory:```
cd PostsApp
```
3. install npm package:```bash
npm install
```## Set up the environment variables:
- Create a .env file in the root directory of the project.
- Define the following environment variables in the .env file:
- PORT - The port number on which the server will run.
- MONGODB_URI - The URI for connecting to the MongoDB database.
- JWT_SECRET - The secret key used for JWT token generation.
- CLOUDINARY_NAME - Your Cloudinary cloud name.
- CLOUDINARY_API_KEY - Your Cloudinary API key.
- CLOUDINARY_API_SECRET - Your Cloudinary API secret.
- EMAIL_USERNAME - Your email account username.
- EMAIL_PASSWORD - Your email account password.
- EMAIL_HOST - The SMTP host for your email account.
- EMAIL_PORT - The SMTP port for your email account# PostsApp API Documentation
This repository contains the backend code for the PostsApp, a social media application built with Node.js.
## API Endpoints
### Post Routes
- `POST /addPost`: Create a new post.
- `GET /getAllPosts`: Get all posts.
- `GET /getPostsByUser/:id`: Get posts by a specific user.
- `GET /getSinglePost/:id`: Get a single post by its ID.
- `PUT /updatePost/:id`: Update a post by its ID.
- `DELETE /deletePost/:id`: Delete a post by its ID.
- `GET /getPrivatePosts`: Get private posts.
- `POST /likePost/:id`: Like a post by its ID.### Comment Routes
- `POST /addComment`: Add a new comment.
- `GET /getAllComments/:id`: Get all comments for a specific post.
- `PATCH /editComment/:id`: Edit a comment by its ID.
- `DELETE /deleteComment/:id`: Delete a comment by its ID.### Auth Routes
- `POST /signUp`: User sign-up.
- `POST /signIn`: User sign-in.
- `POST /logout`: User logout.
- `POST /changePassword`: Change user password.
- `POST /forgetPassword`: Request password reset.
- `POST /resetPassword`: Reset user password.