To get started with Magic you’ll need the following installed.
- MySQL - Future versions will support MSSQL
- Visual Studio Code, or Visual Studio if you’re on Windows
- NodeJS - To serve the frontend/dashboard
- Angular, which is installed using
npm install -g @angular/cliafter installing NodeJS
- 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
- Open Visual Studio Code in your magic folder
- Edit your
appsettings.jsonfile, and modify your MySQL connection string
- Open one terminal window and go to
dotnet runin the magic.backend terminal
- Open another terminal window and go to
npm installin this terminal
- When npm install from above is done, run
ng servein the frontend terminal
- 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
Creating your first CRUD Web API
- Login with “root/root” as your username/password
- Click the “Crudify” menu item
- Choose your database and your table
- 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.