Display Twitter trends based on selected location.
- Features
- Description
- Presentation
- Technology Stack
- Project Architecture
- Prerequisites
- Env schema
- Installation
- Tests
- License
- Twitter API integration
- Leaflet map
- Authorization and authentication
- REST API
- Two frontend applications (Angular and React)
The main objective of this project was to utilize NX as a mono-repository management tool and test its capabilities in an environment with multiple TypeScript frameworks.
REST API developed in NestJS. It features custom user authorization with the data persistence layer (MongoDB). The Twitter API is seamlessly encapsulated in its own services rendering the whole application independent of its implementation. Reactive programming enabled effective and linear data flow management.
Interactive Leaflet map which displays trends near locations selected by the users. It also enables them to inspect and visualize their personal search history.
Swagger API docs


- NestJS
- React
- Angular
The project was developed following modern web development trends and utilizing advanced TypeScript concepts such as:
- Decorators
- Metadata
- Advanced generics
- Functional programming
- Reactive programming
The project consists of the following applications & libraries.
apps
βββ backend (and backend-e2e)
βββ frontend-react
βββ frontend-angular
libs
βββ data (interfaces, models and reusable functions)
βββ fixtures (test fixtures)
Dependency graph
In order to inspect interactive dependency graph visualization run the following command.
npm run dep-graph
The env file with the following schema must be provided in the root directory before running the application
DB_PORT= Database port @type: Number @required
DB_NAME= Database name @type: String @required
PORT= Server port @type: Number @optional @default=8000
JWT_SECRET= Jwt secret key @optional @default="jwt"
JWT_EXPIRES_IN="7 days" @optional @default="7 days"
DB_USER= Database user @required
DB_PASSWORD= Database password @required
TWITTER_API_KEY= Twitter API key @required
Install node package manager npm. You should be able to run the following commands.
node --version
npm --version
Install docker and docker-compose. You should be able to run the following commands.
docker --version
docker-compose --version
Run the following commands before proceeding to the section below.
npm install
docker-compose ./docker/docker-compose.dev.yml up -d
npm run start backend
Prerequisites: Backend
npm run start frontend-react
Open http://localhost:4200/
in your browser.
Prerequisites: Backend
npm run start frontend-angular
Open http://localhost:4200/
in your browser.
In order to run tests for the selected NX app refer to the commands below.
npm run test backend
docker-compose -f ./docker/docker-compose.dev.yml up -d
npm run e2e backend-e2e
npm run test frontend-react
npm run test frontend-angular
This project is licensed under the MIT License - see the LICENSE.md file for details.