We recommend you to do local setup in a Linux environment. We will soon update the readme for Windows setup.
If you're reading this, you're probably creating a Pull Request or planning to do so and that's great!🥳
-
Fork this repository.
-
Clone the forked repository.
git clone https://github.com/<your_username>/busify.git
-
Navigate to the project directory.
cd busify
-
Run the docker container with the command (make sure you have docker installed before running this).
To Install Docker in Linux
To Install Docker in Windows
After installing docker, run the following command to start database containers.
docker compose --env-file backend/.env up
💡Make Sure Your Docker is running/ON during the whole SetUp
-
In new terminal type
cd backend npm install npm run migrate:dev npm run seed npm run start:dev
This will start the backend server.
-
Open another new terminal and type
cd frontend npm install npm run dev
This will start the frontend server.
-
Make changes in source code.
-
Stage your changes and commit
git add <filename>
- Commit your changes
git commit -m "<type>(optional_scope): <your_commit_message>"
-
Push your local commits to the remote repo.
-
git push
-
Create a PR to develop repository.
-
Please remember to include an .env file in both the frontend and backend directories. You can reference any two of the environment variables present in Discord for your configuration.
-
Ensure Docker is running throughout the setup process. Make sure both the Redis stack and Progress components are up and running.
-
Right-click on homepage, inspect, navigate to console, access application > cookies, delete JWT files to troubleshoot login issues.
-
Please use ESLint for code quality checks and Prettier for consistent code formatting before submitting pull requests. This ensures a clean and readable codebase. Thank you!
- To resolve port 3333 issues, use netstat to find the PID associated with it, then taskkill to terminate the process using that PID.
For Windows
netstat -ano | findstr :3333
taskkill /PID <PID> /F
For Linux
sudo lsof -i | grep 3333
kill <PID>
- Stop local PostgreSQL and Redis to free up ports 5432 and 6379 for Docker, or configure Docker to use different ports.
For PostfreSQL
On Windows
net stop postgresql
On Linux
sudo service postgresql stop
For Redis
On Windows
net stop Redis
On Linux
sudo service redis-server stop
-
Navigate to the repository's directory:
cd <repository-directory>
-
Ensure you are on the branch you want to use as the base branch:
git checkout <base-branch>
-
Create a new branch for your pull request:
git branch <new-branch-name>
-
To Switch to New created branch
git checkout -b <new-branch-name>
-
Stage and commit your changes:
git add . git commit -m "<type>(optional_scope): <your_commit_message>"
-
Replace "Your commit message here" with a descriptive message that summarizes the changes you made.
-
Push the new branch to the remote repository:
git push origin <new-branch-name>
This command pushes the new branch to the remote repository, making it available for others to see and review.
- On GitHub navigate to the repository and locate the "New Pull Request" button.
In our project, we follow the convention of using conventional commit messages for all commits. Conventional commit messages provide a standardized format for commit messages, making it easier to understand and track changes in our codebase.
A conventional commit message consists of a concise and structured format:
<type>(optional_scope): <your_commit_message>
The message includes a type and a description, separated by a colon. Here's a breakdown of each component:
Type: The type indicates the nature of the commit and should be selected from a predefined set of types that are relevant to the changes made. Some common types include:
- feat: for a new feature implementation.
- fix: for a bug fix.
- docs: for documentation changes.
- chore: for maintenance or general housekeeping tasks.
- test: for adding or modifying tests.
- refactor: for code refactoring without changing functionality.
- style: for code style changes (e.g., formatting, indentation).
Description: The description provides a brief summary of the changes made in the commit. It should be concise but descriptive enough to understand the purpose of the commit.
Examples:-
feat(backend): Add search feature....