https://github.com/basemax/domainregisterationgraphqlts
DomainRegistrationGraphQLTS is a TypeScript-based project that implements a GraphQL API for managing domain registration. It provides a set of queries and mutations to perform various operations related to domain registration, including creating new domains, retrieving domain information, updating domain details, and deleting domains.
https://github.com/basemax/domainregisterationgraphqlts
graphql graphql-ts graphql-typescript javascript javascript-graphql js js-graphql ts ts-gl ts-graphql typescript
Last synced: about 2 months ago
JSON representation
DomainRegistrationGraphQLTS is a TypeScript-based project that implements a GraphQL API for managing domain registration. It provides a set of queries and mutations to perform various operations related to domain registration, including creating new domains, retrieving domain information, updating domain details, and deleting domains.
- Host: GitHub
- URL: https://github.com/basemax/domainregisterationgraphqlts
- Owner: BaseMax
- License: gpl-3.0
- Created: 2023-07-10T15:27:50.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T11:09:36.000Z (almost 2 years ago)
- Last Synced: 2025-07-04T14:45:02.295Z (11 months ago)
- Topics: graphql, graphql-ts, graphql-typescript, javascript, javascript-graphql, js, js-graphql, ts, ts-gl, ts-graphql, typescript
- Language: TypeScript
- Homepage:
- Size: 849 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Domain Registeration GraphQL TS
DomainRegistrationGraphQLTS is a TypeScript-based project that implements a GraphQL API for managing domain registration. It provides a set of queries and mutations to perform various operations related to domain registration, including creating new domains, retrieving domain information, updating domain details, and deleting domains.
## Features
- Create a new domain with registration details.
- Retrieve domain information by ID or domain name.
- Update domain details such as registrant information, expiration date, and DNS records.
- Delete a domain by ID.
## Routes
The project exposes a single GraphQL endpoint for accessing the domain registration functionality.
**Endpoint:** `/graphql`
## Queries
The following queries are available for retrieving domain information:
- `domain(id: ID!)`: Domain: Retrieves a domain by its unique ID.
- `domains: [Domain]`: Retrieves a list of all registered domains.
- `searchDomains(keyword: String!): [Domain]`: Searches for domains using a keyword.
- `checkAvailability(domain: String!): Boolean`: Checks the availability of a domain name.
- `myDomains: [Domain]`: Retrieves a list of domains registered by the authenticated user.
## Mutations
The following mutations are available for performing domain registration operations:
- `register(name: String!, username: String!, password: String!): User`: Registers a new user with the provided username and password.
- `login(username: String!, password: String!): Token`: Authenticates a user and returns an access token.
- `registerDomain(registerDomainInput: DomainInput!): Domain`: Registers a new domain with the provided details.
- `updateDomain(id: ID!, updateDomainInput: DomainInput!): Domain`: Updates the details of an existing domain.
- `updateDomainDNS(id: ID!, dns: [String]!): Domain`: Updates the DNS/nameserver of a domain.
- `deleteDomain(id: ID!): Domain`: Deletes a domain by its ID.
- `transferDomain(id: ID!, recipientUsername: String!): Domain`: Transfers a domain from the authenticated user's account to another user's account.
## GraphQL Examples
### domain(id: ID!): Domain
```graphql
query {
domain(id: "123456") {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### domains: [Domain]
```graphql
query {
domains {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### searchDomains(keyword: String!): [Domain]
```graphql
query {
searchDomains(keyword: "example") {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### checkAvailability(domainName: String!): Boolean
```graphql
query {
checkAvailability(domain: "example.com") {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### myDomains: [Domain]
```graphql
query {
myDomains {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### register(username: String!, password: String!): User
```graphql
mutation {
register(registerInput: {
name: "name",
username: "example_user",
password: "password"
}) {
access_token
}
}
```
### login(username: String!, password: String!): Token
```graphql
mutation {
login(loginInput: {
username: "example_user",
password: "password"
}) {
access_token
}
}
```
### registerDomain(input: DomainInput!): Domain
```graphql
mutation {
registerDomain(registerDomainInput: {
name: "example.com",
userId: 1,
expirationDate: "2024-07-10",
dnsRecords: ["ns1.example.com", "ns2.example.com"]
}) {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### updateDomain(id: ID!, input: DomainInput!): Domain
```graphql
mutation {
updateDomain(id: "123456", updateDomainInput: {
userId: 1,
expirationDate: "2025-07-10",
dnsRecords: ["ns1.updated-example.com", "ns2.updated-example.com"]
}) {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### updateDomainDNS(id: ID!, dns: [String]!): Domain
```graphql
mutation {
updateDomainDNS(id: "123456", dns: ["ns1.example.com", "ns2.example.com", "ns3.example.com"]) {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### deleteDomain(id: ID!): Domain
```graphql
mutation {
deleteDomain(id: "123456") {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
### transferDomain(id: ID!, recipientUsername: String!): Domain
```graphql
mutation {
transferDomain(id: "123456", recipientUsername: "new_user") {
id
name
registrant {
name
email
}
expirationDate
dnsRecords
}
}
```
## Data Types
The project uses the following data types:
- `User`: Represents a user with properties such as ID and username.
- `Token`: Represents an authentication token.
- `Domain`: Represents a domain with properties such as ID, name, registrant information, expiration date, and DNS records.
- `DomainInput`: Input type for creating or updating a domain, including properties such as name, registrant information, expiration date, and DNS records.
## Getting Started
To run the DomainRegistrationGraphQLTS project locally, follow these steps:
- Clone the repository: `git clone https://github.com/basemax/DomainRegisterationGraphQLTS.git`
- Navigate to the project directory: `cd DomainRegisterationGraphQLTS`
- Install the dependencies: `npm install`
- Build the project: `npm run build`
- Start the server: `npm start`
- Once the server is running, you can access the GraphQL API at `http://localhost:4000/graphql`.
## Testing
To run the tests, use the following command:
```shell
npm run test:e2e
```
This will execute the test suite and provide the test results.
## Dependencies
The project relies on the following dependencies:
- `nestjs`: Web framework for Node.js.
- `graphql`: GraphQL implementation for JavaScript.
- `graphql-tools`: Tools for building and manipulating GraphQL schemas.
- `apollo-server-express`: Integration of Apollo Server with Express.
- `typescript`: TypeScript compiler and language tools.
Please ensure that these dependencies are installed before running the project.
## License
This project is licensed under the MIT License. Feel free to use and modify the code as per your requirements.
## Contributions
Contributions to the DomainRegistrationGraphQLTS project are welcome. If you find any issues or have suggestions for improvement,
Copyright 2023, Max Base