Skip to content

[WIP] Added Initial API #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

.ruff_cache

designs
frontend/node_modules
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ environs = "*"
dj-database-url = "*"
psycopg2-binary = "*"
"redis[hiredis]" = "*"
django-microapi = "*"

[dev-packages]
pytest = "*"
Expand Down
19 changes: 14 additions & 5 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added designs/stopwatch_icon_big.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# API Layout & Verbs

## V1 of the API

* `/api/v1/`
* `GET` (A list of endpoints)
* `/api/v1/schema/`
* `GET` (Maybe...)

### Accounts

* `/api/v1/accounts/login/`
* `POST`
* `/api/v1/accounts/signup/`
* `POST`
* `/api/v1/accounts/reset_password/`
* `POST`
* `/api/v1/accounts/logout/`
* `POST`

### Teams

* `/api/v1/teams/`
* `GET`
* `POST` (Create team)
* `/api/v1/teams/:pk/`
* `GET`
* `PUT`
* `DELETE`
* `/api/v1/teams/:pk/members/`
* `GET`
* `POST`
* `/api/v1/teams/:pk/members/:pk/`
* `GET`
* `PUT`
* `DELETE`
* `/api/v1/teams/:pk/invites/`
* `GET`
* `POST` (Create invite)
* `/api/v1/teams/:pk/invites/:pk/`
* `GET`
* `POST` (Accept invite)

### Competitions

* `/api/v1/competitions/`
* `GET`
* `/api/v1/competitions/:pk/`
* `GET`
* `/api/v1/competitions/:pk/commits/`
* `GET` (Stream of commits - maybe websockets?)
* `/api/v1/competitions/:pk/entries/`
* `GET`
* `POST` (Create entry)
* `/api/v1/competitions/:pk/entries/:pk/`
* `GET`
* `PUT`
* `DELETE`
* `/api/v1/competitions/:pk/sponsors/`
* `GET`
* `/api/v1/competitions/:pk/results/`
* `GET`
* `/api/v1/competitions/:pk/results/:pk/`
* `GET`
16 changes: 16 additions & 0 deletions docs/discord_rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
**Rules:**
The following are the general rules for participating here. If someone is violating these rules, please ping the @Organizers role.

