Skip to content

Commit

Permalink
chore: update README and Makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeirojose committed Oct 9, 2024
1 parent 53f8b8f commit 64f65ab
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 8 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
prepare-dev:
install:
@echo "Preparing development environment..."
$(MAKE) -C ./apps/govquests-api prepare-dev
@echo "Database is running on Docker."
@echo "Installing dependencies..."
pnpm install
$(MAKE) -C ./apps/govquests-api install
@echo "Dependencies installed..."
@echo "Setting up database..."
$(MAKE) -C ./apps/govquests-api/rails_app setup
@echo "Database is running on Docker."
@echo "Development environment ready."

102 changes: 100 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,101 @@
# README
# GovQuests

- Rails API runs in port 3001, and next app runs in port 3000
GovQuests is a platform designed to gamify governance participation and education in the Optimism ecosystem. It combines a Ruby on Rails API backend with a Next.js frontend to create an engaging experience for users to learn about and participate in governance activities.

## Project Structure

The repository is organized as a monorepo with the following structure:

- `apps/`
- `govquests-api/`: Ruby on Rails API backend
- `govquests/`: Core domain logic organized by bounded contexts
- `infra/`: Domain infrastructure-related code
- `rails_app/`: Rails application
- `govquests-frontend/`: Next.js frontend application

## Prerequisites

- Node.js (version specified in `.tool-versions`)
- pnpm
- Ruby (version specified in `.tool-versions`)
- Docker (to spin up a PostgreSQL instance), or PostgreSQL itself (if using this don't forget to update credentials in database.yml or set DATABASE_URL)

## Setup

1. Clone the repository:

```
git clone https://github.com/your-org/govquests.git
cd govquests
```

2. Install dependencies and prepare the development environment:

```
make prepare-dev
```

This command will:

- Set up the database in Docker
- Install Node.js dependencies using pnpm
- Install Ruby dependencies for the API and its subprojects

## Development

To start the development servers:

1. For the API (from the `apps/govquests-api/rails_app` directory):

```
bin/rails server
```

2. For the frontend (from the `apps/govquests-frontend` directory):

```
pnpm dev
```

## Testing

Run tests for all projects:

```
pnpm test
```

To run tests for specific parts of the application:

- API: `make -C apps/govquests-api test`
- Frontend: `pnpm --filter govquests-frontend test`

## Linting and Type Checking

- Lint the entire project:

```
pnpm lint
```

- Run type checking:

```
pnpm check-types
```

## Building for Production

Build all projects:

```
pnpm build
```

## Contributing

Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
3 changes: 1 addition & 2 deletions apps/govquests-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ help:
@echo " lint - Run linter on rails_app"
@echo " sorbet - Run Sorbet type checking on rails_app"
@echo " mutate - Run mutation tests where applicable"
@echo " prepare-dev - Prepare development environment"
@echo " clean - Clean up (if defined)"
@echo " help - Show this help message"
@echo " help - Show this help message"
6 changes: 5 additions & 1 deletion apps/govquests-api/rails_app/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
install:
@bundle install

setup:
docker-compose up -d
@bundle exec rails db:setup

test:
@bin/rspec

Expand All @@ -27,4 +31,4 @@ sorbet/bump:
bundle exec spoom srb bump --from true --to strict || true;
bundle exec spoom srb bump --from strict --to strong || true;

.PHONY: install test lint sorbet
.PHONY: install test lint sorbet

0 comments on commit 64f65ab

Please sign in to comment.