Skip to content

Commit

Permalink
setting up project as open source for contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
enochval committed Jun 13, 2024
1 parent c1ad2a8 commit d8227db
Show file tree
Hide file tree
Showing 35 changed files with 223 additions and 70 deletions.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Expected Behavior

## Actual Behavior

## Steps to Reproduce the Problem

1.
2.
3.

## Specifications

- Version:
- Platform:
- Subsystem:
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Fixes # (issue)

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules

## Additional Information

Add any other information or screenshots about the pull request.
48 changes: 48 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#### CODE_OF_CONDUCT.md

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [your email]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
77 changes: 77 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

#### CONTRIBUTING.md


# Contributing to JSON Placeholder GraphQL API

Thank you for considering contributing to our project! We appreciate your time and effort.

## How to Contribute

1. **Fork the repository** on GitHub.
2. **Clone your fork** locally:
```bash
git clone https://github.com/yourusername/json-placeholder-graphql.git
```
3. **Create a branch** for your contribution:
```bash
git checkout -b feature/your-feature-name
```
4. **Make your changes** in your local repository.
5. **Commit your changes** with a clear and concise message:
```bash
git commit -m "Add feature: description of your feature"
```
6. **Push your changes** to your forked repository:
```bash
git push origin feature/your-feature-name
```
7. **Create a pull request** on GitHub.


## Code Style

Please follow the coding style used throughout the project. Write clear, concise, and well-documented code.

## Development Setup

### Prerequisites

- Node.js
- npm

### Installation

1. Clone the repository:

```bash
git clone https://github.com/yourusername/json-placeholder-graphql.git
```

```bash
cd json-placeholder-graphql
```

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

3. Run the application:
```bash
npm run start:dev
```

