Skip to content

Commit 25211bb

Browse files
committed
initial commit
0 parents  commit 25211bb

File tree

261 files changed

+80630
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+80630
-0
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#OS junk files
2+
[Tt]humbs.db
3+
*.DS_Store
4+
5+
#Visual Studio files
6+
*.[Oo]bj
7+
*.user
8+
*.aps
9+
*.pch
10+
*.vspscc
11+
*.vssscc
12+
*_i.c
13+
*_p.c
14+
*.ncb
15+
*.suo
16+
*.tlb
17+
*.tlh
18+
*.bak
19+
*.[Cc]ache
20+
*.ilk
21+
*.log
22+
*.lib
23+
*.sbr
24+
*.sdf
25+
*.opensdf
26+
*.unsuccessfulbuild
27+
ipch/
28+
obj/
29+
[Bb]in
30+
[Dd]ebug*/
31+
[Rr]elease*/
32+
Ankh.NoLoad
33+
34+
#Tooling
35+
_ReSharper*/
36+
*.resharper
37+
[Tt]est[Rr]esult*
38+
39+
#Project files
40+
[Bb]uild/
41+
42+
#Subversion files
43+
.svn
44+
45+
# Office Temp Files
46+
~$*
47+
48+
#NuGet
49+
packages/

.nuget/NuGet.Config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
</configuration>

.nuget/NuGet.exe

573 KB
Binary file not shown.

.nuget/NuGet.targets

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Windows specific commands -->
7+
<NuGetToolsPath Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
8+
<PackagesConfig Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
9+
<PackagesDir Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
10+
11+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
12+
<NuGetToolsPath Condition=" '$(OS)' != 'Windows_NT'">$(SolutionDir).nuget</NuGetToolsPath>
13+
<PackagesConfig Condition=" '$(OS)' != 'Windows_NT' ">packages.config</PackagesConfig>
14+
<PackagesDir Condition=" '$(OS)' != 'Windows_NT'">$(SolutionDir)packages</PackagesDir>
15+
16+
<!-- NuGet command -->
17+
<NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath>
18+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
19+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
20+
21+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
22+
23+
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
24+
<PackageSources>""</PackageSources>
25+
26+
<!-- Enable the restore command to run before builds -->
27+
<RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
28+
29+
<!-- Property that enables building a package from a project -->
30+
<BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>
31+
32+
<!-- Commands -->
33+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"</RestoreCommand>
34+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
35+
36+
<!-- Make the build depend on restore packages -->
37+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
38+
RestorePackages;
39+
$(BuildDependsOn);
40+
</BuildDependsOn>
41+
42+
<!-- Make the build depend on restore packages -->
43+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
44+
$(BuildDependsOn);
45+
BuildPackage;
46+
</BuildDependsOn>
47+
</PropertyGroup>
48+
49+
<Target Name="CheckPrerequisites">
50+
<!-- Raise an error if we're unable to locate nuget.exe -->
51+
<Error Condition="!Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
52+
</Target>
53+
54+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
55+
<Exec Command="$(RestoreCommand)"
56+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
57+
58+
<Exec Command="$(RestoreCommand)"
59+
LogStandardErrorAsError="true"
60+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
61+
</Target>
62+
63+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
64+
<Exec Command="$(BuildCommand)"
65+
Condition=" '$(OS)' != 'Windows_NT' " />
66+
67+
<Exec Command="$(BuildCommand)"
68+
LogStandardErrorAsError="true"
69+
Condition=" '$(OS)' == 'Windows_NT' " />
70+
</Target>
71+
</Project>

