An open API service indexing awesome lists of open source software.

https://github.com/rafamguedes/codersblog

This project involves developing a Node.js API using the Sequelize package to perform CRUD operations on blog posts. The application also includes implementing user authentication and associating users, posts, and categories.
https://github.com/rafamguedes/codersblog

chai jwt-authentication mocha nodejs postgresql reactjs sequelize-orm sinon testing-library typescript vitest

Last synced: 2 months ago
JSON representation

This project involves developing a Node.js API using the Sequelize package to perform CRUD operations on blog posts. The application also includes implementing user authentication and associating users, posts, and categories.

Awesome Lists containing this project

README

        

Coders Blog 👩‍💻


Node
Express
TypeScript
Postgre
Sequelize
JWT
Docker


Mocha
Chai
Sinon
ESLint


React
Testing Library
React Router
Styled Components





## ➡️ Project Description

This project involves developing a Node.js API using the Sequelize package to perform CRUD operations on blog posts. The application also includes implementing user authentication and associating users, posts, and categories.

Deploy: [Coders Blog!](https://codersblogg.vercel.app/)


## ➡️ Technologies

### ▶️ Back-end:

```
NodeJS, TypeScript, JWT, Sequelize, PostgreSQL, Mocha, Sinon, Chai and Docker
```

### ▶️ Front-end:

```
ReactJS, TypeScript, Vite, Vitest, Testing Library and Axios
```


## ➡️ Features

### ▶️ RESTful Endpoints:

Implementation of endpoints to perform CRUD operations on posts.

### ▶️ User Authentication:

Creation of posts requires user authentication.

### ▶️ User-Post Relationship:

Establishment of a relationship between users and posts, ensuring each post is associated with a specific user.

### ▶️ Post-Category Relationship:

Use of categories to classify posts, establishing a relationship between posts and categories. Each post can belong to one or more categories.


## ➡️ Project Setup

### ▶️ Dependency Installation:
```
1. npm run install:apps - to install necessary dependencies.
2. npm run compose:up - to start the backend container and database.
3. npm run dev - to start the frontend
```

### ▶️ Database Configuration:
```
- Configure the database connection information in the config/database.js file.
```

## ➡️ Endpoints

### ▶️ User
```
- POST /user - Create a new user
- GET /user - Get all users. (requires authentication)
- GET /user/:id - Get user by ID. (requires authentication)
- PUT /user/:id - Update user. (requires authentication)
- DELETE /user:id - Delete user. (requires authentication)
```

### ▶️ Post
```
- GET /post: Retrieves the list of all posts.
- GET /post/search: Search for a post using a string
- POST /post: Creates a new post. (requires authentication)
- GET /post/:id: Retrieves details of a specific post. (requires authentication)
- PUT /post/:id: Updates an existing post. (requires authentication)
- DELETE /post/:id: Deletes an existing post. (requires authentication)
```

### ▶️ Categories
```
- POST /categories - Create a new category. (requires authentication)
- GET /categories - Get all categories. (requires authentication)
- PUT /categories/:id - Update category. (requires authentication)
- DELETE /categories/:id - Delete category. (requires authentication)
```
### ▶️ Authentication
```
- POST /login: Performs user login.
- GET /login/role: Get the user role. (requires authentication)
```

## ➡️ ScreenShots

### ▶️ Home Page


### ▶️ Single Post Page


### ▶️ Login Page


### ▶️ Dashboard Page


### ▶️ Create Post Page


### ▶️ Edit Post Page


### ▶️ Tags Page


### ▶️ Profile Page