Back-end of web forum application.
View Demo
·
Report Bug
·
Report Feature
Table of Contents
The back-end of an application that enables users to exchange information, viewpoints, experiences, and opinions on a wide range of topics.
- bcrypt: to hash password with a salt
- body-parser: to extract the information from incoming requests
- cors: to serve third-party origins
- dotenv: to retrieve .env config file
- express: web application framework for Node.js
- express-validator: to validate data from requests
- helmet: to add request HTTP headers
- http-status-codes: to return HTTP status codes
- nodemailer: connect with virtual mailbox
- sequelize: ORM
- xss-clean: to sanitaze data
These are the instructions for setting up the project locally. To get a local copy up and running, follow these simple example steps.
1. Clone this repository to your local machine
$ git clone https://github.com/swawozny/top-forum-backend
2. Install backend packages via npm
$ cd top-forum-backend
$ npm install
3. Create .env file
$ touch .env
4. Sign up for the following services
- Mailtrap:create a virtual mailbox for sending emails.
5. Store environment variables in .env file then save
#SERVER DATA
APP_HOST=SKIP
PORT=SKIP
#POSTGRESQL DATA
TEST_DB=SKIP
DEV_DB=SKIP
DB_USERNAME=SKIP
DB_PASSWORD=SKIP
DB_PORT=SKIP
DB_HOST=SKIP
#MAILTRAP DATA
MAIL_HOST=SKIP
MAIL_PORT=SKIP
MAIL_USER=SKIP
MAIL_PASSWORD=SKIP
MAIL_DEFAULT=SKIP
#JWT DATA
JWT_PRIVATE_KEY=SKIP
JWT_EXPIRATION=SKIP
6. Create database, Run migration, Add Seeder
$ npx sequelize db:create
$ npx sequelize db:migrate
$ npx sequelize db:seed:all
7. Run server
$ npm start
Server is now available under http://localhost:PORT, where PORT is the same as you define in .env file.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Sebastian Wąwoźny - [email protected]
Project Link: https://github.com/swawozny/top-forum-backend