A Ruby on Rails application for shortening URLs, with geolocation tracking.
To run the full stack including the PostgreSQL database:
- Ensure you have Docker and Docker Compose installed.
- Clone this repository.
- Navigate to the project directory.
- Run:
docker-compose up
- The application will be available at
http://localhost:3000.
To stop the containers:
docker-compose down-
Ensure you have Ruby, Rails, and PostgreSQL installed.
-
Clone this repository.
-
Navigate to the project directory.
-
Run:
bin/setup
This will set up the database, install all gem dependencies, and Yarn packages.
-
To start the development server with Foreman, run:
bin/dev
This application is hosted on Fly.io!
The link for my application can be found at: https://noah-rijkaard-url-shortner.fly.dev/
The fly.toml file in the root directory contains the main configuration for the Fly.io deployment. Key aspects include:
- App name and primary region
- HTTP service configuration
- Environment variable management
- Volume mounts for persistent storage
To deploy updates:
- Ensure you have the Fly CLI installed and are logged in.
- Run:
fly deploy
If you want to launch the app for the first time
- Run:
fly login
- Complete the login steps on the site
- Run:
fly launch
- And copy over the config to your project
For more details on Fly.io deployment, refer to their documentation.
For checking the statistics, please reffer to the statistics button found on the top left of any page in the application (besides the admin page), this will lead you to either an overall user stats page or a individual links one
I also have added the Rails admin gem, this will allow you to see all of the data from tables in a neatly organized UI, including the usage statistics table showcasing users geolocation data as well as the time accessed for each URL.
This page can be accessed via the admin page button in the header or going to the /admin page manually in the URL
This application uses several key dependencies, including:
- Rails: The web application framework used for building the application.
- PostgreSQL: The database used for Active Record.
- Puma: The web server for serving the application.
- Hotwire: For SPA-like page acceleration with Turbo and Stimulus.
- Geocoder: For finding users' geolocation.
- Devise: For user authentication.
- RSpec: For testing the application.
- Brakeman: For static analysis of security vulnerabilities.
- URL shortening
- Geolocation tracking of URL accesses
- ...
[Include contribution guidelines here]
[Include license information here]