CreateScrillaWebsite.bat

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
REM Set the following user name and password
2+
set appName=scrilla.Web
3+
set appPoolName=scrilla.Web
4+
set appDirectory=D:\projects\scrilla\scrilla.Web
5+
set appUrl=http://scrilla:80
6+
REM make sure to add an entry for scrilla to the HOSTS file
7+
8+
REM create directory
9+
mkdir %appDirectory%
10+
11+
REM Clean up any old websites and apppools
12+
%systemroot%\system32\inetsrv\appcmd delete site /site.name:"%appName%"
13+
%systemroot%\system32\inetsrv\appcmd delete apppool /apppool.name:%appPoolName%
14+
15+
REM Create new apppool
16+
%systemroot%\system32\inetsrv\appcmd add apppool /apppool.name:%appPoolName% /managedRuntimeVersion:v4.0 /managedPipelineMode:Integrated /enable32BitAppOnWin64:false
17+
18+
REM Create website with apppool
19+
%systemroot%\system32\inetsrv\appcmd add site /site.name:%appName% /physicalPath:%appDirectory% /bindings:%appUrl%
20+
%systemroot%\system32\inetsrv\appcmd set site /site.name:%appName% /[path='/'].applicationPool:%appPoolName%
21+
iisreset
22+
23+
REM set directory permissions and clear readonly flag
24+
REM icacls %appDirectory% /T /grant "IIS AppPool\%appPoolName%":(OI)(CI)F

