Skip to content

Application that allows users to register, log in, and write a post on a bulletin board. Back-end only.

Notifications You must be signed in to change notification settings

marcelo-mls/post-on-the-wall-backend-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Post on the Wall - Backend (Node) JavaScript Node

This is a backend part of a Full Stack application.


Link to application frontend:


Link to another backend option to this application:

one option excludes the other

Description

This is an application that allows users to register, login and write a post on a wall.

Anonymous users can see all wall posts.

To write a post on the wall, the user needs to login.

Built With

For the development of this API was chosen Node.js v16, Express and MongoDB v6. Together, these technologies provide a powerful and flexible stack for building APIs in the backend of web applications. They allow you to write scalable, efficient, and easy-to-maintain code. Additionally, the fact that they are all written in JavaScript means that you can use the same language and tools for both the frontend and backend of your application, which can help streamline development and improve code consistency.

Node.js is a runtime environment for JavaScript that allows you to write server-side code in the same language as the client-side code. It's fast, efficient, and event-driven

Express is a minimalist and flexible framework that is built on top of Node.js. It provides a robust set of features for web applications, including routing, middleware, and HTTP utility methods.

MongoDB is a document-based NoSQL database that stores data in JSON-like documents. MongoDB is also highly scalable, and it allows you to handle large volumes of data and transactions easily.

How to Install

These instructions will provide you a complete copy of the project up and running on your local machine for development purposes.

⚠️ You must have an active MongoDB (version 6) instance running on port 27017 on your local machine.

If you use docker on your machine here is a command to quickly create a container with mongo v6

docker run --name mongodb -p 27017:27017 -d mongo:6

  1. Clone the repository:
git clone git@github.com:marcelo-mls/post-on-the-wall-backend.git
  1. Enter the repository folder you just cloned:
cd post-on-the-wall-backend
  1. Install the dependencies and start the project:
npm install
npm run dev

backend will be running on port 8000.

  1. (optional) To quickly populate the collections with some dummy data, run:
npm run db:seed

Routes

You can test the API with softwares like Insomnia, Postman or Thunder Client

Users:

  • GET: '/user' lists all users.
  • POST: '/auth/user' get a user by email. Auth token required.
  • POST: '/user' create a new user.
  • DELETE: '/user/:id' delete a user.

Posts:

  • GET: '/posts' lists all posts.
  • POST: '/posts' create a new post. Auth token required.
  • DELETE: '/posts/:id' delete a user. Auth token required.

Demonstration

⚠️ To have this view it is necessary to install and run the frontend

  • Guest view

Guest view

  • Login/Signup

2023-03-22.12-16-12.online-video-cutter.com.mp4
  • Authed user view

2023-03-22.12-19-16.online-video-cutter.com.mp4


Developed by Marcelo Marques, © 2023.

Releases

No releases published

Packages

No packages published