- About
- Technology
- Get started
- API Documentation
- Functional Documentation
- Useful Scripts
- Some Features and Demo videos
- Coverage Report
- Contributors
- License
- A RESTful API that mimics the backend part of reddit.
- Reddit is a social news aggregation, content rating, and discussion website. Registered users (commonly referred to as "Redditors") submit content to the site such as links, text posts, images, and videos, which are then voted up or down by other members. Posts are organized by subject into user-created boards called "communities" or "subreddits". Submissions with more upvotes appear towards the top of their subreddit and, if they receive enough upvotes, ultimately on the site's front page. Reddit administrators moderate the communities. Moderation is also conducted by community-specific moderators.
- Node.js
- Express.js
- MongoDB
- Mongoose
- Jest
- jsdoc
- swagger to generate api documentation
- bcryptjs to encrypt passwords
- crypto to generate tokens
- multer to upload files
- nodemailer to send mails
- express rate limit to avoid DOS attacks
- Firebase Cloud Messaging for push notifications
This is an list of needed instructions to set up your project locally, to get a local copy up and running follow these instructuins.
-
Clone the repository
$ git clone https://github.com/Reddit-Replica/SW-Backend.git
-
Navigate to project folder and create file named ".env"
$ cd SW-Backend & touch .env
-
Fill ".env" file
BCRYPT_PASSWORD = your password to encrypt passwords
SALT_ROUNDS = salt rounds needed to encrypt passwords
TOKEN_SECRET = your JWT token secret
MONGO_URL = your database connection string like:mongodb://localhost:27017/Read-it
MONGO_URL_TESTING = your testing database connection string like:mongodb://localhost:27017/Read-it-test
FRONT_BASE= the frontend base url like:http://localhost:8081
(used in sending emails)
MAILGUN_API_KEY = your mailgun api key
SENDER_EMAIL = your sender email
DOMAIN= your domain
REQUEST_LIMIT= number of requests allowed in 15 minutes
MONGO_URL_SEED = your database connection string like:mongodb://localhost:27017/Read-it-seed
(data will be seeded in that database)
-
Install dependencies
$ npm install
-
Run seeder From that script
-
start application in development mode
$ npm run dev
-
Login You can login by any username and password:
12345678
- A live version here
- You can download the OpenAPI specification for that live link.
- You can generate the OpenAPI specification from that script then you will find it in
documentation.json
.
- You can generate the functional documentation from that script then you will find it in
docs/index.html
$ npm run dev
$ npm start
$ npm run test
You will find the test report in test-report.html
$ npm run coverage
you will find it in coverage/index.html
$ npm run doc
you will find it in documentation.json
$ npm run jsdoc
you will find it in docs/index.html
- Change the number of needed users, posts, messages, sunreddits, comments from
seeds/seeder.js
file in line 15, 16, 17, 18, 19 - Then run
$ npm run seed
$ npm run lint
$ npm run prettier
- Login using Google
- Login using Facebook
- Signup
- Login
- Forget password
- Forget username
- Change password
SW1.mp4
SW5.mp4
- Profile overview (posts, comments, upvotes, downvotes, etc.)
- Your Posts
- Your Comment
- Your Upvotes
- Your Downvotes
- Your Saved Posts and Comments
- Your Hidden Posts and Comments
- Your History
- Your Followers
SW4.mp4
SW5.mp4
- Create rich text post
- Create image and video post
- Create link post
- Add flair to post
- Add spoiler to post
- Add nsfw to post
- Upvote and downvote post
- Save post
- Hide post
- Share post
- Edit own post
- Delete own post
- Lock own post
SW3.mp4
SW7.mp4
- Search by post
- Search by comment
- Search by community
- Search by people
SW9.mp4
- Create rich text comment
- Nested comments up to any level
- Upvote and downvote comment
- Reply to comment
- Edit own comment
- Delete own comment
- Lock own comment
SW2.mp4
- Push notifications
- All notifications
- Send a private message
- All messages
- Unread messages
- Sent messages
- Post replies
- Usernames mentions
- Delete message
- Spam message
- Reply to message
SW6.mp4
- Queues
- Spamed (posts only, comments only, posts and comments)
- Edited (posts only, comments only, posts and comments)
- Unmoderated (posts only, comments only, posts and comments)
- User management
- Banned users
- Muted user
- Approved user
- Moderators
- Flairs and emojis
- Add new flair
- Edit flair
- Delete flair
- Reorder flairs
- Rules and regulations
- Add new rule
- Edit rule
- Delete rule
- Reorder rules
- Community settings
- Edit community name
- Edit community description
- Edit community topic
- Edit community language
- Edit community type (Public, Private, Restricted)
- Edit community region
- Posts & Comments settings
- Enable/disable community Spoiler tag
- Edit suggested sort for posts
- Enable/disable image in posts
- Community traffic
- Day of week
- Month
- Page views
- Members joined
- Members left
SW8.mp4
Zeyad Tarek |
Abdelrahman Hamdy |
Abdelrahman Noaman |
Beshoy Morad |
This software is licensed under MIT License, See License for more information.