Skip to content

Commit

Permalink
chore: refactor monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
djnovin committed Jan 14, 2025
1 parent 9847c19 commit 0a8cb3e
Show file tree
Hide file tree
Showing 51 changed files with 11,014 additions and 485 deletions.
Binary file added .DS_Store
Binary file not shown.
41 changes: 2 additions & 39 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# compiled output
/dist
/node_modules

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

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Environment Variables
.env

.terraform
.turbo
node_modules
25 changes: 0 additions & 25 deletions .terraform.lock.hcl

This file was deleted.

115 changes: 68 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,94 @@
<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>
</p>

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

<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">
<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>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<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)-->
# URL Shortening Service Full-Stack

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
<p align="justify"> This is a full-stack URL shortening service that allows users to shorten long URLs, create custom aliases, and track analytics (clicks, unique visitors, and geographic data). It’s designed for high performance with a static frontend and a scalable backend, deployed entirely on AWS. </p>
## Stack

## Installation
<div align="center"> <img src="https://skillicons.dev/icons?i=react,astro,nestjs,graphql,tailwind,aws,postgres,githubactions" alt="Tech Stack" /> </div>

**Frontend:**

- Astro – Static site generator for modern web apps.
- React.js – Library for building interactive UIs.
- Tailwind CSS – Utility-first CSS framework for rapid UI development.

**Backend:**

- Node.js – Runtime environment for executing JavaScript on the server.
- Nest.js – A progressive Node.js framework for building scalable server-side applications.
- GraphQL – API query language for requesting only the data needed.

**Database:**
- PostgreSQL (AWS RDS) – Relational database for storing URLs and click data.

**Cloud Infrastructure:**
AWS (S3, CloudFront, RDS, Lambda, ECR) – Cloud services for hosting and deployment.

## Features

- 🌐 **URL Shortening** – Generate short URLs with custom aliases.
- 🚀 **Cloud Native** – Deployed entirely on AWS for high scalability.

## Getting Started

### Prerequisites

- Node Version Manager (NVM)
Install NVM from [here](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating)

- PNPM (Node Package Manager):
Install PNPM globally using NPM:
```bash

npm install -g pnpm

```

### Setup Instructions

1. Clone the repository:

```bash
$ pnpm install

git clone <repo-url>
cd <repo-name>

```

## Running the app
2. Install Node.js using NVM:

```bash
# development
$ pnpm run start

# watch mode
$ pnpm run start:dev
nvm install
nvm use

# production mode
$ pnpm run start:prod
```

## Test
3. Enable Corepack and install dependencies:

```bash
# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e
corepack enable
corepack install
pnpm install

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

## Support
4. Start the development server:

```bash

pnpm run dev

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).
```

## Stay in touch
## Contributing

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)
Contributing
<div align="center"> <img src="https://img.shields.io/badge/Contributions-Welcome-brightgreen?style=flat-square" alt="Contributions Welcome" /> </div>
We welcome contributions! Feel free to open issues, suggest improvements, or submit pull requests.

## License

Nest is [MIT licensed](LICENSE).
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions apps/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# compiled output
/dist
/node_modules

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

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Environment Variables
.env

.terraform
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 78 additions & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "server",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"start": "nest start",
"start:debug": "nest start --debug --watch",
"dev": "nest start --watch",
"start:prod": "node dist/main",
"test": "jest",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:watch": "jest --watch"
},
"dependencies": {
"@apollo/server": "^4.11.3",
"@codegenie/serverless-express": "^4.16.0",
"@nestjs/apollo": "^12.2.2",
"@nestjs/common": "^9.4.3",
"@nestjs/config": "^3.3.0",
"@nestjs/core": "^9.0.0",
"@nestjs/graphql": "^12.2.2",
"@nestjs/platform-express": "^9.0.0",
"@prisma/client": "^6.2.1",
"aws-lambda": "^1.0.7",
"nanoid": "^5.0.9",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/aws-lambda": "^8.10.147",
"@types/express": "^4.17.13",
"@types/jest": "29.5.0",
"@types/node": "18.15.11",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.5.0",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.0.5",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.2.0",
"typescript": "^4.7.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
Loading

0 comments on commit 0a8cb3e

Please sign in to comment.