Skip to content

melikpehlivanov/CarDealerSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CarDealerSystem

CarDealer is a system for buying/selling cars in which the users can register and login in order to add vehicles for sale. Vehicle details page shows pretty much all the possible information you would want to know about the vehicle. In the project are also implemented different user roles and areas separated in private sections for admins and regular users. Depending on its role every user can access different sections of the application and has specific permissions of what can or cannot do. P.S In the future many more things will be added.

Used technologies

  • Asp.Net Core 2.1
  • Entity Framework Core

Features

  • Guest users can view vehicles profile page
  • Guest users can search vehicles
  • Guest users can register and login including Facebook and Google authentication
  • After successfull registration user must confirm his/her email, in order to be able to login
  • Registered users can place vehicles for sale
  • Registered users can create/update/delete their ads
  • Admin users can create/update/delete all vehicles, manufacturers and models
  • Admin users can see all users details including vehicles, roles, etc.
  • Admin users can add/remove users to roles
  • All Admin actions are logged
  • Only Senior Administrators can see log information about what admins have done.

Getting started:

In order to run the project you just need to replace the connection string which is located in appsettings.json and run the project. There is a seed method which will insert all manufacturers, models, fuel types, transmission types and etc. Database seeding should take approx. 15-20 minutes depending on your machine. Please keep in mind that you can reduce the time to 2-3 minutes by removing or commenting "SeedOptionalData" method in ApplicationBuilderExtensions.cs but you wont have any users and ads(vehicles) listed and it's NOT recommended.

public static class ApplicationBuilderExtensions
    {
        public static IApplicationBuilder SeedData(this IApplicationBuilder app)
        {
            using (var serviceScope = app.ApplicationServices.GetRequiredService().CreateScope())
            {
                var dbContext = serviceScope.ServiceProvider.GetService();

                dbContext.Database.Migrate();
                SeedRequiredData(dbContext);

                // Delete (Not recommended) or comment this method if you'd like to NOT have initial database with users and vehicles.
                SeedOptionalData(serviceScope, dbContext);
            }

            return app;
        }
    }

The next thing which you have to do if you want to have facebook/google login and email sending functionality is to create your own user secrets otherwise you can skip this part and run the project. You can see more details here:

Example of how your file should look like if you've implemented everything correctly.

{
  "ExternalAuthentications": {
    "Facebook": {
      "AppId": "YourAppId",
      "AppSecret": "YourAppSecret"
    },
    "Google": {
      "ClientId": "YourClientId",
      "ClientSecret": "YourClientSecret"
    }
  },
  "EmailSetting": {
    "SendGridApiKey": "YourSendgridApiKey"
  }
}

NOTE: Some css files are missing from the repository as I don't have permission to distribute them.