Skip to content

Commit

Permalink
Merge pull request #1 from hamza-cskn/dev
Browse files Browse the repository at this point in the history
Add admin panel
  • Loading branch information
hamza-cskn authored Sep 24, 2023
2 parents a4e6d9d + 1f524be commit 45a3b49
Show file tree
Hide file tree
Showing 55 changed files with 9,928 additions and 93 deletions.
10 changes: 10 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
NGINX_VERSION=1.25
FRONTEND_SERVICE_VERSION=1.0
BLOG_SERVICE_VERSION=1.0
COMMENT_SERVICE_VERSION=1.0
AUTH_SERVICE_VERSION=1.0
MONGO_VERSION=latest
PROMETHEUS_VERSION=v2.47.0
MONGODB_EXPORTER_VERSION=0.20
NGINX_EXPORTER_VERSION=0.11
GRAFANA_VERSION=9.4.14
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img style="width: 200px" src="https://github.com/hamza-cskn/blog-services/blob/main/frontend/static/favicon.png"/>
<img style="width: 200px" src="https://github.com/hamza-cskn/blog-services/blob/main/frontend/static/favicon.png" alt="logo of website"/>
</p>

## Blog Services
Expand All @@ -22,20 +22,15 @@ Here is the tech stack used in this project:
12. [x] Add `docker compose build` support.
13. [x] Postman collection for the API

Note: The provided `docker-compose.yml` does not include MongoDB as scaled.
![arch](https://github.com/hamza-cskn/blog-services/assets/36128276/a4e18198-f62a-44b7-99cf-f76bedf049dd)


### Goals
1. [ ] Add error tracking and logging.
![architecture](https://github.com/hamza-cskn/blog-services/assets/36128276/4cea2caf-b1ac-4e31-9945-066241fe9ae5)

### How to run
1. Clone the repository: `git clone [email protected]:hamza-cskn/blog-services.git`
2. Go the repository directory: `cd blog-services`
3. Build the docker images: `docker compose build`
4. Configure the `docker-compose.yml` and other configuration files as you want.
5. Run the docker containers: `docker compose up -d`
6. Visit `https://localhost` to see the front-end (nginx).
6. Visit [`https://localhost`](https://localhost) to see the front-end.

### How to test
1. Just run `npm run test --prefix <service-name>`. Enjoy.
Expand All @@ -54,3 +49,18 @@ Note: The provided `docker-compose.yml` does not include MongoDB as scaled.
The repository has ready-to-use Postman collection. Check `blog-app.postman_collection.json` file or visit the [documentation page](https://documenter.getpostman.com/view/24413595/2s9YC5zDD7).

If you know Turkish, feel free to read my [Rest API](https://medium.com/software-development-turkey/rest-api-nedir-standartları-nelerdir-ca1c7d7d0502) blog.

## Screenshots
<details>
<summary>Click to expand</summary>
<img width="1362" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/da9d3dc3-95c4-48d2-a64b-37b8b3e01ef8">
<img width="1352" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/36b7bcce-c87e-46f7-b767-ea5758b0d571">
<img width="1355" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/a08aa9eb-53ec-4411-be72-b7bfe1633740">
<img width="1349" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/dd1f5929-da5f-483d-b3ee-fe8668450267">
<img width="1357" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/a991dc20-ad24-44ac-a1f9-9a7b4a5ea08c">
<img width="1359" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/72498d25-8edb-4801-bcbc-59fcbdd0c972">
<img width="1370" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/8a045675-5ddc-4f16-8e19-d47095dde05d">
<img width="1369" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/b3296b4f-c21f-4141-8829-675095955864">
<img width="1357" alt="image" src="https://github.com/hamza-cskn/blog-services/assets/36128276/9b2c72de-256b-4dda-88e2-e4387ef15832">
</details>

25 changes: 25 additions & 0 deletions auth/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
4 changes: 4 additions & 0 deletions auth/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
13 changes: 13 additions & 0 deletions auth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:alpine As build

WORKDIR /usr/app
COPY . .
RUN npm install && npm run build

FROM node:alpine as production

WORKDIR /usr/app
COPY package*.json .
RUN npm install --only=production
COPY --from=build /usr/app/dist ./dist
CMD ["node", "dist/main"]
73 changes: 73 additions & 0 deletions auth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<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)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

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

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

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

## Support

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

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
8 changes: 8 additions & 0 deletions auth/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading

0 comments on commit 45a3b49

Please sign in to comment.