| @@ -1,92 +1,90 @@ | ||
| using Microsoft.Data.Entity.Migrations; | ||
| using Microsoft.Data.Entity.Migrations.Builders; | ||
|
|
||
| namespace BaelorApi.Migrations | ||
| { | ||
| public partial class InitialMigration : Migration | ||
| { | ||
| public override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.CreateTable("Album", | ||
| c => new | ||
| { | ||
| Id = c.Guid(nullable: false, identity: true), | ||
| CreatedAt = c.DateTime(nullable: false), | ||
| Genres = c.String(), | ||
| Label = c.String(), | ||
| LengthSeconds = c.Int(nullable: false), | ||
| Name = c.String(), | ||
| Producers = c.String(), | ||
| ReleasedAt = c.DateTime(nullable: false), | ||
| Slug = c.String(), | ||
| UpdatedAt = c.DateTime(nullable: false), | ||
| ImageId = c.Guid(nullable: false) | ||
| }) | ||
| .PrimaryKey("PK_Album", t => t.Id); | ||
|
|
||
| migrationBuilder.CreateTable("Image", | ||
| c => new | ||
| { | ||
| Id = c.Guid(nullable: false, identity: true), | ||
| CreatedAt = c.DateTime(nullable: false), | ||
| FilePath = c.String(), | ||
| UpdatedAt = c.DateTime(nullable: false) | ||
| }) | ||
| .PrimaryKey("PK_Image", t => t.Id); | ||
|
|
||
| migrationBuilder.CreateTable("Song", | ||
| c => new | ||
| { | ||
| Id = c.Guid(nullable: false, identity: true), | ||
| CreatedAt = c.DateTime(nullable: false), | ||
| Index = c.Int(nullable: false), | ||
| LengthSeconds = c.Int(nullable: false), | ||
| Producers = c.String(), | ||
| Slug = c.String(), | ||
| Title = c.String(), | ||
| UpdatedAt = c.DateTime(nullable: false), | ||
| Writers = c.String(), | ||
| AlbumId = c.Guid(nullable: false) | ||
| }) | ||
| .PrimaryKey("PK_Song", t => t.Id); | ||
|
|
||
| migrationBuilder.CreateTable("User", | ||
| c => new | ||
| { | ||
| Id = c.Guid(nullable: false, identity: true), | ||
| ApiKey = c.String(), | ||
| CreatedAt = c.DateTime(nullable: false), | ||
| EmailAddress = c.String(), | ||
| IsAdmin = c.Boolean(nullable: false), | ||
| IsRevoked = c.Boolean(nullable: false), | ||
| PasswordHash = c.String(), | ||
| PasswordIterations = c.Int(nullable: false), | ||
| PasswordSalt = c.String(), | ||
| UpdatedAt = c.DateTime(nullable: false), | ||
| Username = c.String() | ||
| }) | ||
| .PrimaryKey("PK_User", t => t.Id); | ||
|
|
||
| migrationBuilder.AddForeignKey("Album", "FK_Album_Image_ImageId", new[] { "ImageId" }, "Image", new[] { "Id" }, cascadeDelete: false); | ||
|
|
||
| migrationBuilder.AddForeignKey("Song", "FK_Song_Album_AlbumId", new[] { "AlbumId" }, "Album", new[] { "Id" }, cascadeDelete: false); | ||
| } | ||
|
|
||
| public override void Down(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.DropForeignKey("Album", "FK_Album_Image_ImageId"); | ||
|
|
||
| migrationBuilder.DropForeignKey("Song", "FK_Song_Album_AlbumId"); | ||
|
|
||
| migrationBuilder.DropTable("Album"); | ||
|
|
||
| migrationBuilder.DropTable("Image"); | ||
|
|
||
| migrationBuilder.DropTable("Song"); | ||
|
|
||
| migrationBuilder.DropTable("User"); | ||
| } | ||
| } | ||
| } |
| @@ -1,31 +1,29 @@ | ||
| using Microsoft.Data.Entity.Migrations; | ||
| using Microsoft.Data.Entity.Migrations.Builders; | ||
|
|
||
| namespace BaelorApi.Migrations | ||
| { | ||
| public partial class RateLimits : Migration | ||
| { | ||
| public override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.CreateTable("RateLimit", | ||
| c => new | ||
| { | ||
| Id = c.Guid(nullable: false, identity: true), | ||
| CreatedAt = c.DateTime(nullable: false), | ||
| RequestsMade = c.Int(nullable: false), | ||
| UpdatedAt = c.DateTime(nullable: false), | ||
| UserId = c.Guid(nullable: false) | ||
| }) | ||
| .PrimaryKey("PK_RateLimit", t => t.Id); | ||
|
|
||
| migrationBuilder.AddForeignKey("RateLimit", "FK_RateLimit_User_UserId", new[] { "UserId" }, "User", new[] { "Id" }, cascadeDelete: false); | ||
| } | ||
|
|
||
| public override void Down(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.DropTable("RateLimit"); | ||
| } | ||
| } | ||
| } |
| @@ -1,108 +1,107 @@ | ||
| using BaelorApi.Models.Database; | ||
| using Microsoft.Data.Entity.Metadata; | ||
| using Microsoft.Data.Entity.Migrations.Infrastructure; | ||
| using System; | ||
|
|
||
| namespace BaelorApi.Migrations | ||
| { | ||
| [ContextType(typeof(DatabaseContext))] | ||
| public class DatabaseContextModelSnapshot : ModelSnapshot | ||
| { | ||
| public override IModel Model | ||
| { | ||
| get | ||
| { | ||
| var builder = new BasicModelBuilder(); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.Album", b => | ||
| { | ||
| b.Property<DateTime>("CreatedAt"); | ||
| b.Property<string>("Genres"); | ||
| b.Property<Guid>("Id") | ||
| .GenerateValueOnAdd(); | ||
| b.Property<Guid>("ImageId"); | ||
| b.Property<string>("Label"); | ||
| b.Property<int>("LengthSeconds"); | ||
| b.Property<string>("Name"); | ||
| b.Property<string>("Producers"); | ||
| b.Property<DateTime>("ReleasedAt"); | ||
| b.Property<string>("Slug"); | ||
| b.Property<DateTime>("UpdatedAt"); | ||
| b.Key("Id"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.Image", b => | ||
| { | ||
| b.Property<DateTime>("CreatedAt"); | ||
| b.Property<string>("FilePath"); | ||
| b.Property<Guid>("Id") | ||
| .GenerateValueOnAdd(); | ||
| b.Property<DateTime>("UpdatedAt"); | ||
| b.Key("Id"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.RateLimit", b => | ||
| { | ||
| b.Property<DateTime>("CreatedAt"); | ||
| b.Property<Guid>("Id") | ||
| .GenerateValueOnAdd(); | ||
| b.Property<int>("RequestsMade"); | ||
| b.Property<DateTime>("UpdatedAt"); | ||
| b.Property<Guid>("UserId"); | ||
| b.Key("Id"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.Song", b => | ||
| { | ||
| b.Property<Guid>("AlbumId"); | ||
| b.Property<DateTime>("CreatedAt"); | ||
| b.Property<Guid>("Id") | ||
| .GenerateValueOnAdd(); | ||
| b.Property<int>("Index"); | ||
| b.Property<int>("LengthSeconds"); | ||
| b.Property<string>("Producers"); | ||
| b.Property<string>("Slug"); | ||
| b.Property<string>("Title"); | ||
| b.Property<DateTime>("UpdatedAt"); | ||
| b.Property<string>("Writers"); | ||
| b.Key("Id"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.User", b => | ||
| { | ||
| b.Property<string>("ApiKey"); | ||
| b.Property<DateTime>("CreatedAt"); | ||
| b.Property<string>("EmailAddress"); | ||
| b.Property<Guid>("Id") | ||
| .GenerateValueOnAdd(); | ||
| b.Property<bool>("IsAdmin"); | ||
| b.Property<bool>("IsRevoked"); | ||
| b.Property<string>("PasswordHash"); | ||
| b.Property<int>("PasswordIterations"); | ||
| b.Property<string>("PasswordSalt"); | ||
| b.Property<DateTime>("UpdatedAt"); | ||
| b.Property<string>("Username"); | ||
| b.Key("Id"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.Album", b => | ||
| { | ||
| b.ForeignKey("BaelorApi.Models.Database.Image", "ImageId"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.RateLimit", b => | ||
| { | ||
| b.ForeignKey("BaelorApi.Models.Database.User", "UserId"); | ||
| }); | ||
|
|
||
| builder.Entity("BaelorApi.Models.Database.Song", b => | ||
| { | ||
| b.ForeignKey("BaelorApi.Models.Database.Album", "AlbumId"); | ||
| }); | ||
|
|
||
| return builder.Model; | ||
| } | ||
| } | ||
| } | ||
| } |
| @@ -1,3 +1,7 @@ | ||
| { | ||
| "profiles": [ | ||
| { | ||
| "name": "IIS Express" | ||
| } | ||
| ] | ||
| } |
| @@ -0,0 +1,41 @@ | ||
| @{ | ||
| ViewBag.Title = "Baelor Api - "; | ||
| } | ||
|
|
||
| <div id="baelor-splash"> | ||
| <video src="~/video/baelor-home.mp4" loop autoplay> | ||
| </video> | ||
|
|
||
| <div class="mask"> | ||
| <div class="content"> | ||
| <h1>Baelor Api</h1> | ||
| <h2>A fully <strong>RESTful</strong> API for Taylor Swift.</h2> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| @*<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000"> | ||
| <ol class="carousel-indicators"> | ||
| <li data-target="#myCarousel" data-slide-to="0" class="active"></li> | ||
| <li data-target="#myCarousel" data-slide-to="1"></li> | ||
| <li data-target="#myCarousel" data-slide-to="2"></li> | ||
| <li data-target="#myCarousel" data-slide-to="3"></li> | ||
| </ol> | ||
| <div class="carousel-inner" role="listbox"> | ||
| <div class="item active"> | ||
| <video src="~/video/baelor-home.mp4" loop autoplay> | ||
| </video> | ||
| <div class="container"> | ||
| <div class="carousel-caption"> | ||
| <p> | ||
| Learn how to build ASP.NET apps that can run anywhere. | ||
| <a class="btn btn-default btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409"> | ||
| Learn More | ||
| </a> | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div>*@ |
| @@ -0,0 +1,47 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>@ViewBag.Title</title> | ||
|
|
||
| <link rel="stylesheet" href="~/lib/bootstrap/css/bootstrap.css" /> | ||
| <link rel="stylesheet" href="~/css/site.css" /> | ||
| <link rel="stylesheet" href="~/lib/bootstrap-touch-carousel/css/bootstrap-touch-carousel.css" /> | ||
|
|
||
| <link href='http://fonts.googleapis.com/css?family=Exo:100,400' rel='stylesheet' type='text/css'> | ||
| </head> | ||
| <body> | ||
| <div class="navbar navbar-inverse navbar-fixed-top"> | ||
| <div class="container"> | ||
| <div class="navbar-header"> | ||
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | ||
| <span class="icon-bar"></span> | ||
| <span class="icon-bar"></span> | ||
| <span class="icon-bar"></span> | ||
| </button> | ||
| @Html.ActionLink("Baelor Api", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) | ||
| </div> | ||
| <div class="navbar-collapse collapse"> | ||
| <ul class="nav navbar-nav"> | ||
| <li>@Html.ActionLink("Home", "Index", "Home")</li> | ||
| <li>@Html.ActionLink("Docs", "Index", "Docs")</li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <main> | ||
| @RenderBody() | ||
| </main> | ||
| <div class="container body-content"> | ||
| <hr /> | ||
| <footer> | ||
| <p>© @DateTime.Now.Year - Baelor Api</p> | ||
| </footer> | ||
| </div> | ||
| <script src="~/lib/jquery/jquery.js"></script> | ||
| <script src="~/lib/bootstrap/js/bootstrap.js"></script> | ||
| <script src="~/lib/bootstrap-touch-carousel/js/bootstrap-touch-carousel.js"></script> | ||
| @RenderSection("scripts", required: false) | ||
| </body> | ||
| </html> |
| @@ -0,0 +1,4 @@ | ||
| @using BaelorApi; | ||
| @{ | ||
| Layout = "/Views/Shared/_Layout.cshtml"; | ||
| } |
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "BaelorApi", | ||
| "private": true, | ||
| "dependencies": { | ||
| "bootstrap": "3.0.0", | ||
| "jquery": "1.10.2", | ||
| "bootstrap-touch-carousel": "0.8.0" | ||
| }, | ||
| "exportsOverride": { | ||
| "bootstrap": { | ||
| "js": "dist/js/*.*", | ||
| "css": "dist/css/*.*", | ||
| "fonts": "dist/fonts/*.*" | ||
| }, | ||
| "bootstrap-touch-carousel": { | ||
| "js": "dist/js/*.*", | ||
| "css": "dist/css/*.*" | ||
| }, | ||
| "jquery": { | ||
| "": "jquery.{js,min.js,min.map}" | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,35 @@ | ||
| /// <binding BeforeBuild='sass' /> | ||
| /* | ||
| This file in the main entry point for defining grunt tasks and using grunt plugins. | ||
| Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409 | ||
| */ | ||
| module.exports = function (grunt) { | ||
| grunt.initConfig({ | ||
| bower: { | ||
| install: { | ||
| options: { | ||
| targetDir: "wwwroot/lib", | ||
| layout: "byComponent", | ||
| cleanTargetDir: true | ||
| } | ||
| } | ||
| }, | ||
| sass: { | ||
| dist: { | ||
| options: { | ||
| style: 'expanded' | ||
| }, | ||
| files: { | ||
| 'wwwroot/css/site.css': 'Assets/Sass/main.scss' | ||
| } | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| grunt.loadNpmTasks("grunt-bower-task"); | ||
| grunt.loadNpmTasks("grunt-contrib-sass"); | ||
| grunt.registerTask("default", [ | ||
| "bower:install", | ||
| "sass" | ||
| ]); | ||
| }; |
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "version": "1.0.0", | ||
| "name": "BaelorApi", | ||
| "private": true, | ||
| "devDependencies": { | ||
| "grunt": "^0.4.5", | ||
| "grunt-bower-task": "^0.4.0", | ||
| "grunt-contrib-sass": "^0.9.2" | ||
| }, | ||
| "dependencies": { | ||
| "grunt-contrib-sass": "^0.9.2" | ||
| } | ||
| } |