Welcome to the backend service for Cosmink, a graphical insights analyzer. This project provides the server-side infrastructure, including user authentication, database interaction, and API handling, to support the visualization and analysis features of Cosmink.
The backend is organized into a modular and scalable structure:
├── auth
│ ├── core
│ └── infra
├── graph
│ ├── controller
│ ├── core
│ └── infra
└── libs
├── database
├── route
└── utils
Ensure you have the following installed:
-
Clone the repository:
git clone <repository-url> cd cosmink-backend
-
Install Go dependencies:
go mod download
-
Build the application:
make build
-
Run the application:
make run
To build and run the application using Docker:
-
Build the Docker image:
make docker-build
-
Run the Docker container:
docker run -p 8080:8080 go-app:test
-
Create a new migration:
make create-migration name=<migration_name> db=<database_name>
-
Apply migrations using
migrate
:migrate -database postgres://localhost:5432/<db_name> -path migrations up
Run unit tests:
make test
Run tests in Docker:
make docker-test
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m 'Add feature'
). - Push to the branch (
git push origin feature-name
). - Open a pull request.