Skip to content

Commit 41bbd2f

Browse files
author
patricksferraz
committed
style: changes repo location and adds docs
1 parent 426f235 commit 41bbd2f

16 files changed

Lines changed: 280 additions & 205 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Patrick Ferraz
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 106 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,143 @@
1-
<!--
2-
*** Thanks for checking out the Best-README-Template. If you have a suggestion
3-
*** that would make this better, please fork the repo and create a pull request
4-
*** or simply open an issue with the tag "enhancement".
5-
*** Thanks again! Now go create something AMAZING! :D
6-
***
7-
***
8-
***
9-
*** To avoid retyping too much info. Do a search and replace for the following:
10-
*** github_username, repo_name, twitter_handle, email, project_title, project_description
11-
-->
12-
13-
<!-- PROJECT SHIELDS -->
14-
<!--
15-
*** I'm using markdown "reference style" links for readability.
16-
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
17-
*** See the bottom of this document for the declaration of the reference variables
18-
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
19-
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
20-
-->
21-
22-
<!-- PROJECT LOGO -->
23-
<br />
24-
<p align="center">
25-
<a href="https://github.com/c-4u/pinned-place">
26-
<img src="img/logo.png" alt="Logo" width="100" height="100">
27-
</a>
28-
29-
<h3 align="center">Place</h3>
30-
31-
<p align="center">
32-
Microservice for time recording
33-
<br />
34-
<a href="https://github.com/c-4u/pinned-place"><strong>Explore the docs »</strong></a>
35-
<!-- <br />
36-
<br />
37-
<a href="https://github.com/c-4u/pinned-place">View Demo</a>
38-
·
39-
<a href="https://github.com/c-4u/pinned-place">Report Bug</a>
40-
·
41-
<a href="https://github.com/c-4u/pinned-place">Request Feature</a>-->
42-
</p>
43-
</p>
44-
45-
<!-- TABLE OF CONTENTS -->
46-
<details open="open">
47-
<summary>Table of Contents</summary>
48-
<ol>
49-
<li>
50-
<a href="#about-the-project">About The Project</a>
51-
<ul>
52-
<li><a href="#built-with">Built With</a></li>
53-
</ul>
54-
</li>
55-
<li>
56-
<a href="#getting-started">Getting Started</a>
57-
<ul>
58-
<li><a href="#prerequisites">Prerequisites</a></li>
59-
<li><a href="#installation">Installation</a></li>
60-
</ul>
61-
</li>
62-
<!-- <li><a href="#usage">Usage</a></li> -->
63-
<li><a href="#roadmap">Roadmap</a></li>
64-
<li><a href="#contributing">Contributing</a></li>
65-
<!-- <li><a href="#license">License</a></li> -->
66-
<li><a href="#contact">Contact</a></li>
67-
<!-- <li><a href="#acknowledgements">Acknowledgements</a></li> -->
68-
</ol>
69-
</details>
70-
71-
<!-- ABOUT THE PROJECT -->
72-
## About The Project
73-
74-
Place is a microservice for pinned soluction providing in the application layer the communication by REST and gRPC.
75-
76-
<!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) -->
77-
<!--
78-
Here's a blank template to get started:
79-
**To avoid retyping too much info. Do a search and replace with your text editor for the following:**
80-
`github_username`, `repo_name`, `twitter_handle`, `email`, `project_title`, `project_description` -->
81-
82-
### Built With
83-
84-
- [Go Lang](https://golang.org/)
85-
- List all: `go list -m all`
86-
87-
<!-- GETTING STARTED -->
88-
## Getting Started
89-
90-
To get a local copy up and running follow these simple steps.
1+
# Pinned Place 🎯
2+
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/patricksferraz/pinned-place)](https://goreportcard.com/report/github.com/patricksferraz/pinned-place)
4+
[![GoDoc](https://godoc.org/github.com/patricksferraz/pinned-place?status.svg)](https://godoc.org/github.com/patricksferraz/pinned-place)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
7+
A modern, scalable location-based service built with Go, designed to handle location data efficiently and reliably.
8+
9+
## 🌟 Features
10+
11+
- RESTful API for location management
12+
- PostgreSQL database for reliable data storage
13+
- Kafka integration for event streaming
14+
- Docker and Kubernetes support for easy deployment
15+
- Hot-reload development environment with Air
16+
- Comprehensive database migrations
17+
- Admin interface for database management
18+
19+
## 🚀 Quick Start
9120

9221
### Prerequisites
9322

94-
- Hiring a kubernetes cluster:
95-
- [AWS](https://aws.amazon.com/pt/eks/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc&eks-blogs.sort-by=item.additionalFields.createdDate&eks-blogs.sort-order=desc)
96-
- [Azure](https://azure.microsoft.com/pt-br/services/kubernetes-service/)
97-
- [GCP](https://cloud.google.com/kubernetes-engine)
23+
- Go 1.18+
24+
- Docker and Docker Compose
25+
- Make (optional, but recommended)
9826

99-
- [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
27+
### Environment Setup
10028

101-
- Create a secrets: see "_k8s/instructions.md_"
29+
1. Clone the repository:
30+
```bash
31+
git clone https://github.com/patricksferraz/pinned-place.git
32+
cd pinned-place
33+
```
10234

103-
### Deploy
35+
2. Copy the example environment file and configure it:
36+
```bash
37+
cp .env.example .env
38+
```
10439

105-
- `kubectl apply -f ./k8s`
40+
3. Start the services using Docker Compose:
41+
```bash
42+
docker-compose up -d
43+
```
10644

107-
<!-- USAGE EXAMPLES -->
108-
<!-- ## Usage
45+
### Development
10946

110-
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
47+
The project uses Air for hot-reloading during development. To start the development server:
11148

112-
_For more examples, please refer to the [Documentation](https://example.com)_ -->
49+
```bash
50+
make dev
51+
```
11352

114-
<!-- ROADMAP -->
115-
## Roadmap
53+
## 🏗️ Project Structure
11654

117-
See the [open issues](https://github.com/c-4u/pinned-place/issues) for a list of proposed features (and known issues).
55+
```
56+
.
57+
├── app/ # Application layer
58+
├── cmd/ # Command-line interface
59+
├── domain/ # Domain models and business logic
60+
├── infra/ # Infrastructure implementations
61+
├── k8s/ # Kubernetes configurations
62+
└── utils/ # Utility functions and helpers
63+
```
11864

119-
<!-- CONTRIBUTING -->
120-
## Contributing
65+
## 🛠️ Technology Stack
12166

122-
Any contributions you make are **greatly appreciated**.
67+
- **Language**: Go
68+
- **Database**: PostgreSQL
69+
- **Message Broker**: Kafka
70+
- **Containerization**: Docker
71+
- **Orchestration**: Kubernetes
72+
- **Development**: Air (hot-reload)
73+
- **Database Admin**: Adminer
12374

124-
1. Fork the Project
125-
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
126-
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
127-
4. Push to the Branch (`git push origin feature/AmazingFeature`)
128-
5. Open a Pull Request
75+
## 📚 API Documentation
12976

130-
**Prerequisites**:
77+
The API documentation is available at `/swagger` when running the application.
13178

132-
- Golang
79+
## 🔧 Configuration
13380

134-
```sh
135-
wget https://golang.org/dl/go1.17.7.linux-amd64.tar.gz
136-
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.7.linux-amd64.tar.gz
137-
export PATH=$PATH:/usr/local/go/bin
138-
```
81+
The application can be configured through environment variables:
13982

140-
- Docker and docker-compose
83+
- `REST_PORT`: Port for the REST API
84+
- `POSTGRES_*`: PostgreSQL configuration
85+
- `KAFKA_*`: Kafka configuration
86+
- `DSN_*`: Data Source Name configuration
14187

142-
```sh
143-
sudo apt-get install docker docker-compose docker.io -y
144-
```
88+
See `.env.example` for all available configuration options.
14589

146-
- Environment: see "_.env.example_"
90+
## 🧪 Testing
14791

148-
**Installation**:
92+
Run the test suite:
14993

150-
1. Clone the repo
94+
```bash
95+
make test
96+
```
15197

152-
```sh
153-
git clone https://github.com/c-4u/pinned-place.git
154-
```
98+
## 📦 Deployment
15599

156-
2. Run
100+
### Docker
157101

158-
```sh
159-
make up
160-
```
102+
Build and run using Docker:
161103

162-
3. Test
104+
```bash
105+
make docker-build
106+
make docker-run
107+
```
163108

164-
```sh
165-
make gtest
166-
```
109+
### Kubernetes
167110

168-
**Installation in local kubernetes**:
111+
Deploy to Kubernetes:
112+
113+
```bash
114+
kubectl apply -f k8s/
115+
```
116+
117+
## 🤝 Contributing
118+
119+
Contributions are welcome! Please feel free to submit a Pull Request.
120+
121+
1. Fork the repository
122+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
123+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
124+
4. Push to the branch (`git push origin feature/amazing-feature`)
125+
5. Open a Pull Request
169126

170-
1. Install [k3d](https://k3d.io/), [Kind](https://kind.sigs.k8s.io/) or similar
171-
2. Install [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) and [Helm](https://helm.sh/)
172-
3. Follow the steps of [Getting Started](#getting-started)
173-
- Connect to cluster and run:
127+
## 📄 License
174128

175-
`kubectl apply -f k8s/`
176-
<!-- LICENSE -->
177-
<!-- ## License -->
129+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
178130

179-
<!-- Distributed under the MIT License. See `LICENSE` for more information. -->
131+
## 👥 Authors
180132

181-
<!-- CONTACT -->
182-
## Contact
133+
- **Patrick Ferraz** - *Initial work*
183134

184-
Coding4u - contato@coding4u.com.br - [website](http://coding4u.com.br)
135+
## 🙏 Acknowledgments
185136

186-
Project Link: [place](https://github.com/c-4u/pinned-place)
137+
- Thanks to all contributors who have helped shape this project
138+
- Inspired by modern microservices architecture
139+
- Built with best practices in mind
187140

188-
<!-- ACKNOWLEDGEMENTS -->
189-
<!-- ## Acknowledgements
141+
---
190142

191-
* []()
192-
* []()
193-
* []() -->
143+
⭐ Star this repository if you find it useful!

app/rest/server.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"fmt"
55
"log"
66

7-
_ "github.com/c-4u/pinned-place/app/rest/docs"
8-
"github.com/c-4u/pinned-place/domain/service"
9-
"github.com/c-4u/pinned-place/infra/client/kafka"
10-
"github.com/c-4u/pinned-place/infra/db"
11-
"github.com/c-4u/pinned-place/infra/repo"
127
"github.com/gofiber/fiber/v2"
138
"github.com/gofiber/fiber/v2/middleware/cors"
9+
_ "github.com/patricksferraz/pinned-place/app/rest/docs"
10+
"github.com/patricksferraz/pinned-place/domain/service"
11+
"github.com/patricksferraz/pinned-place/infra/client/kafka"
12+
"github.com/patricksferraz/pinned-place/infra/db"
13+
"github.com/patricksferraz/pinned-place/infra/repo"
1414
fiberSwagger "github.com/swaggo/fiber-swagger"
1515
)
1616

app/rest/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package rest
22

33
import (
44
"github.com/asaskevich/govalidator"
5-
"github.com/c-4u/pinned-place/domain/service"
65
"github.com/gofiber/fiber/v2"
6+
"github.com/patricksferraz/pinned-place/domain/service"
77
)
88

99
type RestService struct {

cmd/all.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
3-
43
*/
54
package cmd
65

@@ -11,11 +10,11 @@ import (
1110
"runtime"
1211

1312
"github.com/Netflix/go-env"
14-
"github.com/c-4u/pinned-place/app/rest"
15-
"github.com/c-4u/pinned-place/infra/client/kafka"
16-
"github.com/c-4u/pinned-place/infra/db"
1713
ckafka "github.com/confluentinc/confluent-kafka-go/kafka"
1814
"github.com/joho/godotenv"
15+
"github.com/patricksferraz/pinned-place/app/rest"
16+
"github.com/patricksferraz/pinned-place/infra/client/kafka"
17+
"github.com/patricksferraz/pinned-place/infra/db"
1918
"github.com/spf13/cobra"
2019
"gorm.io/gorm/logger"
2120
)

cmd/rest.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
3-
43
*/
54
package cmd
65

@@ -11,11 +10,11 @@ import (
1110
"runtime"
1211

1312
"github.com/Netflix/go-env"
14-
"github.com/c-4u/pinned-place/app/rest"
15-
"github.com/c-4u/pinned-place/infra/client/kafka"
16-
"github.com/c-4u/pinned-place/infra/db"
1713
ckafka "github.com/confluentinc/confluent-kafka-go/kafka"
1814
"github.com/joho/godotenv"
15+
"github.com/patricksferraz/pinned-place/app/rest"
16+
"github.com/patricksferraz/pinned-place/infra/client/kafka"
17+
"github.com/patricksferraz/pinned-place/infra/db"
1918
"github.com/spf13/cobra"
2019
"gorm.io/gorm/logger"
2120
)

0 commit comments

Comments
 (0)