https://github.com/dz1kill/backend_blog
This backend implements custom CRUD, blog post CRUD, JWT token authorization.
https://github.com/dz1kill/backend_blog
docker-compose expressjs jwt nodejs postgresql seq sequelize-typescript swagger typescript
Last synced: about 1 month ago
JSON representation
This backend implements custom CRUD, blog post CRUD, JWT token authorization.
- Host: GitHub
- URL: https://github.com/dz1kill/backend_blog
- Owner: dz1kill
- Created: 2023-05-03T13:02:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T16:19:42.000Z (almost 3 years ago)
- Last Synced: 2025-02-21T19:14:18.020Z (12 months ago)
- Topics: docker-compose, expressjs, jwt, nodejs, postgresql, seq, sequelize-typescript, swagger, typescript
- Language: TypeScript
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Description
This backend implements custom CRUD, blog post CRUD, JWT token authorization.
Database structure: The 'users' table has a one-to-many relationship with the 'posts' table,
'posts' has a one-to-many relationship with the 'post_images' table.
This allows us to upload multiple images.
And if necessary, add new tables to store other types of data without changing the current structure.
Docker-compose is used to create images and organize work with PostgreSQL.
It is possible to attach images to the post.
All images are stored on cloud storage "cloudinary.com".
An unauthorized user has the ability to:
1. Registration.
2. Authorization.
3. View all registered users.
4. Viewing all posts (per-page pagination implemented).
An authorized user has the ability to:
1. Update your data.
2. Change password.
3. Create posts.
4. Upload images to posts.
5. Delete images.
6. Update posts.
7. Delete posts.
8. Viewing a list of all your posts (per-page pagination implemented).
Filling tables with data occurs through migrations.
## Stack:
Stack: Node.js, Express, Postgresql, Sequelize-typescript, Swagger, Typescript, Streamifier, Docker-compose.
## Running the app
```bash
#You need to add the .env file to the root folder of the project, add the local.json and config.json files to the config folder.
#Examples : env.text , local.json.data , config.json.data.
# In the console, run the build and launch images with the command:
$ docker-compose up
# Wait until the server starts.
# Create tables in the database using the "migrations" command:
$ docker-compose exec backend_blog npm run migrate:start
```
## Test
Documentation (Swagger UI) is available at: [link] http://localhost:3000/api/
node v16.14.2