- URL shortening: Users can enter a long URL and get a shortened URL that can be easily shared.
- Redirects: The shortened URL redirects to the original long URL.
The project utilizes the following technologies:
-
Backend:
- NodeJS: A JavaScript runtime for building server-side applications.
- ExpressJS: A lightweight framework for building web applications.
- MongoDB: A document-oriented NoSQL database.
-
Frontend:
- Next.js: A React framework for building server-side rendered and statically generated web applications.
- TypeScript: TypeScript is used throughout the project to ensure strong type safety and enhance the development process.
- Tailwind CSS: Tailwind CSS is used for styling the frontend, offering a utility-first approach and speeding up the design process.
To setup the application locally, follow these steps:
-
Star and Fork this repo to create your own copy to work from.
-
Clone the repository you forked to your local machine using:
git clone <your_forked_repo_url>
-
Navigate to the Server directory using command "cd server" and create a .env file and copy contents of .env.example file to .env file and add all secret keys to setup MongoDB database.
-
Install dependencies in server directory of project:
npm install
-
Start the server using command:
npm start
-
Now Navigate to the client directory using command "cd client" and create a .env.local file and copy contents of .env.sample file to .env.local file and add server URL.
-
Install dependencies in client directory of project:
npm install
-
Start the application using command:
npm start
-
Open http://localhost:3000 in your browser to see the application.
-
Run mongodb database locally if not running, Open Git Bash in root directory of your project where Setup.sh file is present and run the below command:
./script.sh
-
This will setup the frontend application and database, finally start the server using below command:
cd server npm start
Contributions are welcome! If you would like to contribute to the project, please follow these steps:
-
Clone and setup this application locally by following above application setup steps.
-
Create a new branch for the issue you assigned to work on, using below command:
git checkout -b your_branch_name
-
Make your changes to the code.
-
Once you are satisfied with your changes, commit them with a descriptive commit message using below command:
git add . git commit -m "feat: Add feature X"
-
Push your changes to your forked repository:
git push origin your_branch_name
-
Create a pull request by clicking the "Pull request" button on the original repository page.
-
Wait for the project maintainer to review your pull request and provide feedback.
-
If your pull request is accepted, it will be merged into the main branch of the project. Congratulations, you've contributed to the project!
To use the app, follow these steps:
- Enter a long URL in the input field and click the "Shorten" button.
- Copy the shortened URL and share it with others.
-
Checkout and make your changes for the develop branch only: When working on your contributions, switch to the develop branch in your local repository. This ensures that you are working on the latest version of the codebase.
-
Create pull requests only for the develop branch: When you are ready to submit your changes, create a pull request (PR) targeting the develop branch. This allows the maintainers to review and merge your code into the main development branch.
-
Maintain contribution guidelines: Each project may have its specific contribution guidelines. It's important to familiarize yourself with these guidelines before submitting your contributions. Adhering to these guidelines ensures consistency and helps maintain the quality of the codebase.
-
Format your commit message with the issue number: When making commits related to an issue, follow the format Fixes: #10 in your commit message. Replace 10 with the issue number you are addressing. This helps track and manage issues more efficiently.
-
Attach a Postman response screenshot for backend tasks: For tasks related to the backend, it is recommended to include a screenshot of the Postman response along with your pull request. This provides additional context and helps reviewers understand the changes made and their impact on the backend functionality.
-
Make your pull request descriptive and include examples: When creating a pull request, provide a clear and descriptive explanation of the changes you made. This helps reviewers understand the purpose and significance of your contribution. Additionally, including at least one example that demonstrates the intended usage or effect of your changes can be beneficial.
-
Rebase your commits and optimize file changes: When submitting your pull request, consider rebasing your commits into one commit and optimizing your file changes. This helps keep the commit history clean and makes it easier for reviewers to understand your changes.
Remember, following these guidelines will help ensure a smooth and efficient contribution process. Happy coding!
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
This project is licensed under the MIT License.