Skip to content

Commit

Permalink
fix: frontend and backend integration
Browse files Browse the repository at this point in the history
  • Loading branch information
azaleacolburn committed Feb 15, 2025
1 parent fe1f0cc commit ae82312
Show file tree
Hide file tree
Showing 32 changed files with 402 additions and 844 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DATABASE_URL="postgresql://username:password@localhost:5432/database?schema=public"
DATABASE_URL="postgresql://username:password@localhost:5432/database?schema=public"
91 changes: 44 additions & 47 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,49 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs =
{ nixpkgs, ... }:
let
forAllSystems =
with nixpkgs.lib;
f: genAttrs systems.flakeExposed (system: f nixpkgs.legacyPackages.${system});
in
{
devShells = forAllSystems (pkgs: {
default =
with pkgs;
mkShell {
env = {
PRISMA_QUERY_ENGINE_LIBRARY = "${prisma-engines}/lib/libquery_engine.node";
PRISMA_QUERY_ENGINE_BINARY = "${prisma-engines}/bin/query-engine";
PRISMA_SCHEMA_ENGINE_BINARY = "${prisma-engines}/bin/schema-engine";
};
buildInputs = [
postgresql_17
bun
nodePackages_latest.prettier
openssl
];
shellHook = ''
export PG=$PWD/.dev_postgres/
export PGDATA="$PG"data
export PGPORT=5432
export PGHOST=localhost
export PGUSER=$USER
export PGPASSWORD=postgres
export PGDATABASE=example
export DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@$PGHOST:$PGPORT/$PGDATABASE
alias pg_start="pg_ctl -D $PGDATA -l $PG/postgres.log start"
alias pg_stop="pg_ctl -D $PGDATA stop"
pg_setup() {
pg_stop;
rm -rf $PG;
initdb -D $PGDATA &&
echo "unix_socket_directories = '$PGDATA'" >> $PGDATA/postgresql.conf &&
pg_ctl -D $PGDATA -l $PG/postgres.log start &&
createdb
}
alias exit="pg_ctl -D $PGDATA stop && exit"
'';
outputs = {nixpkgs, ...}: let
forAllSystems = with nixpkgs.lib;
f: genAttrs systems.flakeExposed (system: f nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (pkgs: {
default = with pkgs;
mkShell {
env = {
PRISMA_QUERY_ENGINE_LIBRARY = "${prisma-engines}/lib/libquery_engine.node";
PRISMA_QUERY_ENGINE_BINARY = "${prisma-engines}/bin/query-engine";
PRISMA_SCHEMA_ENGINE_BINARY = "${prisma-engines}/bin/schema-engine";
};
});
};
buildInputs = [
postgresql_17
bun
nodePackages_latest.prettier
openssl
];
shellHook = ''
export PG=$PWD/.dev_postgres/
export PGDATA="$PG"data
export PGPORT=5432
export PGHOST=localhost
export PGUSER=$USER
export PGPASSWORD=postgres
export PGDATABASE=example
export DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@$PGHOST:$PGPORT/$PGDATABASE
pg_setup() {
pg_stop;
rm -rf $PG;
initdb -D $PGDATA &&
echo "unix_socket_directories = '$PGDATA'" >> $PGDATA/postgresql.conf &&
pg_ctl -D $PGDATA -l $PG/postgres.log start &&
createdb
}
alias pg_start="pg_ctl -D $PGDATA -l $PG/postgres.log start"
alias pg_stop="pg_ctl -D $PGDATA stop"
alias pg_drop="psql -U $PGUSER -c 'DROP DATABASE $PGDATABASE'"
alias exit="pg_ctl -D $PGDATA stop && exit"
'';
};
});
};
}
20 changes: 0 additions & 20 deletions prisma/migrations/20241226041546_init_user_and_post/migration.sql

This file was deleted.

249 changes: 0 additions & 249 deletions prisma/migrations/20250124063932_migration/migration.sql

This file was deleted.

Loading

0 comments on commit ae82312

Please sign in to comment.