Getting started

To get started with Magic you’ll need the following installed.

  1. MySQL - Future versions will support MSSQL
  2. Visual Studio Code, or Visual Studio if you’re on Windows
  3. NodeJS - To serve the frontend/dashboard
  4. Angular, which is installed using npm install -g @angular/cli after installing NodeJS
  5. DotNet CLI - Unless you’re using Visual Studio on Windows

Then download Magic, unzip it, and follow the instructions in the following video.

List of what to do

  1. Open Visual Studio Code in your magic folder
  2. Edit your appsettings.json file, and modify your MySQL connection string
  3. Open one terminal window and go to magic.backend
  4. Run dotnet run in the magic.backend terminal
  5. Open another terminal window and go to frontend
  6. Run npm install in this terminal
  7. When npm install from above is done, run ng serve in the frontend terminal
  8. Open your browser and point it to http://localhost:4200

Visual Studio for Windows considerations

If you’re using the full version of Visual Studio, you might have to edit your frontend/src/environments/environment.ts file, and change its apiURL setting to http://localhost:55246/api/, and its apiDomainsetting to localhost:55246.

Creating your first CRUD Web API

  1. Login with “root/root” as your username/password
  2. Click the “Crudify” menu item
  3. Choose your database and your table
  4. Click the “Crudify” button at the bottom of your page

If you don’t have a MySQL database, you can find a simple CRM database schema in the “misc” folder of your Magic download, which you can run through the SQL executor, that you can find in the “SQL” menu at the top of your page.

When you have created your first CRUD endpoints, you can click the “Endpoints” menu item, and try out your newly created HTTP REST endpoints. At this point you can start creating your frontend, in for instance Angular, to access your database over HTTP.

Custom SQL