Skip to content

Commit

Permalink
docs: add documentation (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijna-Raghavendra authored Feb 11, 2024
2 parents 8d0285f + e6b2b56 commit e964e2b
Show file tree
Hide file tree
Showing 16 changed files with 251 additions and 33 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# Editor Stuff
.vscode
.idea

# Environment
.env

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.vite
dist
dist-ssr
*.local
deno.lock
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 MDG Space

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
# Domain-Forge

_DomainForge is an innovative tool that is designed to help members of MDG space
generate dynamic subdomains. It is a highly effective subdomain generator that
maps user resources to each subdomain, making it easier for users to manage
their different projects and resources._
![GitHub License](https://img.shields.io/github/license/mdgspace/domain-forge)
![GitHub issues](https://img.shields.io/github/issues/mdgspace/domain-forge)
![GitHub Repo stars](https://img.shields.io/github/stars/mdgspace/domain-forge)
![GitHub forks](https://img.shields.io/github/forks/mdgspace/domain-forge)
![GitHub watchers](https://img.shields.io/github/watchers/mdgspace/domain-forge)

Find product related research

_DomainForge serves as a versatile tool for creating dynamic subdomains, while also providing storage and computing capabilities to members of your organization. Moreover, it simplifies the setup process by seamlessly transitioning from a GitHub repository to the build phase. This all-inclusive solution enhances operational efficiency, empowering members with a streamlined and automated workflow from repository setup to deployment._

> Find product related research
[here](https://obvious-acrylic-f12.notion.site/DomainForge-A-dynamic-sub-domain-creator-e860af60894e4a3bb0482ea3dd746451)

## Installation

This section is designated for organizational administrators who leverage this tool to facilitate the creation of dynamic subdomains, while also furnishing storage and computing functionalities to members of the organization. For comprehensive installation guidelines, please refer to this [documentation](./docs/admin/README.md).

## Usage

This section is relevant to the users of the tool. For detailed guidance on effectively leveraging this tool to deploy your projects within your organization, please refer to this [documentation](./docs/users/README.md) for comprehensive instructions.

## License

[MIT](./LICENSE.md)

## Contributing

We welcome pull requests. If you're considering significant changes, please initiate a discussion by opening an issue first. Additionally, please ensure your commits follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format.

Thank you to everyone who's already contributed!

![](https://contrib.rocks/image?repo=mdgspace/domain-forge)

*If you find this tool useful, consider leaving a :star:.*
Made with :heart: by **MDG Space**
40 changes: 40 additions & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Environment
.env

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.vite
dist
dist-ssr
*.local
deno.lock

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Version control
.git
.gitignore

# Docker
.dockerignore
Dockerfile.backend
Dockerfile.frontend
docker-compose.yml
dev.docker-compose.yml
1 change: 0 additions & 1 deletion docker/.gitignore

This file was deleted.

29 changes: 29 additions & 0 deletions docker/dev.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3.9"

services:
deno:
container_name: df_backend
image: df_backend
restart: always
volumes:
- type: bind
source: ../docker/named_pipe
target: /hostpipe
build:
context: ..
dockerfile: docker/Dockerfile.backend
target: base
ports:
- "${PORT_BACKEND}:7000"
env_file:
- ../src/backend/.env
vue:
container_name: df_frontend
image: df_frontend
restart: always
build:
context: ..
dockerfile: docker/Dockerfile.frontend
target: base
ports:
- "${PORT_FRONTEND}:8000"
Empty file removed docs/.gitkeep
Empty file.
64 changes: 64 additions & 0 deletions docs/admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Installation

### 1. Clone the Repository

Run the following command on your server to clone the repository.
```bash
git clone https://github.com/mdgspace/domain-forge.git
```

### 2. Configuring the Environment Variables

This step involves the configuration of three `.env` files:
- Docker env:
As suggested in the `.env.sample` present at the `docker/` directory, create a file named `.env` and copy the contents as shown, replacing *"XXXX"* by the frontend and backend ports you want your application to run on.
```
PORT_BACKEND=XXXX
PORT_FRONTEND=XXXX
```
- Backend env:
As suggested in the `.env.sample` present at the `src/backend` directory, create a file named `.env` and copy the contents as shown, replacing *"..."* with the respective values for your registered github oauth application's **GITHUB_OAUTH_CLIENT_ID** and **GITHUB_OAUTH_CLIENT_SECRET**. Fill in the **MONGO_API_KEY** and **MONGO_APP_ID** you obtain upon creating a cluster in *MongoDB Atlas*
```
GITHUB_OAUTH_CLIENT_ID=...
GITHUB_OAUTH_CLIENT_SECRET=...
MONGO_API_KEY=...
MONGO_APP_ID=...
```
- Frontend env:
As suggested in the `.env.sample` present at the `src/frontend` directory, create a file named `.env` and copy the contents as shown, replacing *"..."* with the respective values for your registered github oauth application's **VITE_APP_GITHUB_OAUTH_CLIENT_ID** and **VITE_APP_GITHUB_OAUTH_CLIENT_SECRET**. For the **VITE_APP_GITHUB_OAUTH_REDIRECT_URL** enter the public url of the application's `/login` route. (Example: `http://df.mdgspace.org/login`). Also, add the port at which your backend is running in place of *"XXXX"*.
```
VITE_APP_GITHUB_OAUTH_CLIENT_ID=...
VITE_APP_GITHUB_OAUTH_CLIENT_SECRET=...
VITE_APP_GITHUB_OAUTH_REDIRECT_URL=...
VITE_APP_BACKEND_PORT=XXXX
```

### 3. Build Docker Image

> If you do not have docker installed on your system, visit [this](https://docs.docker.com/engine/install/).
Navigate to the `docker` directory and build the images in the background using the following command.
```bash
cd docker/
docker compose up --build -d
```

### 4. Setup Named Pipes

Navigate to the `docker/named_pipe` directory and execute the `listen.sh` script to allow the application to run commands on the host.
```bash
cd docker/named_pipe
./listen.sh
```
> Make sure to check the permissions of the `listen.sh` file. You can change them using the `chmod` command.
### 5. Installing and Configuring NGINX

Install NGINX on your server from [here](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/).
Refer to [this](https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04) to configure NGINX to serve your application.

### 6. Adding the DNS Records and Issue SSL Certificates

Refer to [this](https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/) to add DNS records for *df.yourorgname.com* and also a wildcard DNS record for **.df.yourorgname.com*

You can use [letsencrypt](https://letsencrypt.org/) to issue SSL certificates for *df.yourorgname.com* and a wildcard SSL certificate for **.df.yourorgname.com*.
Binary file added docs/assets/add-domain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/delete-domain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/index-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/login-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/users/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Usage

### Login

![](../assets/login-page.png)
Authenticate using your *GitHub* or *GitLab* credentials to access the index page.
![](../assets/index-page.png)

### Adding subdomains

You can click on the **+ Add** button to add subdomains. Your resource can be of three types:
- **URL**: Enter the URL pointing to your resource.
- **PORT**: If your resource is actively hosted on your server, indicate the specific PORT it is running on
- **GITHUB**: Provide a link to your public github repository here.
* If your repository has any environment variables in the root directory, specify their values in the given text box in the following format:
```
key1=value1
key2=value2
```
* If your repository does not have static content, specify the *techstack* used and the *port* your application would be running on. You also have to specify the *BUILD* and *RUN* commands in the text box mentioned.
> For example, if you have a Django application you will have the following *BUILD* and *RUN* commands:
> ```sh
> python manage.py makemigrations
> python manage.py migrate
> python manage.py runserver 0.0.0.0:8000
> ```
![](../assets/add-domain.png)
### Deleting subdomains
Click on the **Delete** button to remove any existing subdomains.
![](../assets/delete-domain.png)
1 change: 0 additions & 1 deletion src/backend/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/backend/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import {
import { Session } from "https://deno.land/x/[email protected]/mod.ts";
import { create, verify } from "https://deno.land/x/[email protected]/mod.ts";
import { exec } from "https://deno.land/x/exec/mod.ts";

export { Application, Context, create, exec, Router, Session, verify };
26 changes: 0 additions & 26 deletions src/frontend/.gitignore

This file was deleted.

0 comments on commit e964e2b

Please sign in to comment.