https://github.com/5hraddha/around-express
Around the U.S. - Back End is a project to create a Node.js server with REST API endpoints to serve all the data requests of the Around the U.S. - Frontend React Project.
https://github.com/5hraddha/around-express
airbnb-eslint api backend eslint express nodejs nodejs-server
Last synced: about 2 months ago
JSON representation
Around the U.S. - Back End is a project to create a Node.js server with REST API endpoints to serve all the data requests of the Around the U.S. - Frontend React Project.
- Host: GitHub
- URL: https://github.com/5hraddha/around-express
- Owner: 5hraddha
- Created: 2022-01-06T03:38:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-01T00:55:41.000Z (over 4 years ago)
- Last Synced: 2025-11-18T16:35:05.462Z (7 months ago)
- Topics: airbnb-eslint, api, backend, eslint, express, nodejs, nodejs-server
- Language: JavaScript
- Homepage:
- Size: 266 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project: Around the U.S. Back End
## About the Project
**Around the U.S. - Back End** is a project to create a Node.js server with REST API endpoints to serve all the data requests of the [Around the U.S. - Frontend React Project](https://github.com/5hraddha/around-react).
## Technologies and Standards Used
**The technologies that have been used are:**
1. Node.js
2. Express Framework (for development)
3. Postman (for testing API endpoints)
4. EsLint
5. MongoDB
### 
- **Node** (or more formally *Node.js*) is an *open-source*, *cross-platform* runtime environment that allows developers to create all kinds of server-side tools and applications in JavaScript.
- *Node. js* is primarily used for non-blocking, event-driven servers, due to its single-threaded nature.
- It's used for traditional web sites and back-end API services.
### 
- **Express** is the most popular Node web framework, and is the underlying library for a number of other popular Node web frameworks.
- It provides mechanisms to:
- Write handlers for requests with different HTTP verbs at different URL paths (routes).
- Integrate with "view" rendering engines in order to generate responses by inserting data into templates.
- Set common web application settings like the port to use for connecting, and the location of templates that are used for rendering the response.
- Add additional request processing "middleware" at any point within the request handling pipeline.
### 
- **Postman** is an API client that makes it easy for developers to create, share, test and document APIs.
- This is done by allowing users to create and save simple and complex HTTP/s requests, as well as read their responses.
### 
- **ESLint** is an open-source Javascript linting utility used to find problematic patterns or code that doesn’t adhere to certain style guidelines.
- We are using [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
### 
- **MongoDB** is a document database with the scalability and flexibility that the customer wants with the querying and indexing that the customer needs.
- MongoDB stores data in flexible, JSON-like documents.
- The document model maps to the objects in the application code, making data easy to work with.
- MongoDB is a distributed database at its core, so high availability, horizontal scaling, and geographic distribution are built in and easy to use.
- MongoDB is free to use.
## Directory Structures
The project has the following directory structure:
| Directory | Purpose |
|--- |--- |
| `/models` | Contains all MongoDB schemas and models - all data layers. |
| `/routes` | Contains routing files. |
| `/controllers` | Contains all the route handler callbacks. |
| `/utils` | Contains all the helper methods for general purpose tasks. |
## REST API Endpoints
| HTTP Methods | REST API Endpoint | Purpose |
|--------------|------------------------|----------------------------------------|
| `GET` | `/users` | Get JSON list of all the users |
| `GET` | `/users/:userId` | Get a specific user profile with an ID |
| `POST` | `/users` | Create a specific user profile |
| `PATCH` | `/users/me` | Update the current user profile |
| `PATCH` | `/users/me/avatar` | Update the current user avatar |
| `GET` | `/cards` | Get JSON list of all the cards |
| `POST` | `/cards` | Create a new card |
| `DELETE` | `/cards/:cardId` | Delete a card by the given ID |
| `PUT` | `/cards/:cardId/likes` | Update a card by liking it |
| `DELETE` | `/cards/:cardId/likes` | Delete a like on the card |
## Running the Project
| Command | Purpose |
|--- |--- |
| `npm run start` | To launch the server |
| `npm run dev` | To launch the server with the hot reload feature |