|
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 | +[](https://goreportcard.com/report/github.com/patricksferraz/pinned-place) |
| 4 | +[](https://godoc.org/github.com/patricksferraz/pinned-place) |
| 5 | +[](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 |
91 | 20 |
|
92 | 21 | ### Prerequisites |
93 | 22 |
|
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) |
98 | 26 |
|
99 | | -- [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) |
| 27 | +### Environment Setup |
100 | 28 |
|
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 | +``` |
102 | 34 |
|
103 | | -### Deploy |
| 35 | +2. Copy the example environment file and configure it: |
| 36 | +```bash |
| 37 | +cp .env.example .env |
| 38 | +``` |
104 | 39 |
|
105 | | -- `kubectl apply -f ./k8s` |
| 40 | +3. Start the services using Docker Compose: |
| 41 | +```bash |
| 42 | +docker-compose up -d |
| 43 | +``` |
106 | 44 |
|
107 | | -<!-- USAGE EXAMPLES --> |
108 | | -<!-- ## Usage |
| 45 | +### Development |
109 | 46 |
|
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: |
111 | 48 |
|
112 | | -_For more examples, please refer to the [Documentation](https://example.com)_ --> |
| 49 | +```bash |
| 50 | +make dev |
| 51 | +``` |
113 | 52 |
|
114 | | -<!-- ROADMAP --> |
115 | | -## Roadmap |
| 53 | +## 🏗️ Project Structure |
116 | 54 |
|
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 | +``` |
118 | 64 |
|
119 | | -<!-- CONTRIBUTING --> |
120 | | -## Contributing |
| 65 | +## 🛠️ Technology Stack |
121 | 66 |
|
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 |
123 | 74 |
|
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 |
129 | 76 |
|
130 | | -**Prerequisites**: |
| 77 | +The API documentation is available at `/swagger` when running the application. |
131 | 78 |
|
132 | | -- Golang |
| 79 | +## 🔧 Configuration |
133 | 80 |
|
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: |
139 | 82 |
|
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 |
141 | 87 |
|
142 | | - ```sh |
143 | | - sudo apt-get install docker docker-compose docker.io -y |
144 | | - ``` |
| 88 | +See `.env.example` for all available configuration options. |
145 | 89 |
|
146 | | -- Environment: see "_.env.example_" |
| 90 | +## 🧪 Testing |
147 | 91 |
|
148 | | -**Installation**: |
| 92 | +Run the test suite: |
149 | 93 |
|
150 | | -1. Clone the repo |
| 94 | +```bash |
| 95 | +make test |
| 96 | +``` |
151 | 97 |
|
152 | | - ```sh |
153 | | - git clone https://github.com/c-4u/pinned-place.git |
154 | | - ``` |
| 98 | +## 📦 Deployment |
155 | 99 |
|
156 | | -2. Run |
| 100 | +### Docker |
157 | 101 |
|
158 | | - ```sh |
159 | | - make up |
160 | | - ``` |
| 102 | +Build and run using Docker: |
161 | 103 |
|
162 | | -3. Test |
| 104 | +```bash |
| 105 | +make docker-build |
| 106 | +make docker-run |
| 107 | +``` |
163 | 108 |
|
164 | | - ```sh |
165 | | - make gtest |
166 | | - ``` |
| 109 | +### Kubernetes |
167 | 110 |
|
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 |
169 | 126 |
|
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 |
174 | 128 |
|
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. |
178 | 130 |
|
179 | | -<!-- Distributed under the MIT License. See `LICENSE` for more information. --> |
| 131 | +## 👥 Authors |
180 | 132 |
|
181 | | -<!-- CONTACT --> |
182 | | -## Contact |
| 133 | +- **Patrick Ferraz** - *Initial work* |
183 | 134 |
|
184 | | -Coding4u - contato@coding4u.com.br - [website](http://coding4u.com.br) |
| 135 | +## 🙏 Acknowledgments |
185 | 136 |
|
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 |
187 | 140 |
|
188 | | -<!-- ACKNOWLEDGEMENTS --> |
189 | | -<!-- ## Acknowledgements |
| 141 | +--- |
190 | 142 |
|
191 | | -* []() |
192 | | -* []() |
193 | | -* []() --> |
| 143 | +⭐ Star this repository if you find it useful! |
0 commit comments