Switched to MPA powered by Razor Pages

After reconsidering where I want to take this project, I realized that a MPA is more fitting.
This commit is contained in:
2021-07-20 19:08:57 -05:00
parent e0756e0967
commit 57f67391f1
141 changed files with 5292 additions and 22079 deletions

View File

@@ -1,28 +0,0 @@
import os
import shutil
SERVER_DIR = "server"
DATA_DIR = "Data"
DB_MIGRATE_CMD = "dotnet ef migrations add InitialCreate -o {0}"
DB_UPDATE_CMD = "dotnet ef database update"
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir("..")
os.chdir(SERVER_DIR)
print("Working in: " + os.getcwd())
migrationsDir = os.path.join(DATA_DIR, "Migrations")
print("Deleting current migrations directory if it exists.")
shutil.rmtree(migrationsDir, ignore_errors=True)
print("Deleting old app.db if it exists.")
if os.path.exists("app.db"):
os.remove("app.db")
print("Creating migration.")
os.system(DB_MIGRATE_CMD.format(migrationsDir))
print("Updating database.")
os.system(DB_UPDATE_CMD)

View File

@@ -1,31 +0,0 @@
import os
import asyncio
SERVER_CSPROJ_DIR = "server"
CLIENT_PACKAGE_DIR = "spa"
async def exec(cmd, path, silent=False):
devnull = open(os.devnull, "wb")
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir(os.pardir)
os.chdir(path)
proc = None
if (not silent):
print("Executing \"{0}\" in \"{1}\".".format(cmd, path))
proc = await asyncio.create_subprocess_shell(cmd)
else:
print("Executing \"{0}\" in \"{1}\" silently.".format(cmd, path))
proc = await asyncio.create_subprocess_shell(cmd, stdout=devnull)
await proc.wait()
devnull.close()
async def main():
print("Beginning development servers.")
await asyncio.gather(
exec("dotnet watch run", SERVER_CSPROJ_DIR),
exec("npm run serve", CLIENT_PACKAGE_DIR, silent=True))
asyncio.run(main())