@@ -1,92 +1,90 @@
using Microsoft.Data.Entity.Migrations;
using Microsoft.Data.Entity.Migrations.Builders;
using Microsoft.Data.Entity.Relational.Model;
using System;

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");
}
}
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;
using Microsoft.Data.Entity.Relational.Model;
using System;

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");
}
}
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;
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")
.GenerateValuesOnAdd();
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")
.GenerateValuesOnAdd();
b.Property<DateTime>("UpdatedAt");
b.Key("Id");
});
builder.Entity("BaelorApi.Models.Database.RateLimit", b =>
{
b.Property<DateTime>("CreatedAt");
b.Property<Guid>("Id")
.GenerateValuesOnAdd();
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")
.GenerateValuesOnAdd();
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")
.GenerateValuesOnAdd();
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;
}
}
}
[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": []
"profiles": [
{
"name": "IIS Express"
}
]
}
@@ -2,7 +2,6 @@
using BaelorApi.Models.Repositories;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Routing;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Logging;
@@ -45,8 +44,8 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)
routes.MapWebApiRoute("v0", "v0/{controller}/{id?}");
});

// Enable Default Welcome Page
app.UseWelcomePage();
// TODO: don't be lazy
app.UseErrorPage();
}

/// <summary>
@@ -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>&copy; @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"
}
}
@@ -2,23 +2,34 @@
"webroot": "wwwroot",
"version": "1.0-bae-*",
"authors": [ "Alex Forbes-Reed" ],
"description": "",
"description": "Taylor Swift API - After all, she is bae.",
"exclude": [
"wwwroot"
"wwwroot",
"node_modules",
"bower_components"
],
"bundleExclude": [
"node_modules",
"bower_components",
"**.kproj",
"**.user",
"**.vspscc"
],
"packExclude": [
"**.kproj",
"**.user",
"**.vspscc"
],
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta1",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta1",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta1",
"Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-beta1",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta1",
"Microsoft.Framework.Logging": "1.0.0-beta1",
"Microsoft.Framework.Logging.Console": "1.0.0-beta1",
"Microsoft.AspNet.Mvc": "6.0.0-beta3",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta3",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta3",
"Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-beta3",
"Microsoft.Framework.ConfigurationModel": "1.0.0-beta3",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3",
"Microsoft.Framework.DependencyInjection": "1.0.0-beta3",
"Microsoft.Framework.Logging": "1.0.0-beta3",
"Microsoft.Framework.Logging.Console": "1.0.0-beta3",

"System.Security.Cryptography.Hashing": "4.0.0-beta",
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta",
@@ -30,9 +41,9 @@
"System.Security.Cryptography.X509Certificates": "4.0.0-beta",
"System.Security.Cryptography.RandomNumberGenerator": "4.0.0-beta",

"EntityFramework": "7.0.0-beta1",
"EntityFramework.SqlServer": "7.0.0-beta1",
"EntityFramework.Commands": "7.0.0-beta1",
"EntityFramework": "7.0.0-beta2",
"EntityFramework.SqlServer": "7.0.0-beta2",
"EntityFramework.Commands": "7.0.0-beta2",

"StackExchange.Redis": "1.0.394"
},
@@ -41,13 +52,16 @@
},
"frameworks": {
"aspnet50": { }
//"aspnetcore50": { }
},
"compilationOptions": {
"allowUnsafe": false,
"warningsAsErrors": false,
"languageVersion": "experimental"
},
"scripts": {
"postrestore": [ "npm install" ],
"prepare": [ "grunt bower:install" ]
},
"configurations": {
"Debugging": {
"compilationOptions": {

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.