Compare commits

...

6 commits

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">
<title>{% block title %}{{ title }} - What 2 Watch{% endblock %}</title>
<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 %}

View file

@ -1,26 +1,56 @@
{% 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 content %}
<p>
<form action="/signup" enctype="application/x-www-form-urlencoded" method="post">
<div role="main" aria-label="Sign In" class="page-content user signin">
<div class="ui middle very relaxed page grid">
<div class="ui container column fluid">
<h4 class="ui top attached header center">
Sign Up
</h4>
<div class="ui attached segment">
<form class="ui form" action="/signup" enctype="application/x-www-form-urlencoded" method="post">
<input type="hidden" value="{{ self.receipt }}" name="receipt">
<div class="required inline field ">
<label for="username">Username</label>
<input type="text" name="username" id="username" minlength="1" maxlength="20" required></br>
</div>
<div class="inline field ">
<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>
<input type="submit" value="Signup">
</div>
<div class="inline field">
<label></label>
<button class="ui primary button">
Sign Up
</button>
</div>
</form>
</p>
</div>
</div>
</div>
</div>
{% endblock %}