Skip to content

Commit

Permalink
Merge pull request #32 from kcoderhtml/dev
Browse files Browse the repository at this point in the history
feat: v0.2.3
  • Loading branch information
kcoderhtml authored Apr 29, 2024
2 parents 4dce13d + 26c83bd commit 823fb3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 52 deletions.
48 changes: 3 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,5 @@
# Astro Starter Kit: Minimal
# MagicSnap - A modern, easy to use, and open source team management software

```sh
npm create astro@latest -- --template minimal
```
MagicSnap was a project I started thinking about around December of 2023 when I joined a frc robotics team for the first time. My team was using teamsnap at the time but no one liked it, it was exceptionaly clunky, slow, and riddled with ads for the free tier. My goal became to make a better solution both to give my team a better solution and to have an interesting project to work on.

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/minimal/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
I've been working on this project for over 2 months of active development now and I'm quite proud of it. The main site is hosted on netlify with serverless functions providing access to astro db where all the data is stored for the team. Emails are provided by a cloudflare worker based off of [Sh4yy/cloudflare-email](https://github.com/Sh4yy/cloudflare-email) which can be found here [kcoderhtml/cloudflare-email](https://github.com/kcoderhtml/cloudflare-email). The site is written in astro and is fully typescript native.
12 changes: 6 additions & 6 deletions auth.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export default defineConfig({
},
});

role[0].role = "admin";
newUser = true;
role[0] = { role: "admin" };
newUser = true;
} else {
await db.insert(User).values({
userId: profile["https://slack.com/user_id"],
Expand Down Expand Up @@ -139,11 +139,11 @@ export default defineConfig({
},
});

role[0].role = "user";
newUser = true;
role[0] = { role: "user" };
newUser = true;
}
} else {
role[0].role = "guest";
role[0] = { role: "guest" };

await logsnag.track({
channel: "signups",
Expand Down Expand Up @@ -179,7 +179,7 @@ export default defineConfig({
teamName: profile["https://slack.com/team_name"],
teamImage: profile["https://slack.com/team_image_230"],
role: role[0].role || "guest",
newUser: newUser,
newUser: newUser,
};
},
}),
Expand Down
4 changes: 3 additions & 1 deletion src/pages/users.astro
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ let users = await db.select().from(User).where(like(User.team, session.team));
<tr>
<th>Name</th>
<th>Email</th>
<th>Allergies</th>
<th>Image</th>
<th>Role</th>
{
Expand All @@ -114,10 +115,11 @@ let users = await db.select().from(User).where(like(User.team, session.team));
</thead>
<tbody>
{
users.map(({ userId, name, email, image, role }) => (
users.map(({ userId, name, email, image, role, allergies }) => (
<tr>
<td>{name}</td>
<td>{email || "N/A"}</td>
<td>{allergies}</td>
<td>
<img src=`${image}` alt="" class="profile-pic"/>
</td>
Expand Down

0 comments on commit 823fb3b

Please sign in to comment.