Compare commits

...

6 Commits

Author SHA1 Message Date
Joe Ardent fe6b05313f Merge branch 'main' into pretty_form 2024-03-10 22:10:06 -07:00
Joe Ardent 754e1f21a1 whitespace clean, update clause to collective 2024-03-10 22:08:15 -07:00
Erika Rowland 08033c21b8 chore: remove unnecessary version tag 2024-03-10 19:36:30 -07:00
Erika Rowland ea91d4cf04 docs: Add basic readme 2024-03-10 19:34:41 -07:00
Erika Rowland a1b7df01d6 Add example .env file 2024-03-10 19:25:35 -07:00
Erika Rowland 15e2939a68 feat: Add CSS to sign up form 2024-03-10 19:23:51 -07:00
4 changed files with 103 additions and 17 deletions

9
.env.example Normal file
View File

@ -0,0 +1,9 @@
RUST_LOG=queenie=info
ADMIN_TOKEN=
STRIPE_TOKEN=
FORGEJO_URL=http://localhost:3000
DATABASE_URL=sqlite://queenie.db
MONTHLY_LINK=
ANNUAL_LINK=
LISTENING_ADDR=127.0.0.1
LISTENING_PORT=4008

45
README.md Normal file
View File

@ -0,0 +1,45 @@
# Queen
## Setting up dev environment
Copy the `.env.example` to `.env` then fill in missing variables:
```sh
cp .env.example .env
```
Use `sqlx-cli` (install using `cargo install sqlx-cli`) to create and migrate the database:
```sh
sqlx db create ; sqlx migrate run
```
## Development
Run the server for development:
```
cargo run
```
The assets used in Queen come from forgejo,
so you can use a local Caddyfile to serve both forgejo and `queen`
(assuming that forgejo is running on localhost:3000):
```
{
http_port 9000
}
localhost:9000 {
reverse_proxy /signup* localhost:4008
reverse_proxy /payment_success* localhost:4008
reverse_proxy localhost:3000
}
```
Run caddy with:
```
caddy run --config Caddyfile
```

View File

@ -6,6 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{{ title }} - What 2 Watch{% endblock %}</title> <title>{% block title %}{{ title }} - What 2 Watch{% endblock %}</title>
<link rel="stylesheet" href="/assets/ww.css"> <link rel="stylesheet" href="/assets/ww.css">
<link rel="stylesheet" href="/assets/css/index.css">
<link rel="stylesheet" href="/assets/css/theme-forgejo-auto.css">
{% block head %}{% endblock %} {% block head %}{% endblock %}

View File

@ -1,26 +1,56 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Welcome, friend, to git.kittenclause.com{% endblock %} {% block title %}Welcome, friend, to git.kittencollective.com{% endblock %}
{% block header %} {% endblock %} {% block header %} {% endblock %}
{% block content %} {% block content %}
<p> <div role="main" aria-label="Sign In" class="page-content user signin">
<form action="/signup" enctype="application/x-www-form-urlencoded" method="post"> <div class="ui middle very relaxed page grid">
<input type="hidden" value="{{ self.receipt }}" name="receipt"> <div class="ui container column fluid">
<label for="username">Username</label> <h4 class="ui top attached header center">
<input type="text" name="username" id="username" minlength="1" maxlength="20" required></br> Sign Up
<label for="displayname">Displayname (optional)</label> </h4>
<input type="text" name="displayname" id="displayname"></br> <div class="ui attached segment">
<label for="email">Email</label> <form class="ui form" action="/signup" enctype="application/x-www-form-urlencoded" method="post">
<input type="text" name="email"></br> <input type="hidden" value="{{ self.receipt }}" name="receipt">
<label for="password">Password</label> <div class="required inline field ">
<input type="password" name="password" id="password" required></br> <label for="username">Username</label>
<label for="confirm_password">Confirm Password</label> <input type="text" name="username" id="username" minlength="1" maxlength="20" required></br>
<input type="password" name="pw_verify" id="pw_verify" required></br> </div>
<input type="submit" value="Signup">
</form> <div class="inline field ">
</p> <label for="displayname">Displayname (optional)</label>
<input type="text" name="displayname" id="displayname"></br>
</div>
<div class="required inline field ">
<label for="email">Email</label>
<input type="text" name="email"></br>
</div>
<div class="required inline field ">
<label for="password">Password</label>
<input type="password" name="password" id="password" required></br>
</div>
<div class="required inline field ">
<label for="confirm_password">Confirm Password</label>
<input type="password" name="pw_verify" id="pw_verify" required></br>
</div>
<div class="inline field">
<label></label>
<button class="ui primary button">
Sign Up
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}