pinMap.from.2026-03-05.18-40-25.mp4
PinMap is a location-based application where users can pin their locations on a map. The application allows users to view and share locations with others, along with their usernames. The application uses the Rails framework for the backend, Inertia.js for seamless page navigation, and React for the frontend with Leaflet.js for the map display.
- User Authentication: Custom registration and login system (Devise not used). Users can register, log in, and log out. Pins are associated with the currently logged-in user.
- Admin Panel: Admin users can access a protected dashboard, view all registered users, and delete them if necessary.
- Map Integration: Display all user pins on an interactive Leaflet.js map. Each pin shows the user's username.
- Location Pins: Users can add their latitude and longitude through a geolocation-enabled interface.
- Anonymous Usage: Even without logging in, users can still view the map and pins (without interaction).
- Role-based Redirection: After login, admins are redirected to
/adminand regular users to/. - Session Handling & Flash Messages: Flash messages are sent with login/logout, error, or success status using Inertia.
- Route Protection: Admin routes are protected server-side, redirecting unauthorized or non-logged-in users.
- Custom 404 Page: Unrecognized routes are redirected to a friendly 404 error page.
- Ruby on Rails: Backend framework handling routing, sessions, user management, and database interaction.
- Inertia.js: Provides a smooth SPA-like experience while keeping server-side rendering.
- React.js: Used for dynamic components and frontend logic.
- Leaflet.js: Interactive map rendering.
- PostgreSQL: Primary database for users and pins.
- Ruby version: 3.2.2
- Rails version: 7.x.x
- Node.js: 16.x or higher
- Yarn: For managing frontend dependencies
- PostgreSQL: Database server
To run the project locally:
git clone https://github.com/abrakingoo/pinMap.gitcd pinMapbundle installyarn installbin/rails db:create
bin/rails db:migrate
bin/rails db:seed # optionalbin/rails serverOpen your browser and go to http://localhost:3000
- Database creation:
bin/rails db:create - Migrations:
bin/rails db:migrate - Seeding:
bin/rails db:seed(optional)
Make sure PostgreSQL is running locally or properly configured.
- Install necessary dependencies:
bundle install --without production- Run all tests:
bin/rails test- Run specific tests:
bin/rails test test/models/pin_test.rbCurrently, no external services are required. If scaling:
- Sidekiq: Background job processing
- Redis: Caching
- Elasticsearch: Full-text search
- Set up your production server (e.g., Heroku, AWS, Render, DigitalOcean).
- Configure environment variables (e.g.,
SECRET_KEY_BASE). - Push to production branch:
git push heroku main- Run database migrations:
heroku run bin/rails db:migrate- Visit the live app via your hosting provider URL.
- Fork the repository
- Create your feature branch:
git checkout -b feature-name - Commit your changes:
git commit -am 'Add new feature' - Push the branch:
git push origin feature-name - Open a Pull Request
This project is open-source and available under the MIT License.