Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update for production #318

Merged
merged 92 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
705ef96
deleted createOrg.ts and createOrg.services.ts, renamed OrgServices.t…
fawizzy Jul 23, 2024
ff69322
deleted the createOrg.ts in the route folder and included the route i…
fawizzy Jul 23, 2024
30fd548
completed the create organization endpoint
fawizzy Jul 23, 2024
4d6db83
resolve conflicts
fawizzy Jul 23, 2024
23dc178
Merge branch 'dev' of https://github.com/fawizzy/hng_boilerplate_expr…
fawizzy Jul 23, 2024
afb7471
added orgRouter to index file
fawizzy Jul 23, 2024
97ed5a5
test added
fawizzy Jul 23, 2024
9c0664c
test added
fawizzy Jul 23, 2024
58593de
fixed a bug
fawizzy Jul 23, 2024
d1e5dee
merge conflict resolved
fawizzy Jul 23, 2024
0685553
Merge branch 'hngprojects:dev' into create_organization
fawizzy Jul 23, 2024
b26d852
Merge branch 'dev' into create_organization
fawizzy Jul 24, 2024
20b1d21
Update OrgController.ts
fawizzy Jul 24, 2024
fa5f75f
Update organisation.service.ts
fawizzy Jul 24, 2024
ccc62b5
Update OrgController.ts
fawizzy Jul 24, 2024
3c0584a
Update OrgController.ts
fawizzy Jul 24, 2024
7ad6f44
Update organisation.service.ts
fawizzy Jul 24, 2024
eb2ed59
Update organisation.service.ts
fawizzy Jul 24, 2024
ec7374e
Update OrgController.ts
fawizzy Jul 24, 2024
9a4b9de
Merge branch 'dev' into create_organization
fawizzy Jul 24, 2024
3e99b2a
Update OrgController.ts
fawizzy Jul 24, 2024
9fb1421
Update organisation.service.ts
fawizzy Jul 24, 2024
357c98f
Update organisation.service.ts
fawizzy Jul 24, 2024
f9191c8
Update organisation.service.ts
fawizzy Jul 24, 2024
19a2b19
Update organisation.spec.ts
fawizzy Jul 24, 2024
02fd70d
Update organisation.spec.ts
fawizzy Jul 24, 2024
2d203ce
Update organisation.spec.ts
fawizzy Jul 24, 2024
92b40ec
Update organisation.spec.ts
fawizzy Jul 24, 2024
e09c935
Update organisation.spec.ts
fawizzy Jul 24, 2024
b1db83a
Merge pull request #213 from hngprojects/chore/husky-setup
Idimmusix Jul 24, 2024
1288e38
feat: updated package.json file
DOOMSDAY101 Jul 24, 2024
3f348d1
feat: updated package.json
DOOMSDAY101 Jul 24, 2024
d4c90c6
Merge branch 'dev' of https://github.com/DOOMSDAY101/hng_boilerplate_…
DOOMSDAY101 Jul 24, 2024
62d8d61
feat: endpoint to create a comment on a blog post
myconpeter Jul 24, 2024
17b583f
feat: endpoint to create a comment on a blog post
myconpeter Jul 24, 2024
88a6099
feat: endpoint to create a comment on a blog post
myconpeter Jul 24, 2024
da3a494
feat: create product feature
Benson-Ogheneochuko Jul 24, 2024
49c614b
feat: add payment method using lemonsqueezy
DOOMSDAY101 Jul 24, 2024
1be333d
feat: create documentation for user routes
masterchief-Dave Jul 24, 2024
6704f25
feat: create documentation for user routes
masterchief-Dave Jul 24, 2024
495036c
feat:swagger documentation for email-routes
Jaytechent Jul 24, 2024
e041e53
feat: payment method using lemonsqueezy
DOOMSDAY101 Jul 24, 2024
145bd5c
Merge branch 'dev' into feat/19-implement-backend-for-notification-se…
DOOMSDAY101 Jul 24, 2024
682e04e
feat: Implement endpoint to create a comment on a blog post
myconpeter Jul 24, 2024
36fc50a
feat: payment method using lemonsqueezy
DOOMSDAY101 Jul 24, 2024
5f172c3
Merge branch 'dev' into MYCON
myconpeter Jul 24, 2024
aa64054
Merge branch 'dev' into MYCON
myconpeter Jul 24, 2024
e9b7a32
Merge pull request #289 from hngprojects/feat-authentication/update-u…
incredible-phoenix246 Jul 24, 2024
161af4e
Merge branch 'dev' of github.com:hngprojects/hng_boilerplate_expressj…
incredible-phoenix246 Jul 24, 2024
b1a2f13
Merge branch 'dev' into feat/19-implement-backend-for-notification-se…
DOOMSDAY101 Jul 24, 2024
dcae255
fix: mock env variables
Uzo-Felix Jul 24, 2024
a0b4bef
Merge branch 'dev' into feat/19-implement-backend-for-notification-se…
DOOMSDAY101 Jul 24, 2024
fa84a3d
feat: get a single user data by superadmin
PreciousIfeaka Jul 24, 2024
7eb6842
fix: fixes for env
incredible-phoenix246 Jul 24, 2024
6eb67a9
Merge branch 'dev' into feat/payment-using-flutterwave
Uzo-Felix Jul 24, 2024
92af897
Merge pull request #299 from DOOMSDAY101/feat/19-implement-backend-fo…
incredible-phoenix246 Jul 24, 2024
fd6d23e
Merge branch 'dev' into feat/payment-using-flutterwave
Uzo-Felix Jul 24, 2024
3da74ec
Merge pull request #283 from Jaytechent/feature/docs-email-routes
incredible-phoenix246 Jul 24, 2024
328ef79
Merge branch 'hngprojects:dev' into feat/payment-using-flutterwave
Uzo-Felix Jul 24, 2024
34d128c
fix(server): resolved conflict
fawizzy Jul 24, 2024
099d36a
fix: resolve merge conflict
Uzo-Felix Jul 24, 2024
6bd76b2
Merge pull request #293 from Uzo-Felix/feat/payment-using-flutterwave
incredible-phoenix246 Jul 24, 2024
73fe4b2
chore: corrected merge conflict
PreciousIfeaka Jul 24, 2024
020aa29
fix: resolved conflict
fawizzy Jul 24, 2024
837f388
Merge branch 'dev' into create_organization
fawizzy Jul 24, 2024
51c5c0f
chore: corrected merge conflict
PreciousIfeaka Jul 24, 2024
d3d82ba
chore: created openapi documentation for the endpoint
PreciousIfeaka Jul 24, 2024
ffa4de5
feat: added create organisation router
fawizzy Jul 25, 2024
b05d298
Merge pull request #305 from PreciousIfeaka/feat/238-retrieve_user_da…
incredible-phoenix246 Jul 25, 2024
fcedce9
Merge pull request #304 from fawizzy/create_organization
incredible-phoenix246 Jul 25, 2024
3fd8dc8
feat(users): added swagger docs for all users route
SamixYasuke Jul 25, 2024
b9a13ca
docs: add LemonSqueezy payment docs
DOOMSDAY101 Jul 25, 2024
c1331a4
feat: create org docs
fawizzy Jul 25, 2024
3ede37d
feat: create org docs done
fawizzy Jul 25, 2024
276bcbe
Create blog.md
devffery Jul 25, 2024
1daafc0
Update blog.ts
devffery Jul 25, 2024
e7a3b51
feat: swagger documentation for blog endpoints
devffery Jul 25, 2024
a5f6a3e
Merge pull request #312 from devffery/feat/docs-blog-routes
highb33kay Jul 25, 2024
f82e1a2
Merge pull request #307 from SamixYasuke/feat/#120-retrieve-authentic…
highb33kay Jul 25, 2024
491b595
Merge pull request #309 from fawizzy/feat/org_docs
highb33kay Jul 25, 2024
4b557de
chore: merge dev branch to feature/api-user-docs branch
masterchief-Dave Jul 25, 2024
2f89f1c
Merge pull request #308 from DOOMSDAY101/dev
incredible-phoenix246 Jul 25, 2024
adba118
Merge pull request #280 from masterchief-Dave/feature/api-user-docs
incredible-phoenix246 Jul 25, 2024
568e65e
fix: fixed conflict
Benson-Ogheneochuko Jul 25, 2024
8600a56
Merge branch 'dev' of github.com:hngprojects/hng_boilerplate_expressj…
incredible-phoenix246 Jul 25, 2024
adb1950
feat: Implement endpoint to create a comment on a blog post"
myconpeter Jul 25, 2024
9cd1e0d
fix: fixes on production deploymeny
incredible-phoenix246 Jul 25, 2024
924d396
Merge pull request #315 from myconpeter/MYCON
incredible-phoenix246 Jul 25, 2024
c8d5af8
Merge pull request #314 from Benson-Ogheneochuko/feat/create-product
incredible-phoenix246 Jul 25, 2024
0894595
fix(docs): correct Swagger documentation for organisations endpoint
kingdavidHub Jul 25, 2024
96f7694
Merge pull request #316 from hngprojects/fix/fixes-on-pending-issues
incredible-phoenix246 Jul 25, 2024
2763f96
Merge pull request #317 from kingdavidHub/125-single-org-endpoint
incredible-phoenix246 Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ GOOGLE_AUTH_CALLBACK_URL=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
GOOGLE_AUTH_CALLBACK_URL=
FLW_PUBLIC_KEY=
FLW_SECRET_KEY=
FLW_ENCRYPTION_KEY=
7 changes: 4 additions & 3 deletions contributors.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [Nainah23](https://github.com/Nainah23)
- Erasmus Tayviah (StarmannRassy)
- [Adekolu Samuel Samixx](https://github.com/samixYasuke)
[Nainah23](https://github.com/Nainah23)
Erasmus Tayviah (StarmannRassy)
[Adekolu Samuel Samixx](https://github.com/samixYasuke)
[Micheal Peter] (https://github.com/myconpeter)
180 changes: 180 additions & 0 deletions docs/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Blog API Documentation

This project provides an API for managing blog posts, including creating, editing, deleting, and retrieving blog posts. The API is documented using Swagger.

## Getting Started

### Prerequisites

Make sure you have the following installed on your machine:

- Node.js (>=14.x)
- Yarn (>=1.x)

### Installation

1. Clone the repository:

```bash
git clone repo
cd repo
```

2. Install dependencies:
```bash
yarn install
```

### Running the Server

To start the server, run:

```bash
yarn start
```

## API Endpoints

### Authentication

Ensure that users are authenticated before accessing the endpoints that modify or delete resources.

#### Login

- **URL**: `/api/v1/auth/login`
- **Method**: `POST`
- **Request Body**:
```json
{
"username": "[email protected]",
"password": "password123"
}
```
- **Responses**:
- `200 OK`: Successfully authenticated
- `401 Unauthorized`: Invalid credentials

#### Register

- **URL**: `/api/v1/auth/register`
- **Method**: `POST`
- **Request Body**:
```json
{
"username": "[email protected]",
"password": "password123",
"name": "John Doe"
}
```
- **Responses**:
- `201 Created`: Successfully registered
- `400 Bad Request`: Invalid input

### Create a Blog Post

- **URL**: `/api/v1/blog/create`
- **Method**: `POST`
- **Authentication**: Required
- **Request Body**:
```json
{
"title": "Sample Blog Post",
"content": "This is a sample blog post.",
"author": "John Doe",
"Imageurl": "http://example.com/image.jpg",
"categories": ["Tech", "Programming"],
"tags": ["Node.js", "Express"],
"likes": [],
"comments": []
}
```
- **Responses**:
- `201 Created`: Blog post created successfully
- `400 Bad Request`: Invalid request body
- `401 Unauthorized`: Authentication required
- `500 Internal Server Error`: Server error

### Get All Blog Posts with Pagination

- **URL**: `/api/v1/blog`
- **Method**: `GET`
- **Query Parameters**:
- `page`: Page number (default: 1)
- `limit`: Number of posts per page (default: 10)
- `offset`: Number of posts to skip (default: 0)
- **Responses**:
- `200 OK`: List of blog posts
- `500 Internal Server Error`: Server error

### Get a Single Blog Post by ID

- **URL**: `/api/v1/blog/:id`
- **Method**: `GET`
- **Parameters**:
- `id`: Blog post ID
- **Responses**:
- `200 OK`: Blog post details
- `404 Not Found`: Blog post not found
- `500 Internal Server Error`: Server error

### Edit a Blog Post by ID

- **URL**: `/api/v1/blog/:id`
- **Method**: `PUT`
- **Authentication**: Required
- **Parameters**:
- `id`: Blog post ID
- **Request Body**:
```json
{
"title": "Updated Blog Post",
"content": "This is an updated blog post.",
"author": "John Doe",
"Imageurl": "http://example.com/new-image.jpg",
"categories": ["Tech", "Programming"],
"tags": ["Node.js", "Express"]
}
```
- **Responses**:
- `200 OK`: Blog post updated successfully
- `400 Bad Request`: Invalid request body
- `401 Unauthorized`: Authentication required
- `404 Not Found`: Blog post not found
- `500 Internal Server Error`: Server error

### Delete a Blog Post by ID

- **URL**: `/api/v1/blog/:id`
- **Method**: `DELETE`
- **Authentication**: Required
- **Parameters**:
- `id`: Blog post ID
- **Responses**:
- `204 No Content`: Blog post deleted successfully
- `401 Unauthorized`: Authentication required
- `404 Not Found`: Blog post not found
- `500 Internal Server Error`: Server error

## Project Structure

```
├── src
│ ├── models
│ │ └── blog.ts
│ ├── routes
│ │ └── blog.ts
│ ├── blogSwaggerConfig.ts
│ └── server.ts
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

```

```
Loading