-
Notifications
You must be signed in to change notification settings - Fork 3
Developer Workspace Setup
We use the nix package manager for builds and environments for
- Reproducible environments across systems
- Pinned versions of tooling
Nix replaces usage of multiple other package managers
Run this command in the terminal. Then, run the following commands:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
Use Linux inside of Windows! WSL install guide Install nix with this command Might be relevant advice here
Follow these instructions for multi-user installation. Then, run the following commands:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
Install the package with Nix:
nix-env -iA nixpkgs.direnv
Setup direnv with your shell (by default most systems use BASH)
Automatically loads development shell and loads important environment variables from .env
Use git to clone the project wherever you want to
git clone [email protected]:neu-dsg/dailp-encoding dailp
cd dailp
Reach out to Naomi Trevino ([email protected]) for a file called .env
. Place this file in the cloned repository.
Run direnv allow
to tell direnv that you trust our environment configuration.
The first run will take a while as it installs stuff Whenever you cd to DAILP later, it’ll automatically load Rust, NodeJS, Postgres, etc.
Use the following commands to run different components locally:
Command | Description |
---|---|
dev-database |
Starts an instance of the database if possible. |
dev-migrate-schema |
Run pending schema migrations on local database, if any exist. Requires a running database instance. |
dev-migrate-data |
Pull data from spreadsheets into local database. Requires a running database. |
dev-graphql |
Open a GraphQL server on port 8080. |
dev-website |
Build and deploy website to port 3001. |
Run dev-database
in one terminal. Do not cancel the process or close the open terminal as you complete the next steps.
In a new terminal, run dev-migrate-schema
then dev-migrate-data
. You only need to do this once. You may close this terminal or run new commands in this terminal once data migration is complete.
Run dev-graphql
in a second terminal. Do not cancel the process or close the open terminal as you complete the next steps.
In a third terminal, run dev-website
. Open your browser to http://localhost:3001 to see the website. At this point, you can also open your browser to http://localhost:3001/graphql to view the GraphQL playground.
All of the DAILP team uses VS Code since it is well supported, well documented, multi-language, powerful, adaptable, and free. That being said, you can use any code editor you like.
- Version controlling code
- Separating feature development from deployed code
- Reviewing changes made by other people
- Tightly controlling infrastructure changes
- We strongly recommend using VS Code's basic git support, optionally supplemented by the GitLens extension.
- The Git CLI works well for the basics.
- Even though we recommend using VSCode basic git + GitLens, you may use any git client you want.
- Connect to git with SSH
- Use Feature Branches– do not directly commit to main
- Make atomic commits
- Avoid
git rebase
and other history changing operations unless you need to clean up a branch withgit rebase --interactive
- When you have merge conflicts, use
git merge
- Include both a commit message and a description when theres more context around a commit. Use
git commit
for this.
For each branch you work on, follow these steps:
- Create a new branch with a name related to the task you're working on. ex.
add-user-profile-images
orfix-local-cors
- Write code, tests, and documentation while committing incrementally
- Once your work is ready for review, open a pull request. Add one to two developers as reviewers. Reviewers should aim to give code review feedback promptly– ideally within 48 hours.
- Once the PR is approved, it can be merged into main!