Skip to content

Commit

Permalink
Schema fixes and backend (#71)
Browse files Browse the repository at this point in the history
* refactor: ♻️ included database setup instructions into README.md

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ added more steps to README.md

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ modified schema.ts for increased normalization

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* fix: 🐛 modified schema to remove primary key error

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ overhauled api directory structure to match specification

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* chore: 🔧 uninstalled prisma

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* Revert "chore: 🔧 uninstalled prisma"

This reverts commit 83bb95c.

* feat: ✨ added boilerplate to all api routes

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ removed api routes, modified schema.ts for flatter hierarchy

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ temporarily removed migration, clarified schema changes

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ modified scripts

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* fix: 🐛 remove redundant import and script order

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* chore: 🔧 remove redundant import after merge

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* chore: 🔧 remove unused page

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

* refactor: ♻️ removed migration from postinstall

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>

---------

Signed-off-by: Adithya Anandsaikrishnan <[email protected]>
  • Loading branch information
adi-lux authored Apr 5, 2024
1 parent c02c96d commit bf6d7b3
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 1,158 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ vite.config.ts.timestamp-*
.sst
cdk.context.json

# db
src/lib/db/meta
src/lib/db/*.sql
# db, temporary until first release
/src/lib/db/migrations/
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Simple, clean, and efficient meeting scheduling app.
## Tech Stack

- [**S**ST](https://sst.dev)
- [**P**risma](https://prisma.io)
- [**D**rizzle](https://orm.drizzle.team/)
- [Svelte**K**it](https://kit.svelte.dev)
- [**L**ucia](https://lucia-auth.com)

Expand All @@ -30,6 +30,15 @@ Simple, clean, and efficient meeting scheduling app.
1. `pnpm start` (run `pnpm start --host` if you want to access the server from other devices on your network)
4. The app should be viewable at `localhost:5173` by default. Changes to the code will automatically update the page. If you ran `pnpm start --host`, you can access the app from other devices on your network at `host-ip:5173`.

### Local Database Setup

1. Go to the [Postgres official website](https://www.postgresql.org/download/) and download the database for your specific OS. \([Here](https://www.postgresql.org/docs/16/tutorial-start.html) is more information, if you get stuck)
2. While running the setup, ensure that pgAdmin is downloaded alongside Postgres itself
3. Once connected to the Postgres Server, Right click on databases -> create -> database, and name it `zotmeet`.
4. In the ZotMeet project root directory,`pnpm db:update` will generate a migrations folder which contain scripts you can run to update your database schema.
5. Create a .env file, and set `DATABASE_URL=postgres://yourusername:yourpassword@localhost:5432/zotmeet`
6. Using pgAdmin, run all the migration files in order. This can be done using the query tool.

### Committing Changes

- Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification when writing commit messages.
Expand Down
2 changes: 1 addition & 1 deletion drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!DATABASE_URL) {

export default {
schema: "./src/lib/db/schema.ts",
out: "./src/lib/db",
out: "./src/lib/db/migrations",
driver: "pg",
dbCredentials: {
connectionString: DATABASE_URL,
Expand Down
134 changes: 0 additions & 134 deletions migrations/0000_worried_nightcrawler.sql

This file was deleted.

1 change: 0 additions & 1 deletion migrations/0001_vengeful_korg.sql

This file was deleted.

Loading

0 comments on commit bf6d7b3

Please sign in to comment.