Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
abd9ebb
yolo-ing in a gitignore from the gods: https://raw.githubusercontent.…
longda Aug 8, 2014
5e074c7
roughing out the solution structure - this commit is useless other th…
longda Aug 8, 2014
c90c2e0
Here's what I just did: [renamed: src/notesy/notesy.sln -> src/not…
longda Aug 8, 2014
5145054
removing boilerplate class
longda Aug 8, 2014
5346518
Fixing up namespaces
longda Aug 8, 2014
0801052
setting things up - we don't need a .Web project for this task but i…
longda Aug 8, 2014
bccd610
forgot to build after setting things up... oops
longda Aug 8, 2014
47486e7
More project setup/cleanup. As with most platforms, setup is where a…
longda Aug 8, 2014
29cad3f
What is a note? Here's a model to help define it
longda Aug 8, 2014
d510f39
super hard to program while trying to be overly atomic for illustrati…
longda Aug 8, 2014
eb94a73
A lot going on here: 1) forgot an id on note model, 2) scafolding out…
longda Aug 8, 2014
7157594
Let's start stubbing out the service with simple fake data
longda Aug 9, 2014
1025bc6
Updating model to spec, adding some unicode to the example because, w…
longda Aug 9, 2014
d7ad73e
Oh hai dependency injection stuff! Let's go with Ninject since it's …
longda Aug 9, 2014
0078ebd
Roughing out api and auth
longda Aug 9, 2014
abc3a4e
injecting dependencies... :bomb:
longda Aug 9, 2014
cb341bf
I just added a critical juncture note in the readme =]
longda Aug 9, 2014
2d39a98
Cool! So, the basic version of the api is setup to return with some b…
longda Aug 9, 2014
28a2eee
note #2 in readme
longda Aug 9, 2014
a487f0e
roughing out the api user models, services, and relationships
longda Aug 9, 2014
32aca04
roughed out some of the api auth
longda Aug 9, 2014
74387e5
first pass of data tier stuff (tm). does it work? who knows! That's…
longda Aug 9, 2014
6bae8c3
Woohoo! We're lucky our test passed. :sunglasses:
longda Aug 9, 2014
8139aa1
Fixed the id issue when creating a new Note.
longda Aug 9, 2014
c39680d
finished up the api user service
longda Aug 10, 2014
b96ad60
Added GetApiUserByApiKey() call. Quick bug fix in GetApiUser().
longda Aug 10, 2014
f61b477
Logic updates in Save Note call.
longda Aug 10, 2014
642e50b
Added in some tests for ApiHelper, more roughing out of auth helper m…
longda Aug 10, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,21 @@ Submit a pull request when you are finished and satisfied with your work.

## License
[MIT](http://opensource.org/licenses/MIT)


----
edits by longda below:


## Note #1:
At this point, we've reached a critical juncture in our journey. If we were working a big team, we could start dividing things up:

1. If we had a web app that user's could, um, use to make notes for instance, we could hand that off to a front-end dev to start whipping things out using the stub services rather than REAL services that have to hit a REAL data store. Another example (which could be developed in tandem) would be an admin site where our internal team could start setting up user accounts to use our API.
2. We could start talking to a dba type to start setting up our db and our sprocs, etc.
3. We could also have a middle-tier dev start fleshing out the API calls and the auth and maybe even an ORM or something.
4. Or we could scrap all that and just have a tech lead do it! :boom:


## Note #2:
Here's the sample output from the get call as of this point:
{"Id":1,"Title":"Go to the Galaxy Game.","Description":"Head over to Stub Hub Center in Carson, California for a lovely game of fútbol.","IsComplete":false}
182 changes: 182 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Roslyn cache directories
*.ide/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/
82 changes: 82 additions & 0 deletions src/Notesy.Api/App_Start/NinjectWebCommon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Notesy.Api.App_Start.NinjectWebCommon), "Start")]
[assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(Notesy.Api.App_Start.NinjectWebCommon), "Stop")]

namespace Notesy.Api.App_Start
{
using System;
using System.Web;

using Microsoft.Web.Infrastructure.DynamicModuleHelper;

using Ninject;
using Ninject.Web.Common;

using Notesy.Core.Services.Concrete;
using Notesy.Core.Services.Interfaces;
using Notesy.Core.Services.Stubs;

public static class NinjectWebCommon
{
private static readonly Bootstrapper bootstrapper = new Bootstrapper();

/// <summary>
/// Starts the application
/// </summary>
public static void Start()
{
DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
bootstrapper.Initialize(CreateKernel);
}

/// <summary>
/// Stops the application.
/// </summary>
public static void Stop()
{
bootstrapper.ShutDown();
}

/// <summary>
/// Creates the kernel that will manage your application.
/// </summary>
/// <returns>The created kernel.</returns>
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
try
{
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();

// Note: Look how easy that is to swap out the fake services (which might not hit a real db) for real ones. I bet we could
// even do that with a config setting or db setting too (or not)!

//RegisterServices(kernel);
RegisterStubServices(kernel);
return kernel;
}
catch
{
kernel.Dispose();
throw;
}
}

/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<INoteService>().To<NoteService>().InRequestScope();
kernel.Bind<IApiUserService>().To<ApiUserService>().InRequestScope();
}

private static void RegisterStubServices(IKernel kernel)
{
kernel.Bind<INoteService>().To<NoteServiceStub>().InRequestScope();
kernel.Bind<IApiUserService>().To<ApiUserServiceStub>().InRequestScope();
}
}
}
23 changes: 23 additions & 0 deletions src/Notesy.Api/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Notesy.Api
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
Loading