You are on page 1of 7

MFL Server Setup

Backend Setup of MFL Server (MacBook):

Software Needed:
1. Visual Studio (Download)
2. Microsoft Sql Server Management Studio(ssms) and SQL Server(Download)

Step 1: Clone the repo ‘MFLServer’ with submodules. (either via visual studio or by
command ‘git clone --recurse-submodules -j8 https://roshan-
mehta@bitbucket.org/MFLEduClub/mflserver.git’.
For already cloned repo, you can add submodules with “git submodule update --init --recursive”
this command.

Step 2: Open ssms and connect to an instance of sql. For the name of instance , you
can write just “.” or “localhost”.

Step 3: Now open Appsetting.development.json (inside Appsetting of MFLWebsite)


and in the key named “DefaultConnection”, paste the value
“Server=(localdb)\\.;Database=MFL;Trusted_Connection=True;MultipleActiveResultSets=tru
e”.

Step 4: For database setup, Open Package manager console (in visual studio) and
Run the following command.
1. Select the target project (in the package manager console) as ‘Identity Service’
and run ‘Update-Database -Context AppDbContext’.
2. Select the target project as EventsApi and run “Update-Database -Context
EventsApplicationDbContext’.
3. Select the target project as ParkyApi and run “add-migration ParkyMigration -Context
ApplicationDbContext” and then run “Update-Database -Context
ApplicationDbContext”.
Now, your all table is created, you can see your table in SSMS.

Note: if you are not using visual studio, you can find equivalent dotnet command here.
[Equivalend code]

-for any query, mail me at roshankumar@mfleduclub.com

Backend Setup of MFL Server (Windows):


Software Needed:
1. Visual Studio (Download)

2. Microsoft Sql Server Management Studio(ssms) and SQL Server(Download)

SSMS Download Page


SQL Server Download Page

Cloning and Setting Up the Repository

Step – 1:
1st Method (Using Command Line):
Clone the repo ‘MFLServer’ with submodules by command “git clone --
recurse-submodules -j8 https://your-MFLid@bitbucket.org/MFLEduclub/mflserver.git”.
For already cloned repo, you can add submodules with “git submodule update --init --
recursive” this command.

2nd Method (Using Visual Studio):


1.Clone the repo ’MFLServer’ using the ‘Clone the Repository’ button present in
Visual Studio.

2.Provide the command string(“https://your-


MFLid@bitbucket.org/MFLEduclub/mflserver.git”) in repository location and select the
path. 

Step 2: Provide your credentials on the popup dialog boxes. (2 times)

Step 3: Now open Appsetting.development.json (inside Appsetting of MFLWebsite)


and in the key named “DefaultConnection” and “MflWebsite_db”, paste the value
"Server=(localdb)\\mssqllocaldb;Database=MFLEduclub;Trusted_Connection=True;M
ultipleActiveResultSets=true”.

Step 4: Now open Appsettings.json (inside ParkyApi) and in the key named
“DefaultConnection” paste the value
"Server=(localdb)\\mssqllocaldb;Database=MFLEduclub;Trusted_Connection=True;M
ultipleActiveResultSets=true”.
Step 4: Open View->SQL Server Object Explorer. Expand SQL Server ->
(localdb)\MSSQLLocalDB -> databases. Right click on ‘Databases’ then click on ‘Add New
Database’. On Database Name field type ‘MFLEduclub’.

Step 5: For database setup, Open Package manager console (in visual studio) and
Run the following command.
1. Select the target project (in the package manager console) as
‘identityservice.infra’ and run

1. ”add-migration SomeName -context AppDbContext”


2. ”Update-Database -Context AppDbContext”.

2 . Select the target project (in the package manager console) as ‘ParkyApi’ and run

1. ”add-migration SomeName -context ApplicationDbContext”


2. ”Update-Database -Context ApplicationDbContext”.

3. Select the target project (in the package manager console) as ‘EventsApi’ and run
1. ”add-migration SomeName -context EventsApplicationDbContext”
2. ”Update-Database -Context EventsApplicationDbContext”.

Now, your all tables are created. Open View->SQL Server Object Explorer. Expand SQL
Server -> (localdb)\MSSQLLocalDB -> databases -> MFLEduclub -> tables to view all the
tables.

To edit the tables right click on each table and click on view data and then edit.

Note: if you are not using visual studio, you can find equivalent dotnet command here.
[Equivalent code]

-for any query, mail me at prasannjit@mfleduclub.com

You might also like