This document provides context about the company-ranking project for the Gemini AI assistant.
company-ranking is a web application that displays sales and annual salaries of publicly listed companies in Japan in a ranked format. It supports both English and Japanese languages.
The project is a monorepo composed of a Go backend, a Ruby on Rails batch processing system, and a Next.js frontend.
- Frontend: Next.js (TypeScript) with Tailwind CSS and daisyUI.
- Backend (API): Go using
oapi-codegenfor code generation from an OpenAPI specification. - Backend (Data Processing): Ruby on Rails for scraping and processing company data.
- API Specification: OpenAPI
- Database: PostgreSQL
- Infrastructure:
- Docker for local development environment.
- Terraform for Infrastructure as Code.
- Google Cloud for deployment (inferred from Cloud Build and Terraform configurations).
go/: Go backend API server.ruby/: Ruby on Rails application for data processing tasks.typescript/: Next.js frontend application.openapi/: Contains theopenapi.yamlspecification file.terraform/: Terraform configuration for production infrastructure.supabase/: Contains database schema and seed data.compose.yaml: Docker Compose configuration for local development.Makefile: Top-level Makefile with common commands.
Commands should generally be run from the project root directory.
As per the README.md, the setup process is:
cp .env_sample .envcp .envrc_sample .envrcdocker-compose builddocker-compose run --rm ruby bundledocker-compose run --rm ruby bundle exec rails db:setupdocker-compose run --rm go make install/toolscd typescript && npm install && cd ../docker-compose up
- Go:
make test(defined ingo/Makefile) - Ruby:
docker-compose run --rm ruby bundle exec rspec - TypeScript/Next.js: The project uses ESLint for linting, but a dedicated test script is not present in
typescript/package.json.
- Go:
make lint(defined ingo/Makefile) - Ruby:
docker-compose run --rm ruby bundle exec rubocop - TypeScript/Next.js:
cd typescript && npm run lint
- TypeScript/Next.js:
cd typescript && npm run build
- Go (Server-side from OpenAPI):
make go/generate/server - TypeScript (Client-side from OpenAPI):
make typescript/generate/client
bundle exec rake save_securities:all: Scrapes the security list.bundle exec rake save_document_summary:year: Fetches document metadata from the EDINET API.bundle exec rake save_document_detail:batch: Fetches detailed document data from the EDINET API.