GlobalAssemblyInfo.cs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
[assembly: AssemblyCopyright("Copyright © KAISIA 2012")]
14+
15+
[assembly: AssemblyVersion("0.9.0.0")]
16+
[assembly: AssemblyFileVersion("0.9.0.0")]

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Scrilla is a web application I made to solve a problem I had:
2+
- I love how mint.com pulls down (when it's working) all my financial transaction data
3+
- But I don't love how mint.com makes me use that data - I have a particular way of maintaining a budget for my household and a particular set of views into my financial life that I like to be able to see.
4+
5+
It was also a good opportunity to explore a few technologies:
6+
- ASP.NET MVC 3
7+
- FluentMigrator
8+
- Entity Framework Code First
9+
- Dapper
10+
11+
To use locally:
12+
- Add `127.0.0.1 scrilla` to your C:\Windows\System32\drivers\etc\hosts file to enable local access from http://scrilla/
13+
- Run `\CreateScrillaWebsite.bat` to create the IIS site and app pool
14+
- After building the solution, run `\scrilla.Data.Migrations\dev\scratch.bat` to create the local database along with permissions for IIS AppPool\scrilla.Web
15+
- Log in to your mint.com account and then go to https://wwws.mint.com/transactionDownload.event to initiate a full csv download of your account transactions
16+
- Navigate to http://scrilla/ and upload your transaction file
17+
- Do budget stuff!
18+
19+
For a demo try http://scrilla.azurewebsites.net/

TODO.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
** TODO **
3+
* how do i know what categories the money in the main account is earmarked for
4+
* how do we add fake transactions to represent savings category transfers
5+
* I need a better way to be able to see the bottom line for Primary Checking and also Food budget, blow budget, etc
6+
* put totals at the bottom of /Transactions (maybe a partial view of /Categories)
7+
* Graphs
8+
9+
* Need to write unit tests for all this stuff
10+
* Need to refactor so ALL data is created in the controller
11+
12+
* what does it mean when a bill transaction is paid but the matching account transaction doesn't have the same amount
13+
* includeTransfers not included in /Categories th links
14+
15+
* /Budget?month=2011-11-20 doesn't work
16+
* table headers don't all have same color
17+
* PartialViews /Vendor/25 create links with accountId= instead of just leaving that part off
18+
* rename Transaction -> AccountTransaction
19+
* All service methods should do proper error checking
20+
* All controller actions that call service methods should do error processing
21+
* figure out how to handle difference between http://scrilla.localhost/Budget and
22+
* http://scrilla.localhost/Categories?from=2010-09-01&to=2011-09-30 (hint: /Budget only sums for the primary account)
23+
* change .not() to :not()

scrilla.Data.EF/App.config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<configuration>
2+
<connectionStrings>
3+
<add name="scrillaContext" providerName="System.Data.SqlClient" connectionString="Server=localhost;Database=scrilla;Trusted_Connection=true" />
4+
</connectionStrings>
5+
</configuration>

scrilla.Data.EF/DatabaseFactory.cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace scrilla.Data.EF
7+
{
8+
public class DatabaseFactory : Disposable, IDatabaseFactory
9+
{
10+
private scrillaContext dataContext;
11+
public scrillaContext Get()
12+
{
13+
return dataContext ?? (dataContext = new scrillaContext());
14+
}
15+
protected override void DisposeCore()
16+
{
17+
if (dataContext != null)
18+
dataContext.Dispose();
19+
}
20+
}
21+
}

scrilla.Data.EF/Disposable.cs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace scrilla.Data.EF
7+
{
8+
public class Disposable : IDisposable
9+
{
10+
private bool isDisposed;
11+
12+
~Disposable()
13+
{
14+
Dispose(false);
15+
}
16+
17+
public void Dispose()
18+
{
19+
Dispose(true);
20+
GC.SuppressFinalize(this);
21+
}
22+
private void Dispose(bool disposing)
23+
{
24+
if (!isDisposed && disposing)
25+
{
26+
DisposeCore();
27+
}
28+
29+
isDisposed = true;
30+
}
31+
32+
protected virtual void DisposeCore()
33+
{
34+
}
35+
}
36+
}

scrilla.Data.EF/IDatabaseFactory.cs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace scrilla.Data.EF
7+
{
8+
public interface IDatabaseFactory : IDisposable
9+
{
10+
scrillaContext Get();
11+
}
12+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Data.Entity.ModelConfiguration;
6+
using scrilla.Data.Domain;
7+
8+
namespace scrilla.Data.EF.Mapping
9+
{
10+
public class AccountGroupMap : EntityTypeConfiguration<AccountGroup>
11+
{
12+
public AccountGroupMap()
13+
{
14+
// Primary Key
15+
this.HasKey(t => t.Id);
16+
17+
// Properties
18+
this.Property(t => t.Name)
19+
.IsRequired()
20+
.HasMaxLength(255);
21+
22+
// Table & Column Mappings
23+
this.ToTable("AccountGroup");
24+
this.Property(t => t.Id).HasColumnName("Id");
25+
this.Property(t => t.Name).HasColumnName("Name");
26+
this.Property(t => t.IsActive).HasColumnName("IsActive");
27+
this.Property(t => t.DisplayOrder).HasColumnName("DisplayOrder");
28+
}
29+
}
30+
}

scrilla.Data.EF/Mapping/AccountMap.cs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Data.Entity.ModelConfiguration;
3+
using System.Data.Common;
4+
using System.Data.Entity;
5+
using System.Collections.Generic;
6+
using System.ComponentModel.DataAnnotations;
7+
using scrilla.Data.Domain;
8+
9+
namespace scrilla.Data.EF.Mapping
10+
{
11+
public class AccountMap : EntityTypeConfiguration<Account>
12+
{
13+
public AccountMap()
14+
{
15+
// Primary Key
16+
this.HasKey(t => t.Id);
17+
18+
// Properties
19+
this.Property(t => t.Name)
20+
.IsRequired()
21+
.HasMaxLength(255);
22+
23+
// Table & Column Mappings
24+
this.ToTable("Account");
25+
this.Property(t => t.Id).HasColumnName("Id");
26+
this.Property(t => t.Name).HasColumnName("Name");
27+
this.Property(t => t.InitialBalance).HasColumnName("InitialBalance");
28+
this.Property(t => t.Balance).HasColumnName("Balance");
29+
this.Property(t => t.BalanceTimestamp).HasColumnName("BalanceTimestamp");
30+
31+
// Relationships
32+
this.HasRequired(t => t.AccountGroup)
33+
.WithMany(t => t.Accounts)
34+
.HasForeignKey(d => d.AccountGroupId);
35+
}
36+
}
37+
}
38+

0 commit comments

Comments
 (0)