Batteries included URL Shortener that is designed for speed and scalability.
To run this project, you need to have the following pre-requisites installed:
- Node 16
- Yarn 1
- Docker: Download and install Docker
- Docker Compose: Download and install Docker Compose
- Clone the repository:
git clone https://github.com/Samagra-Development/yaus.git
- Navigate to the project directory:
cd yaus
- Create environment file:
cp sample.env .env
- Start the project dependencies using Docker Compose:
docker-compose -f docker-compose.local.yml up -d
The -d
flag is used to run the containers in the background (detached mode). If you want to see the container logs, you can omit the -d
flag.
Docker Compose will read the docker-compose.local.yml
file and start the defined services.
- Verify that the containers are running:
docker-compose -f docker-compose.local.yml ps
This command will display the status of the containers defined in the docker-compose.local.yml
file.
- Install app dependencies:
yarn install
- Run migrations:
npx prisma migrate dev --schema=apps/api/src/app/prisma/schema.prisma
- Seed data in the database (Optional):
npx prisma db seed
This command will seed the dummy data.
- Start the app:
To start backend app:
npx nx serve api
To start frontend app:
npx nx serve admin
- If everything is set up correctly, you should be able to access backend at
localhost:3333/api
. If this opens swagger ui your setup is correct. For frontend visitlocalhost:4200
.
To run this project, you need to have the following pre-requisites installed:
- Docker: Download and install Docker
- Docker Compose: Download and install Docker Compose
- Clone the repository:
git clone https://github.com/Samagra-Development/yaus.git
- Navigate to the project directory:
cd yaus
- Create environment file:
cp sample.env .env
You'd need to edit few things in the .env
for prod. like for example you'd need to replace localhost
with corresponding container name.
- Start the project using Docker Compose:
docker-compose -f docker-compose.prod.yml up -d
The -d
flag is used to run the containers in the background (detached mode). If you want to see the container logs, you can omit the -d
flag.
Docker Compose will read the docker-compose.prod.yml
file and start the defined services.
- Verify that the containers are running:
docker-compose -f docker-compose.prod.yml ps
This command will display the status of the containers defined in the docker-compose.prod.yml
file.
- Run migrations:
docker-compose -f docker-compose.prod.yml exec app bash
npx prisma migrate dev --schema=apps/api/src/app/prisma/schema.prisma
exit
First command will drop you into docker container and second command will run the migration and third will simply pull you out from container.
- Seed data in the database (Optional):
docker-compose -f docker-compose.local.yml exec app bash
npx prisma db seed
exit
This command will seed the dummy data.
- If everything is set up correctly, you should be able to access backend at
localhost:3333/api
. If this opens swagger ui your setup is correct.
It is recommended to develop on Gitpod since everything is coupled with a bunch of dependencies. To start your Gitpod session click on the button below.
The repo is structured as a monorepo using the Nx.