Whale Watching is a full-stack application for recording and viewing whale sightings. It provides an ASP.NET API backend and a modern front-end UI, allowing users to submit reports, search sightings, and manage users via authentication and roles.
- API: ASP.NET Core API located in
/api
Handles backend logic, database, authentication/authorization, RESTful endpoints. - UI: Frontend app located in
/ui
Built with modern JavaScript tooling (e.g., React, Vite), it interacts with the API to provide a user-friendly interface.
git clone https://github.com/the-duckchild/Whale-Watching.git
cd Whale-WatchingSee detailed instructions in api/README.md.
Summary:
cd api
dotnet restore- Create a PostgreSQL role called
whale_spottingwith passwordwhale_spottingin pgAdmin.- Assign privileges: Can login, Create databases, Inherit rights from parent roles.
- Apply migrations:
dotnet ef database update
- .NET Identity set up by default (roles:
User,Admin). - Initial admin and roles are seeded when the API runs.
- User model can be extended in
UserModel.cs. - Use
[Authorize]attribute for endpoints needing authentication, and[Authorize(Roles = "Admin")]for admin access.
dotnet run
dotnet format # Run linter
dotnet format --verify-no-changes # Check code style without rewritingSee detailed instructions in ui/README.md.
Summary:
cd ui
npm install
npm run devnpm run dev— Run the UI in development modenpm run lint— Run the linternpm run lint-fix— Autofix lint issuesnpm run test— Run tests
- Create a GeoNames account, confirm via email.
- Enable free web services in your account settings.
- Add a
.envfile toui:VITE_GEONAMES_USERNAMES="yourUserName"