4. Run tests:
```
npm test
```
## Additional Information
If you have any questions or need further clarification on any of the updates, please do not hesitate to reach out.
---
Thank you for contributing!
70 changes: 29 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="100" alt="Nest Logo" /></a>
<a href="http://nestjs.com/" target="blank"><img src="https://www.vectorlogo.zone/logos/graphql/graphql-icon.svg" width="100" alt="GraphQL Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
# JSON Placeholder GraphQL API

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">Welcome to the <a href="https://graphqljsonplaceholder.vercel.app" target="blank">JSON Placeholder GraphQL API</a>!</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
Expand All @@ -19,55 +19,43 @@
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
This project is a NestJS GraphQL implementation of the popular [JSON Placeholder](https://jsonplaceholder.typicode.com) API, providing developers with a GraphQL playground for testing and experimentation.

## Installation
## Features

```bash
$ npm install
```
- No registration
- Zero-config
- Basic GraphQL API
- "Has many" relationships
- Filters and nested queries
- Cross-domain (CORS and JSONP)
- Supports QUERY, MUTATION
- HTTP or HTTPS
- Compatible with React, Angular, Vue, Ember, ...
- **GraphQL Playground**: An interactive playground for testing GraphQL queries and mutations.
- **NestJS Framework**: Built with NestJS for high performance and maintainability.
- **JSON Placeholder Integration**: Seamless integration with JSON Placeholder API data including posts, comments, users, todos, albums and photos.
- **Type-safe Queries**: Utilize TypeScript for a smooth and error-free development experience.

## Running the app
## Usage

```bash
# development
$ npm run start
- **Queries:** Fetch data such as posts, comments, users, etc., from the JSON Placeholder API using GraphQL queries.
- **Mutations:** Test data manipulation operations like creating, updating, and deleting resources.

# watch mode
$ npm run start:dev
## Guide
For examples and more, you can visit https://graphqljsonplaceholder.vercel.app/graphql

# production mode
$ npm run start:prod
```
## Contributing

## Test
We welcome contributions from the community! Please read our CONTRIBUTING.md to get started.

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Support
## License

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
This project is licensed under the MIT License - see the LICENSE file for details.

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
- Author - [Enoch Osarenren](www.linkedin.com/in/enoch-osarenren)
2 changes: 1 addition & 1 deletion src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export class AppController {

@Get()
getHello(): string {
return this.appService.getHello();
return this.appService.getHello()
}
}
10 changes: 5 additions & 5 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { join } from 'path';
import { UserModule } from './users/users.module';
import { PostsModule } from './posts/posts.module';
import { UserModule } from './modules/users/users.module';
import { PostsModule } from './modules/posts/posts.module';
import { ConfigModule } from '@nestjs/config';
import { AlbumsModule } from './albums/albums.module';
import { TodosModule } from './todos/todos.module';
import { JsonplaceholderModule } from './jsonplaceholder/jsonplaceholder.module';
import { AlbumsModule } from './modules/albums/albums.module';
import { TodosModule } from './modules/todos/todos.module';
import { JsonplaceholderModule } from './common/services/jsonplaceholder/jsonplaceholder.module';
import configuration from './config/configuration';

@Module({
Expand Down
2 changes: 1 addition & 1 deletion src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!';
return 'GraphQL implementation of {JSON} Placeholder API';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Module, forwardRef } from '@nestjs/common';
import { AlbumsService } from './albums.service';
import { PhotosService } from './photos/photos.service';
import { AlbumResolver } from './albums.resolver';
import { UserModule } from 'src/users/users.module';
import { JsonplaceholderModule } from 'src/jsonplaceholder/jsonplaceholder.module';
import { UserModule } from 'src/modules/users/users.module';
import { JsonplaceholderModule } from 'src/common/services/jsonplaceholder/jsonplaceholder.module';
import { PhotosResolver } from './photos/photos.resolver';

@Module({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Args, Parent, Query, ResolveField, Resolver } from "@nestjs/graphql";
import { PhotosService } from "./photos/photos.service";
import { Album, Photo, User } from "src/graphql";
import { AlbumsService } from "./albums.service";
import { UserService } from "src/users/users.service";
import { UserService } from "src/modules/users/users.service";

@Resolver('Album')
export class AlbumResolver {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { Album } from 'src/graphql';
import { JsonplaceholderService } from 'src/jsonplaceholder/jsonplaceholder.service';
import { JsonplaceholderService } from 'src/common/services/jsonplaceholder/jsonplaceholder.service';

@Injectable()
export class AlbumsService {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { Photo } from 'src/graphql';
import { JsonplaceholderService } from 'src/jsonplaceholder/jsonplaceholder.service';
import { JsonplaceholderService } from 'src/common/services/jsonplaceholder/jsonplaceholder.service';

@Injectable()
export class PhotosService {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { Comment } from 'src/graphql';
import { JsonplaceholderService } from 'src/jsonplaceholder/jsonplaceholder.service';
import { JsonplaceholderService } from 'src/common/services/jsonplaceholder/jsonplaceholder.service';

@Injectable()
export class CommentsService {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Module, forwardRef } from '@nestjs/common';
import { PostsService } from './posts.service';
import { PostsResolver } from './posts.resolver';
import { UserModule } from 'src/users/users.module';
import { UserModule } from 'src/modules/users/users.module';
import { CommentsService } from './comments/comments.service';
import { CommentsResolver } from './comments/comments.resolver';
import { JsonplaceholderModule } from 'src/jsonplaceholder/jsonplaceholder.module';
import { JsonplaceholderModule } from 'src/common/services/jsonplaceholder/jsonplaceholder.module';

@Module({
imports: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Args, Mutation, Parent, Query, ResolveField, Resolver } from "@nestjs/graphql";
import { PostsService } from "./posts.service";
import { Post, User, Comment } from "src/graphql";
import { UserService } from "src/users/users.service";
import { UserService } from "src/modules/users/users.service";
import { CommentsService } from "./comments/comments.service";
import { CreatePostDTO } from "./dto/create-post.dto";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { Post } from 'src/graphql';
import { JsonplaceholderService } from 'src/jsonplaceholder/jsonplaceholder.service';
import { JsonplaceholderService } from 'src/common/services/jsonplaceholder/jsonplaceholder.service';
import { CreatePostDTO } from './dto/create-post.dto';

@Injectable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Module, forwardRef } from '@nestjs/common';
import { TodosService } from './todos.service';
import { JsonplaceholderModule } from 'src/jsonplaceholder/jsonplaceholder.module';
import { JsonplaceholderModule } from 'src/common/services/jsonplaceholder/jsonplaceholder.module';
import { TodosResolver } from './todos.resolver';
import { UserModule } from 'src/users/users.module';
import { UserModule } from 'src/modules/users/users.module';

@Module({
imports: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Args, Parent, Query, ResolveField, Resolver } from "@nestjs/graphql";
import { TodosService } from "./todos.service";
import { Todo, User } from "src/graphql";
import { UserService } from "src/users/users.service";
import { UserService } from "src/modules/users/users.service";


@Resolver('Todo')
Expand Down
File renamed without changes.
Loading

0 comments on commit d8227db

Please sign in to comment.