This is a backend part of a Full Stack application.
Link to application frontend:
- Frontnd with
React
: post-on-the-wall/frontend/react
Link to another backend option to this application:
- Backend with
Django Rest Framework
: post-on-the-wall/backend/django
one option excludes the other
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.
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.
These instructions will provide you a complete copy of the project up and running on your local machine for development purposes.
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
- Clone the repository:
git clone git@github.com:marcelo-mls/post-on-the-wall-backend.git
- Enter the repository folder you just cloned:
cd post-on-the-wall-backend
- Install the dependencies and start the project:
npm install
npm run dev
backend will be running on port 8000.
- (optional) To quickly populate the collections with some dummy data, run:
npm run db:seed
You can test the API with softwares like Insomnia
, Postman
or Thunder Client
- 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.
- GET:
'/posts'
lists all posts. - POST:
'/posts'
create a new post. Auth token required. - DELETE:
'/posts/:id'
delete a user. Auth token required.
2023-03-22.12-16-12.online-video-cutter.com.mp4
2023-03-22.12-19-16.online-video-cutter.com.mp4
Developed by Marcelo Marques, © 2023.