https://github.com/arya2004/xyfin
xyfin
https://github.com/arya2004/xyfin
docker golang grpc kubernetes postgresql redis
Last synced: 3 months ago
JSON representation
xyfin
- Host: GitHub
- URL: https://github.com/arya2004/xyfin
- Owner: arya2004
- License: mit
- Created: 2024-07-14T14:24:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-15T18:33:30.000Z (over 1 year ago)
- Last Synced: 2026-01-12T01:33:02.467Z (3 months ago)
- Topics: docker, golang, grpc, kubernetes, postgresql, redis
- Language: Go
- Homepage: https://hub.docker.com/r/zieglernattacatalyst/xyfin
- Size: 157 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Xyfin
## Prerequisites
- Docker
- PostgreSQL
- Go
- `migrate` tool for database migrations
- `sqlc` for Go code generation from SQL queries
- Protocol Buffers (`protoc`) for gRPC
## Setup
### 1. Network Setup
First, create a Docker network for the application:
```bash
make network
```
### 2. Database Setup
To set up the PostgreSQL database, run:
```bash
make postgres
```
After the database container is running, create the `xyfin` database:
```bash
make createdb
```
You can drop the database using:
```bash
make dropdb
```
### 3. Running the Server
To start the Xyfin server, use:
```bash
make server
```
### 4. Database Migrations
To apply all database migrations, run:
```bash
make migrateup
```
To apply a single migration, use:
```bash
make migrateup1
```
To rollback all migrations:
```bash
make migratedown
```
To rollback a single migration:
```bash
make migratedown1
```
### 5. Code Generation
Generate Go code from SQL queries using:
```bash
make sqlc
```
### 6. Protocol Buffers and gRPC
To regenerate Protocol Buffers and gRPC code:
```bash
make proto
```
### 7. Testing
Run the test suite with:
```bash
make test
```
### 8. Mock Generation
Generate mock implementations for testing:
```bash
make mock
```
### 9. Additional Services
Start a Redis container:
```bash
make redis
```
## Start Command
To start the Xyfin server with the necessary database connection, use the following command:
```bash
make run
```
This command starts the previously created Docker container for PostgreSQL and runs the Xyfin application.
## Documentation
To build database documentation:
```bash
make db_docs
```
To generate a SQL schema from the DBML:
```bash
make db_schema
```
## Development Tools
- **Evans CLI**: gRPC CLI client for testing your gRPC services.
```bash
make evans
```
## Contributing
1. Fork the repository.
2. Create a feature branch.
3. Commit your changes.
4. Push to your branch.
5. Create a new Pull Request.
## License
Xyfin is licensed under the MIT License. See [LICENSE](LICENSE) for more information.