Please go through the Contribution Guidelines before going forward with any development. This helps us keep the process streamlined and results in better PRs.
If you have any setup problems, please ensure you have read through all the instructions have all the required software installed before creating an issue.
If you are facing any issues with the setup, first checkout the troubleshooting guide and if you are still facing issues, feel free to ask in the slack channel.
There are several ways to run your own instance of CircuitVerse:
Method | Operating System | Documentation |
---|---|---|
GitHub Codespaces | Any | Click Here |
Gitpod Cloud Environment | Any | Click Here |
Native Setup | Linux | Click Here |
Native Setup | Mac | Click Here |
Docker Development Environment | Windows | Click Here |
Docker Development Environment | Linux | Click Here |
Docker Development Environment | Mac | Click Here |
WSL Setup | Windows | TODO |
Native Setup | Windows | Click Here |
Tool | Documentation Link |
---|---|
Code Auto Completion | Click Here |
Ruby Debugger | Click Here |
Before making a pull request, it is a good idea to check that all tests are passing locally.
- To run the system tests, run
bundle exec rspec
. - To run the simulator tests, run
yarn run test
.
Note: To pass the system tests, you need the Chrome Browser installed. For docker based setup, you can ignore this.
CircuitVerse API documentation is available at - https://api.circuitverse.org/
If you like to setup CircuitVerse API documentation locally, refer docs/README.md
By default :forum
and :recaptcha
features are set to false. These can be enabled either via rails console or Flipper dashboard.
rails c
# Enable features (:recaptcha, :forum)
> Flipper.enable :recaptcha
# Disable features (:project_comments, :lms_integration)
> Flipper.disable :forum
Flipper dashboard can be accessed at - http://localhost:3000/flipper/ from where following features can be enabled/disabled.
Note : User need to log in as admin first, then only Flipper dashboard can be accessed If you have followed the provided setup documentation, you can log in as admin with following credentials.
User: Admin
Email: [email protected]
Password: password
The following commands should be run for production:
bundle install --with pg --without development test
RAILS_ENV=production bundle exec rake assets:precompile
bundle exec sidekiq -e production -q default -q mailers -d -L tmp/sidekiq.log
The .env
file only needs to be used if you would like to link to third party services (Facebook, Google, GitHub, Gitlab, Slack, Bugsnap and Recaptcha)
- Create an app on the third party service (instructions)
- Make the following changes in your Google, Facebook, GitHub or Gitlab app:
- Update the
site url
field with the URL of your instance, and update thecallback url
field with<url>/users/auth/google
,<url>/users/auth/facebook
,<url>/users/auth/github
or<url>/users/auth/gitlab
respectively.
- Update the
- Configure your
id
andsecret
environment variables in.env
. If.env
does not exist, copy the template from.env.example
. - After adding the environment variables, run
dotenv rails server
to start the application.
If you wish to do Verilog RTL Synthesis/create CircuitVerse Verilog Circuits in your local development environment, you need to:
- Install yosys
- Setup and run CircuitVerse's yosys2digitaljs-server.
-
Install yosys
-
Many Linux distibutions provide yosys binaries which is easy to install & small in package size. For Example, For Debina/Ubunutu:
sudo apt install yosys
-
For other linux distributions, MacOS, & Windows OS, you need to install the OSS CAD Suite
- Download an archive matching your OS from the releases page.
- Extract the archive to a location of your choice (for Windows it is recommended that path does not contain spaces)
- To use OSS CAD Suite
Other Linux distros and macOS
export PATH="<extracted_location>/oss-cad-suite/bin:$PATH" or source <extracted_location>/oss-cad-suite/environment
Windows
from existing shell: <extracted_location>\oss-cad-suite\environment.bat to create new shell window: <extracted_location>\oss-cad-suite\start.bat
-
-
Setup CircuitVerse yosys2digitaljs-server
- In your local CircuitVerse Repository:
git clone https://github.com/CircuitVerse/yosys2digitaljs-server.git cd yosys2digitaljs-server yarn cd ..
- To use CircuitVerse yosys2digitaljs-server:
bin/yosys
- In your local CircuitVerse Repository:
Refer otel docs
The .env
file only needs to be used if you would like to link to third party services (Facebook, Google, GitHub, Gitlab, Slack, Bugsnap and Recaptcha)
- Create an app on the third party service (instructions)
- Make the following changes in your Google, Facebook, GitHub or Gitlab app:
- Update the
site url
field with the URL of your instance, and update thecallback url
field with<url>/users/auth/google
,<url>/users/auth/facebook
,<url>/users/auth/github
or<url>/users/auth/gitlab
respectively.
- Update the
- Configure your
id
andsecret
environment variables in.env
. If.env
does not exist, copy the template from.env.example
. - After adding the environment variables, run
dotenv rails server
to start the application.