Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
tasks:
- name: YAUS Server
init: bash ./deploy.sh
env:
DATABASE_URL: "postgresql://postgres:yoursupersecret@localhost:5432/shortdb?schema=public"

ports:
- port: 5432
Expand All @@ -27,5 +25,14 @@ ports:
onOpen: ignore
visibility: public
- port: 3333
onOpen: open-browser
visibility: public
- port: 9229
onOpen: ignore
visibility: public
- port: 6381
onOpen: ignore
visibility: public
visibility: public
- port: 4200
onOpen: open-browser
visibility: public
12 changes: 6 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
nvm install 16
nvm use 16

cp sample.env .env
cp gitpod.env .env
# sudo apt-get install unzip
# unzip pgdata.zip
# rm -rf pgdata.zip
Expand All @@ -31,10 +31,10 @@ npx prisma db seed
sleep 30

# Starting Server - https://8888-
serverBaseURL=${GITPOD_WORKSPACE_URL:-default_value}
serverBaseURL="https://8088-${serverBaseURL:8}/add/?name=shortnr&host=shortnr-cache&port=6379"
curl "${serverBaseURL}"
echo "Open this URL in a the browser to add redis to redisInsight ${serverBaseURL}"
# serverBaseURL=${GITPOD_WORKSPACE_URL:-default_value}
# serverBaseURL="https://8088-${serverBaseURL:8}/add/?name=shortnr&host=shortnr-cache&port=6379"
# curl "${serverBaseURL}"
# echo "Open this URL in a the browser to add redis to redisInsight ${serverBaseURL}"

# start api server
npx nx serve api
npx nx run-many --target=serve --all
4 changes: 2 additions & 2 deletions docker-compose.gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
shortdb:
container_name: shortdb
image: postgres:12
image: postgres:14
env_file:
- .env
environment:
Expand Down Expand Up @@ -72,4 +72,4 @@ volumes:
pgdata:
broker:
redisinsight:
driver: local
driver: local
28 changes: 28 additions & 0 deletions gitpod.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
POSTGRES_DB=shortdb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=yoursupersecret
REDIS_URI=redis://localhost:6381
REDIS_NAME=db
GRAPHQL_URI=http://localhost:8080/v1/graphql
HASURA_ADMIN_SECRET=4GeEB2JCU5rBdLvQ4AbeqqrPGu7kk9SZDhJUZm7A
BASE_URL=https://www.yaus.xyz/
RABBITMQ_PASSWORD=password
RABBITMQ_USERNAME=username
RMQ_URL=amqp://username:password@localhost:5672
RMQ_QUEUE=clicks
RMQ_QUEUE_DURABLE=false
POSTHOG_API_KEY=test
POSTHOG_API_HOST=https://app.posthog.com/
POSTHOG_DISTINCT_KEY=YAUS Events
POSTHOG_BATCH_SIZE=20
POSTHOG_FLUSH_INTERVAL=10000
CLICK_BACKUP_CRON=* * 1 * * *

# This was inserted by `prisma init`:
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB (Preview).
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="postgresql://postgres:yoursupersecret@localhost:5432/shortdb?schema=public"
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ Batteries included URL Shortener that is designed for speed and scalability.

[Docs here](https://github.com/Samagra-Development/yaus/tree/master/docs)

## Setup

There are two ways in which you can get up and running with this project.

If you are just looking around and want to see quickly how this project works we recommend you start with [Gitpod](https://www.gitpod.io/) it is a service that runs your code in the cloud.

All you have to do is click the button below.
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Samagra-Development/yaus)

This will open this project in Gitpod and launch two new tabs. The one with the `https://3333-XXXXX.gitpod.io` type of link is for the backend and the other with the `https://4200-XXXXX.gitpod.io` type of link is for frontend.

(In case your browser doesn't launch these tabs then please check the browser's popup setting).

The other usual way is to set up everything locally on your system, for that, you can follow the instructions given below.

## Installation

### Prerequisites
Expand Down