This is an e-commerce back-end server built with NodeJs and MongoDB to serve an e-commerce front-end built with React. The API documentation can be found at API Documentation. Front-end can be found at React Ecommerce Project.
PROJECT_ISSUER
(Name of the website that will be used when sending emails)NODE_ENV
(development, production, testing)PORT
(port number for the server to run on)DEBUG
(debug level)MONGODB_URL
(string url to mongodb cluster to connect to.)ECOMMERCE_JWT_PRIVATE_KEY
(JsonWebToken private key to encrypt user tokens)LOGTAIL_SOURCE_TOKEN
(LogTail souce token to use in logging function filemiddleware\logger.js
)SENDGRID_API_KEY
(sendgrid api key used to send emails)FACEBOOK_CLIENT_ID
(client id from facebook developer account to implement facebook authentication)FACEBOOK_SECRET_KEY
(secret key from facebook developer account to implement facebook authentication)FACEBOOK_CALLBACK_URL
(url to function which will be called by facebook to get the user data)GOOGLE_CLIENT_ID
(client id from google developer account to implement google authentication)GOOGLE_SECRET_KEY
(secret key from google developer account to implement google authentication)GOOGLE_CALLBACK_URL
(url to function which will be called by google to get the user data)DSN
(DSN key from sentry for application performance monitoring and error reporting services)
- NodeJs
- express
- express-async-errors
- cookie-parser
- mongoose
- mongoose-slug-updater
- validator
- joi
- joi-objectid
- joi-password-complexity
- jsonwebtoken
- bcryptjs
- js-sha256
- passport
- passport-facebook
- passport-google-oauth
- winston
- logtail
- @logtail/node
- @logtail/winston
- @sendgrid/mail
- @sentry/node
- debug
- config
- lodash
- moment
- morgan
- helmet
- compression
- multer
- For testing jest
- MongoDB
-
First, you need NodeJS, MongoDB server (or online MongoDB Atlas) and preferably MongoDB compass to view changes in database, as well as internet connection (for the styling of the bootstrap) and at last an IDE to edit code you can use VScode. Links:
-
After installing:
- Clone or download the repository from GitHub
- Make a new file
/config/.env
and configure the Environmental variables as written or you will need to change their names in/config/custom-environment-variables.json
. - Open the project folder with VS code.
- In the integrated terminal, write the command
npm install --also=dev
to install the dependencies packages. - (optional) To seed the database with samples for testing run
npm run seed
then go to MongoDB compass and see the results. - Now run
npm run dev
in terminal to run the server. - now you can call any API from postman or the front-end.