This project is a full-stack application that allows users to create blogs, comment on them, and like them. The front-end is built using Angular, and the back-end is developed with Express.js.
- User authentication (signup, login, logout)
- Create, read, blogs
- Comment on blogs and delete comments
- Like and unlike blogs
- Responsive design
-
Front-end:
- Angular
- Angular Material
- Bootstrap
- PopperJS
- JQuery
- TypeScript
-
Back-end:
- Express.js
- Node.js
- SQLite3
Make sure you have the following installed on your machine:
- Node.js (v14 or later)
- npm (v6 or later)
- Angular CLI (v12 or later)
- SQlite3
- tsc (Typescript compiler)
-
Clone the repository:
git clone https://github.com/daliborstakic/blogpost-app.git cd blogpost-app
-
Install dependencies for both front-end and back-end
cd blogpost-front npm install cd blogpost-api npm install
-
Start the back-end server
cd blogpost-api ts-node src/app.ts
The server will be started at
localhost:3000
-
Start the front-end server
cd blogpost-front ng serve
The front-end server will be running at
localhost:4200
GET /status
- Returns the status of the server.
-
GET /user/:id
- Retrieves a user by their ID.
-
GET /users
- Retrieves all users.
-
POST /user
- Creates a new user.
-
GET /users/:username
- Retrieves a user by their username.
-
GET /blogs
- Retrieves all blog posts with likes.
-
GET /blogs/:userId
- Retrieves all blog posts by a specific user ID.
-
GET /blogs-search/:query
- Searches for blog posts based on a query.
-
POST /blog
- Creates a new blog post.
-
GET /blog/:blogId
- Retrieves a blog post by its ID.
-
POST /like
- Likes a blog post.
-
DELETE /unlike
- Unlikes a blog post.
-
POST /isLiked
- Checks if a blog post is liked by a user.
-
GET /likesCount/:postId
- Retrieves the count of likes for a blog post.
-
POST /comment
- Adds a comment to a blog post.
-
GET /comments/:blogpostId
- Retrieves comments for a specific blog post.
-
DELETE /comment/:id
- Deletes a comment by its ID.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements.
* Create a new branch (git checkout -b feature-branch)
* Commit your changes (git commit -m 'Add some feature')
* Push to the branch (git push origin feature-branch)
* Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.