**Rule 1:** Follow the [Django Code of Conduct](https://www.djangoproject.com/conduct/)

**Rule 2:** Follow the [Discord Community Guidelines](https://discord.com/guidelines) and [Terms of Service](https://discord.com/guidelines).

**Rule 3:** This is first & foremost a friendly competition. Good sportsmanship is expected; and if you're spectating, be a fan, not a fanatic.

**Rule 4:** This is a generally English-speaking server, but be understanding of those for whom it's not their first language.

**Rule 5:** No advertising please.

**Rule 6:** Keep discussions on-topic. This server exists to support the competition & the competitors.

**Rule 7:** Have fun! :tada:
32 changes: 20 additions & 12 deletions frontend/src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function Footer({ ...props }) {
class="center-column text-stone-200 text-sm"
>
<nav
class="mb-4 grid grid-cols-4 gap-4"
class="mb-4 grid grid-cols-3 gap-4"
>
<div>
<dl>
Expand All @@ -17,19 +17,19 @@ export function Footer({ ...props }) {
<a href="/">Home</a>
</dd>
<dd>
<a href={`/${currentYear}/rules/`}>Rules</a>
<a href={`/${currentYear}/about/`}>About</a>
</dd>
<dd>
<a href={`/${currentYear}/sponsors/`}>Sponsors</a>
<a href={`/${currentYear}/rules/`}>Rules</a>
</dd>
<dd>
<a href={`/${currentYear}/about/`}>About</a>
<a href={`/code-of-conduct/`}>Code Of Conduct</a>
</dd>
<dd>
<a href={`/faq/`}>FAQ</a>
</dd>
<dd>
<a href="https://github.com/toastdriven/django-dash">Source on GitHub</a>
<a href={`/${currentYear}/sponsors/`}>Sponsors</a>
</dd>
</dl>
</div>
Expand Down Expand Up @@ -58,30 +58,38 @@ export function Footer({ ...props }) {
</dl>
</div>

<div>

</div>

<div>
<dl>
<dt class="font-bold text-base mb-2">Social</dt>
<dd>
<a rel="me" href="https://hachyderm.io/@djangodash">Mastodon</a>
Updates on <a rel="me" href="https://hachyderm.io/@djangodash">Mastodon</a>
</dd>
<dd>
Chat on <a href="https://discord.gg/t3bB38QXv3">Discord</a>
</dd>
<dd>
<a href="https://github.com/toastdriven/django-dash">Source on GitHub</a>
</dd>
</dl>
</div>
</nav>

<div
class="mb-4 flex flex-row gap-2"
class="mb-8 flex flex-row gap-2"
>
{/* FIXME: Sponsor Logos! */}
<dl>
<dt class="font-bold text-base mb-2">Sponsors</dt>
<dd>

</dd>
</dl>
</div>

<div
class="text-center"
>
<div class="mb-2">
<div class="mb-2 italic">
Copyright 2008&mdash;{currentYear}
</div>

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { render } from 'preact';
import { LocationProvider, Router, Route } from 'preact-iso';

import { Home } from '@/pages/Home.jsx';
import { CodeOfConduct } from '@/pages/competitions/CodeOfConduct.jsx';
import { Faq } from '@/pages/competitions/Faq.jsx';
import { Rules } from '@/pages/competitions/Rules.jsx';
import { Sponsors } from '@/pages/competitions/Sponsors.jsx';
Expand All @@ -18,6 +19,7 @@ export function App() {
<Route path="/" component={Home} />

<Route path="/faq/" component={Faq} />
<Route path="/code-of-conduct/" component={CodeOfConduct} />

<Route path="/:year/rules/" component={Rules} />
<Route path="/:year/sponsors/" component={Sponsors} />
Expand Down
71 changes: 68 additions & 3 deletions frontend/src/pages/competitions/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,78 @@ export function About() {
<Header />

<MainContent>
<h1 class="text-5xl font-bold mb-8">About</h1>
<section class="mb-8">
<h1 class="text-5xl font-bold mb-8">About</h1>

<section>
<p>
The Django Dash is
The Django Dash is a chance for Django enthusiasts to flex their
coding skills a little, and put a fine point on
<i>“perfectionists with deadlines”</i>
by giving you a <strong>REAL</strong> deadline. 48 hours from start
to stop to produce the best app you can and have a little fun in
the process.
</p>
</section>

<section class="mb-8">
<h2 class="text-3xl font-bold mb-8">History</h2>

<p>
The Django Dash originally started in late 2007. At the time,
interest in <a href="https://djangoproject.com/">Django</a>{' '}
was taking off, with the (somewhat) recently
released{' '}
<a href="https://www.djangoproject.com/weblog/2007/mar/23/096/">0.96</a>{' '}
version headlining some great new features.
</p>

<p>
At the same time, <a href="https://rubyonrails.org/">Ruby on Rails</a>{' '}
was exploding, & there were several competitions devoted to it. But
nothing in the Django sphere.
</p>

<p>
Fresh off of competing in a <a href="https://pyweek.org/">PyWeek</a>{' '}
game programming compeition & hyped by everything happening in the
Django community, <a href="https://toastdriven.com/">Daniel</a>{' '}
created a competition called the "Django Dash".
</p>

<p>
It was hosted yearly for several years (2008-2013), then life
happened. As the Dash is an unpaid labor of love & judging is
especially painful, it was backburned for many years.
</p>

<p>
And now it returns for 2024! <code>:tada:</code>
</p>
</section>

<section class="mb-8">
<h2 class="text-3xl font-bold mb-8">Past Projects</h2>

<p>
Some notable projects found their beginnings as part of
previously held Django Dashes, including:
</p>

<ul>
<li>
<a href="https://readthedocs.org/">Read The Docs</a>
</li>
<li>
<a href="https://djangopackages.org/">Django Packages</a>
</li>
<li>
<i>
Missing your project? Please open a{' '}
<a href="https://github.com/toastdriven/django-dash/pulls">Pull Request</a>!
</i>
</li>
</ul>
</section>
</MainContent>

<Footer />
Expand Down
65 changes: 65 additions & 0 deletions frontend/src/pages/competitions/CodeOfConduct.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { Header } from '@/components/Header.jsx';
import { MainContent } from '@/components/MainContent';
import { Footer } from '@/components/Footer.jsx';

function FIXME() {
return (
<span class="text-red-500">FIXME:</span>
);
}

export function CodeOfConduct({ ...props }) {
return (
<>
<Header />

<MainContent>
<h1 class="text-5xl font-bold mb-8">Code of Conduct</h1>

<div class="mb-4">
<p>
The Django Dash is a community event, and as such, our expectation
is that anyone who wishes to participate in the Django Dash should
be willing to engage with others in good faith & as a reasonable
human being.
</p>

<p>
To that end, we're adopting the same{' '}
<a href="https://www.djangoproject.com/conduct/">
Code of Conduct
</a> as Django itself.
</p>

<p>
These rules apply to all aspects of the Dash,
including but not limited to: user profiles, team information, the
entries themselves, and communications on Discord. For clarity, the
basic rules are repeated here:
</p>

<ol
class="block list-decimal ml-8 mb-8"
>
<li>Be friendly and patient.</li>
<li>Be welcoming.</li>
<li>Be considerate.</li>
<li>Be respectful.</li>
<li>Be careful in the words that you choose.</li>
<li>When we disagree, try to understand why.</li>
</ol>

<p>
Anyone are unable or unwilling to follow these rules may be
subject to immediate removal from participation, and/or have their
entries disqualified from judging. If you believe someone is
violating the code of conduct, please contact{' '}
<a href="mailto:info@djangodash.com">info@djangodash.com</a>.
</p>
</div>
</MainContent>

<Footer />
</>
);
}
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ setup:
docker volume rm django-dash_postgres-data
docker compose run --rm web bash -c "sleep 10 && createdb -U postgres -h db -p 5432 django-dash"
docker compose run --rm web bash -c "pipenv run src/manage.py migrate"
docker compose run --rm web bash -c "pipenv run src/manage.py createsuperuser"

@console:
docker compose run --rm web bash
Expand Down
Empty file added src/accounts/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions src/accounts/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AccountsConfig(AppConfig):
name = "accounts"
verbose_name = "Accounts"
Loading