An events-browsing platform built using ASP.NET Core Razor Pages, allowing users to host, discover and register (among other things) for upcoming events
This project is not production ready and could do with some optimisations (more so regarding database reads).
- Programming Languages: C# and TypeScript(frontend scripts)
- Framework: ASP.NET Core Razor Pages
- Data Access: Entity Framework Core and SQLite
- User Authentication: ASP.NET Core Identity
- External Email Service: PostMark
- Version Control: Git
- Code Editor/IDE: JetBrains Rider
- UX/UI Mockups: Adobe XD
With this project, I aimed to gain hands-on experience with building real-world applications, focusing on:
- Designing and implementing a data model with Entity Framework Core.
- Implementing user authentication and authorization with ASP.NET Core Identity.
- Utilizing Razor Pages to create dynamic and interactive user interfaces.
- Integrating an external email service (PostMark) for user notifications.
This project also served as a platform to explore and address challenges associated with:
- Reading and writing to a SQL DB using Entity Framework Core for data access, including mapping existing C# classes to database tables.
- Implementing secure user authentication practices (such as email verification).
- Integrating external services like PostMark in order to send automated emails to users.
Due to time constraints during development, I decided to prioritise functionality over efficiency in some areas.
In the future, I'd begin by swapping some LINQ-based database reads with literal SQL queries, adding indexes for more commonly queried attributes, and potentially using SQL views for common queries (most popular events). I'd also work on further abstracting some functionality, resulting in a more efficient and cleaner codebase.
To increase account security, there are multiple points during the application where users are sent email notifications:
- Password resets
- Email changes
- Account email verification
This functionality utilises PostMark. To configure PostMark for use within this project, create a new PostMark server. From here, you'll find your API Token(s); you'll need this later.
- Clone the Repository:
git clone https://github.com/JoshA02/Evently.git
- Install Dependencies:
cd Evently npm i
- DotNet User-Secrets:
This project uses Postmark to send emails to registered users. For this, both the 'from email' and Postmark API token are grabbed from DotNet user secrets file. To configure this:
- Navigate to the project directory (
cd Evently
) - Run
dotnet user-secrets init
- Define both
PostmarkToken
andPostmarkFromEmail
- Navigate to the project directory (
cd Evently
) - Set your PostMark API token by running
dotnet user-secrets set PostmarkToken [token]
from the project directory.[token]
can be found in your PostMark server's 'API Tokens' tab.
- Set the email address PostMark will send emails from by running
dotnet user-secrets set PostmarkFromEmail [email]
from the project directory.[email]
should be the email address you used when signing up for PostMark.
- Navigate to the project directory (
- Navigate to the project directory (
- Compile TS to JS using tsc:
- Navigate to the
Evently/evently/wwwroot/scripts
folder (cd Evently/evently/wwwroot/scripts
) - Run tsc to compile all TypeScript code in the scripts directory to JavaScript (
npx tsc
)
- Navigate to the
- Restore NuGet packages:
To reduce the size of the repo, I have omitted the
evently/obj
folder. Doing this means that you must restore all NuGet packages for this project before running. One way to do this is via the NuGet CLI:- Navigate to the project directory (
cd Evently
) - Run
nuget restore evently.sln
- Navigate to the project directory (
- Add EFC Migration and Update Database:
The provided files do not include any prior database migrations. Due to this, you will need to add a new migration, before updating the database. To do this in JetBrains Rider:
- Navigate to
Tools > Entity Framework Core > Add Migration
, setDbContext class
toEventAppDbContext
, and clickOK
. - Upon adding the migration, navigate to
Tools > Entity Framework Core > Update Database
, setDbContext class
toEventAppDbContext
, tickUse the default connection of the startup project
, and clickOK
.
- Navigate to
- Run the Application:
- You can run the app using Rider/Visual Studio's run buttons (select the 'http' launch profile).
- Alternatively, you can manually run the
dotnet run --launch-profile "http"
command and visithttp://localhost:5139
in a web browser.