Skip to content

[Old project] Back-end of fullstack application built using Node.js, Express.js and MongoDB.

Notifications You must be signed in to change notification settings

Viniski/RealMadryt.pl-by-Viniski-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RealMadryt.pl by Viniski

BACK-END

Fullstack application inspired by realmadryt.pl. The application front was written using React.js. While the back end was written using Node.js, Express.js and the data was stored in the MongoDB database.

This repository contains the back end part of the my application. You can find the front end here: https://github.com/Viniski/RealMadryt.pl-by-Viniski-frontend

🔧 Descriptions and Technical

  • The back end of the application was built, the API connecting to the front end was designed in accordance with the REST standard.
  • The API allows you to save new articles in the database, download them, increment or decrement their number (which takes place in the application view after refreshing the entire application), add, delete, edit comments.
  • Thanks to the use of nodemailer, it allows you to send welcome emails to new users registering through the portal.
  • The API also allows registration, logging in, changing the password or logging out, all with validation also placed on the backend.
  • Json Web Token is created, which are used for authentication using acessTokens (expiring after 15 minutes) and erfreshToken (expiring after 24 hours).
  • Unfortunately, after logging in and refreshing the page, you will not be logged in, because the free site I use for deployment is on the public suffix list, which prevents cookies from working properly.
  • To take advantage of this facility, run the site locally on your computer.
  • JWT is stored in cookies on the front end with the httpOnly flag set so that you can read the JWT from the browser on the front end.
  • Passport.js was used to log in via external portals (google, github).
  • The login status is stored in the session, which expires after 15 minutes, after which you must log in again. Postman was used to test the API.
  • The database used is mongoDB, initially I used it locally on my computer, now the database is located on a remote cloud MongoDB atlas.
  • JEST and React Testing used to test the front-end of application. (being developed)

💻 Built With

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • REST API
  • Bcrypt
  • Body-parser
  • Cookie-parser
  • Cookie-session
  • Jsonwebtoken
  • Passport
  • Nodemailer
  • Dotenv
  • Randomstring

🚀 Demo

You can find a demo of the application in the frontend repository.

If you want running on your computer:

The frontend and backend are separate projects -- first start the backend

npm install
node index.js

Start the frontend (which is in another repository) in a new terminal

npm install
npm run start

📃 License

This project is licensed under the MIT License.

About

[Old project] Back-end of fullstack application built using Node.js, Express.js and MongoDB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published