This repository contains microservices to store blogs, comments and render them. Measures various metrics and visualizes them. Aims of the repository is having testable, scalable, maintainable and fully Dockerized architecture.
Here is the tech stack used in this project:
- Fully Dockerized, see
docker-compose.yml
for more details. - Uses Restful API.
- Uses API tokens for security.
- Uses MongoDB as database.
- Uses Nginx as reverse proxy, cache and for ssl verification.
- Scraps Nginx and MongoDB metrics via Prometheus.
- Uses Grafana to visualize metrics.
- Uses Jest for unit testing.
- Uses Svelte & TailwindCSS for frontend.
- Renders HTML pages on server-side using SvelteKit.
- Uses GitHub Actions for CI/CD.
- Add
docker compose build
support. - Postman collection for the API
- Clone the repository:
git clone [email protected]:hamza-cskn/blog-services.git
- Go the repository directory:
cd blog-services
- Build the docker images:
docker compose build
- Configure the
docker-compose.yml
and other configuration files as you want. - Run the docker containers:
docker compose up -d
- Visit
https://localhost
to see the front-end.
- Just run
npm run test --prefix <service-name>
. Enjoy.
- Get API token from
docker-compose.yml
file.- Frontend, Blog and Comment services must have same API token.
- So, each service can access each other using the token as key.
- Tokens are passed as
Token
header in HTTP requests. - Tokens are stored in
API_TOKEN
environment variable.
- Send HTTP request to Blog or Comment services with the token.
- You can use
curl
orPostman
to send HTTP requests. - API Documentation can be found below.
- You can use
The repository has ready-to-use Postman collection. Check blog-app.postman_collection.json
file or visit the documentation page.
If you know Turkish, feel free to read my Rest API blog.